From 51e6f6a7583a25530c3c6f4398c80a280754f7d6 Mon Sep 17 00:00:00 2001 From: "kbr@chromium.org" Date: Wed, 21 Dec 2011 19:42:55 +0000 Subject: Fixed crashes when running on top of Apple's software OpenGL renderer. This configuration is seen on the reliability bots, which always use the software GL renderer because they are headless. These fixes also make --use-gl=apple work with Chrome's on-screen rendering path. - Renamed the pbuffer GLSurface class to NoOpGLSurfaceCGL and removed its unnecessary pbuffer allocation, as well as the requirement that the context be pbuffer capable. - Removed the accelerated requirement from the context in accelerated_plugin_view_mac.mm. The system automatically prefers accelerated contexts where possible. - Supported --use-gl=apple in accelerated_surface_mac.cc and image_transport_surface_mac.cc. - Removed the depth and stencil renderbuffers from accelerated_surface_mac.cc. The only consequence of this change is that when a Core Animation plugin's layer is rendered via our CARenderer, the destination surface will not have a depth buffer. Firefox already has this behavior, and, as expected, this change does not affect the correctness of any test case. There is still a remaining problem on the reliability bots where composited content does not redraw often enough, but this seems to be an orthogonal problem and is not reproducible when running Chrome locally with --use-gl=apple. Ran previously crashing content on reliability bot to verify fix. Also tested manually on 10.6.8, both with and without --use-gl=apple, with: - http://unity3d.com/gallery/demos/live-demos (Unity 3D) - http://www.nissan-stagejuk3d.com/ (Stage 3D in Flash 11, live resizing; web site is flaky, sometimes fails to start) - http://www.vimeo.com/ BUG=106891 TEST=manual testing with above test cases Review URL: http://codereview.chromium.org/9006045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115372 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/gfx/gl/gl_surface_cgl.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'ui/gfx/gl/gl_surface_cgl.h') diff --git a/ui/gfx/gl/gl_surface_cgl.h b/ui/gfx/gl/gl_surface_cgl.h index 6924c69..4e31c40 100644 --- a/ui/gfx/gl/gl_surface_cgl.h +++ b/ui/gfx/gl/gl_surface_cgl.h @@ -23,11 +23,14 @@ class GLSurfaceCGL : public GLSurface { DISALLOW_COPY_AND_ASSIGN(GLSurfaceCGL); }; -// A surface used to render to an offscreen pbuffer. -class PbufferGLSurfaceCGL : public GLSurfaceCGL { +// A "no-op" surface. It is not required that a CGLContextObj have an +// associated drawable (pbuffer or fullscreen context) in order to be +// made current. Everywhere this surface type is used, we allocate an +// FBO at the user level as the drawable of the associated context. +class NoOpGLSurfaceCGL : public GLSurfaceCGL { public: - explicit PbufferGLSurfaceCGL(const gfx::Size& size); - virtual ~PbufferGLSurfaceCGL(); + explicit NoOpGLSurfaceCGL(const gfx::Size& size); + virtual ~NoOpGLSurfaceCGL(); // Implement GLSurface. virtual bool Initialize() OVERRIDE; @@ -39,9 +42,8 @@ class PbufferGLSurfaceCGL : public GLSurfaceCGL { private: gfx::Size size_; - void* pbuffer_; - DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceCGL); + DISALLOW_COPY_AND_ASSIGN(NoOpGLSurfaceCGL); }; } // namespace gfx -- cgit v1.1