Skip to content

Commit

Permalink
Enable support for Offscreen rendering.
Browse files Browse the repository at this point in the history
This patch enables support for Off-Screen rendering, which
is essential to support WebGL and other cases like Accelerated
Canvas2D. After this change, we should be able to run all web
pages using WebGL. We still have some conformance test failures,
which will be fixed in follow up patches.

Upstream CL: https://codereview.chromium.org/49533003/
  • Loading branch information
kalyankondapally committed Nov 29, 2013
1 parent 2203db2 commit 1b45b59
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions patches/0004-Chromium-Add-gl-changes-for-Wayland.patch
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
From 9a6f74102c35e60f0f9298d417593f6cf4baa3c8 Mon Sep 17 00:00:00 2001
From fc7a850da707cd0f00c21638a47104492bb8cf32 Mon Sep 17 00:00:00 2001
From: Kondapally Kalyan <kalyan.kondapally@intel.com>
Date: Fri, 4 Oct 2013 11:39:08 +0300
Date: Fri, 29 Nov 2013 13:24:43 +0200
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.
This patch adds following support:
1)Support needed in NativeViewGLSurfaceEGL to resize window.
Changes related to resizing needs more testing before
trying to upstream the patch.
2)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.
---
ui/gl/gl_surface_egl.cc | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
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 0c1871e..9e5f7f5 100644
index 3f8923a..92087af 100644
--- a/ui/gl/gl_surface_egl.cc
+++ b/ui/gl/gl_surface_egl.cc
@@ -116,8 +116,7 @@ bool GLSurfaceEGL::InitializeOneOff() {
@@ -118,8 +118,7 @@ bool GLSurfaceEGL::InitializeOneOff() {
LOG(ERROR) << "OZONE failed to initialize hardware";
return false;
}
Expand All @@ -23,15 +28,7 @@ index 0c1871e..9e5f7f5 100644
#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) {
@@ -432,6 +431,15 @@ bool NativeViewGLSurfaceEGL::Resize(const gfx::Size& size) {

Destroy();

Expand All @@ -47,6 +44,15 @@ index 0c1871e..9e5f7f5 100644
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

0 comments on commit 1b45b59

Please sign in to comment.