Permalink
Browse files

Enable Offscreen rendering support.

This patch enables basic support for WebGL and AC for Canvas2D.
One needs to pass --ignore-gpu-blacklist to run Canvas2D with AC.
AC of Canvas2D is a blacklisted feature on Linux.
  • Loading branch information...
1 parent 2203db2 commit 9d85ee4af61b2b15f80aab90d4047c435095e2d2 @kalyankondapally kalyankondapally committed Nov 29, 2013
@@ -0,0 +1,61 @@
+From 77877d89ea0f03816c9145dd804fce569c33e250 Mon Sep 17 00:00:00 2001
+From: Kondapally Kalyan <kalyan.kondapally@intel.com>
+Date: Fri, 29 Nov 2013 21:37:28 +0200
+Subject: [PATCH] EGL specific changes for Wayland.
+
+This patch adds following three snips, respectively giving support:
+1)EGLNativeDisplayType adjustment and khronos header. More info:
+ https://code.google.com/p/chromium/issues/detail?id=266310
+2)Support needed in NativeViewGLSurfaceEGL to resize window.
+ Changes related to resizing needs more testing before
+ trying to upstream the patch.
+3)OffScreen-rendering support for use cases like WebGL and
+ Canvas2D. This should be enabled in upstream but needs some
+ cross platform support before it can be done.
+ More info: https://codereview.chromium.org/49533003/
+---
+ ui/gl/gl_surface_egl.cc | 14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc
+index 3f8923a..92087af 100644
+--- a/ui/gl/gl_surface_egl.cc
++++ b/ui/gl/gl_surface_egl.cc
+@@ -118,8 +118,7 @@ bool GLSurfaceEGL::InitializeOneOff() {
+ LOG(ERROR) << "OZONE failed to initialize hardware";
+ return false;
+ }
+- g_native_display = reinterpret_cast<EGLNativeDisplayType>(
+- surface_factory->GetNativeDisplay());
++ g_native_display = surface_factory->GetNativeDisplay();
+ #else
+ g_native_display = EGL_DEFAULT_DISPLAY;
+ #endif
+@@ -432,6 +431,15 @@ bool NativeViewGLSurfaceEGL::Resize(const gfx::Size& size) {
+
+ Destroy();
+
++#if defined(USE_OZONE)
++ gfx::SurfaceFactoryOzone* surface_factory =
++ gfx::SurfaceFactoryOzone::GetInstance();
++
++ surface_factory->AttemptToResizeAcceleratedWidget(window_,
++ gfx::Rect(0, 0, size.width(),
++ size.height()));
++#endif
++
+ if (!Initialize()) {
+ LOG(ERROR) << "Failed to resize window.";
+ return false;
+@@ -750,7 +758,7 @@ GLSurface::CreateOffscreenGLSurface(const gfx::Size& size) {
+ case kGLImplementationEGLGLES2: {
+ scoped_refptr<GLSurface> surface;
+ if (g_egl_surfaceless_context_supported &&
+- (size.width() == 0 && size.height() == 0)) {
++ (size.width() == 1 && size.height() == 1)) {
+ surface = new SurfacelessEGL(size);
+ } else
+ surface = new PbufferGLSurfaceEGL(size);
+--
+1.7.9.5
+
@@ -1,52 +0,0 @@
-From 9a6f74102c35e60f0f9298d417593f6cf4baa3c8 Mon Sep 17 00:00:00 2001
-From: Kondapally Kalyan <kalyan.kondapally@intel.com>
-Date: Fri, 4 Oct 2013 11:39:08 +0300
-Subject: [PATCH] Chromium-Add-gl-changes-for-Wayland.
-
-This patch adds basic support needed in NativeViewGLSurfaceEGL to resize window.
-Changes related to resizing needs more testing before trying to upstream the patch.
----
- ui/gl/gl_surface_egl.cc | 13 +++++++++++--
- 1 file changed, 11 insertions(+), 2 deletions(-)
-
-diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc
-index 0c1871e..9e5f7f5 100644
---- a/ui/gl/gl_surface_egl.cc
-+++ b/ui/gl/gl_surface_egl.cc
-@@ -116,8 +116,7 @@ bool GLSurfaceEGL::InitializeOneOff() {
- LOG(ERROR) << "OZONE failed to initialize hardware";
- return false;
- }
-- g_native_display = reinterpret_cast<EGLNativeDisplayType>(
-- surface_factory->GetNativeDisplay());
-+ g_native_display = surface_factory->GetNativeDisplay();
- #else
- g_native_display = EGL_DEFAULT_DISPLAY;
- #endif
-@@ -394,6 +393,7 @@ bool NativeViewGLSurfaceEGL::Resize(const gfx::Size& size) {
- GLContext* current_context = GLContext::GetCurrent();
- bool was_current =
- current_context && current_context->IsCurrent(this);
-+
- if (was_current) {
- scoped_make_current.reset(
- new ui::ScopedMakeCurrent(current_context, this));
-@@ -402,6 +402,15 @@ bool NativeViewGLSurfaceEGL::Resize(const gfx::Size& size) {
-
- Destroy();
-
-+#if defined(USE_OZONE)
-+ gfx::SurfaceFactoryOzone* surface_factory =
-+ gfx::SurfaceFactoryOzone::GetInstance();
-+
-+ surface_factory->AttemptToResizeAcceleratedWidget(window_,
-+ gfx::Rect(0, 0, size.width(),
-+ size.height()));
-+#endif
-+
- if (!Initialize()) {
- LOG(ERROR) << "Failed to resize window.";
- return false;
---
-1.7.9.5
-

0 comments on commit 9d85ee4

Please sign in to comment.