| Index: chrome/browser/android/vr_shell/vr_shell_gl.cc
|
| diff --git a/chrome/browser/android/vr_shell/vr_shell_gl.cc b/chrome/browser/android/vr_shell/vr_shell_gl.cc
|
| index 9bdba4cc81b428493a4b91e82a4fe2ad1be76bba..3ae5a061ed8916aee08b28751f178c0955f02277 100644
|
| --- a/chrome/browser/android/vr_shell/vr_shell_gl.cc
|
| +++ b/chrome/browser/android/vr_shell/vr_shell_gl.cc
|
| @@ -30,6 +30,10 @@
|
| #include "device/vr/vr_math.h"
|
| #include "third_party/WebKit/public/platform/WebInputEvent.h"
|
| #include "third_party/WebKit/public/platform/WebMouseEvent.h"
|
| +#include "third_party/skia/include/gpu/GrContext.h"
|
| +#include "third_party/skia/include/gpu/GrContextOptions.h"
|
| +#include "third_party/skia/include/gpu/GrTypes.h"
|
| +#include "third_party/skia/include/gpu/gl/GrGLInterface.h"
|
| #include "ui/gl/android/scoped_java_surface.h"
|
| #include "ui/gl/android/surface_texture.h"
|
| #include "ui/gl/gl_bindings.h"
|
| @@ -263,6 +267,12 @@ void VrShellGl::InitializeGl(gfx::AcceleratedWidget window) {
|
| return;
|
| }
|
|
|
| + GrContextOptions gr_context_options;
|
| + gr_interface_ = GrGLCreateNativeInterface();
|
| + DCHECK_NE(nullptr, gr_interface_);
|
| + gr_context_ = GrContext::Create(
|
| + kOpenGL_GrBackend, (GrBackendContext)gr_interface_, gr_context_options);
|
| +
|
| unsigned int textures[2];
|
| glGenTextures(2, textures);
|
| content_texture_id_ = textures[0];
|
| @@ -279,7 +289,7 @@ void VrShellGl::InitializeGl(gfx::AcceleratedWidget window) {
|
|
|
| InitializeRenderer();
|
|
|
| - scene_->OnGLInitialized();
|
| + scene_->OnGLInitialized(this);
|
|
|
| gfx::Size webvr_size =
|
| device::GvrDelegate::GetRecommendedWebVrSize(gvr_api_.get());
|
| @@ -1311,6 +1321,12 @@ void VrShellGl::UpdateVSyncInterval(int64_t timebase_nanos,
|
| OnVSync();
|
| }
|
|
|
| +sk_sp<SkSurface> VrShellGl::MakeSurface(int width, int height) {
|
| + return SkSurface::MakeRenderTarget(gr_context_, SkBudgeted::kNo,
|
| + SkImageInfo::MakeN32Premul(width, height),
|
| + 0, kTopLeft_GrSurfaceOrigin, nullptr);
|
| +}
|
| +
|
| void VrShellGl::ForceExitVr() {
|
| browser_->ForceExitVr();
|
| }
|
|
|