Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Unified Diff: chrome/browser/android/vr_shell/vr_shell_gl.cc

Issue 2861343002: Enable gpu rasterization in the vr shell
Patch Set: additional trace instrumentation Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell_gl.h ('k') | skia/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell_gl.h ('k') | skia/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698