diff options
author | kbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-21 19:42:55 +0000 |
---|---|---|
committer | kbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-21 19:42:55 +0000 |
commit | 51e6f6a7583a25530c3c6f4398c80a280754f7d6 (patch) | |
tree | 71af61bc1ec78becadfcecab5e0c4be9a93efe80 /content/common | |
parent | 283651f7f0496cb941abe71793caefd5af38883f (diff) | |
download | chromium_src-51e6f6a7583a25530c3c6f4398c80a280754f7d6.zip chromium_src-51e6f6a7583a25530c3c6f4398c80a280754f7d6.tar.gz chromium_src-51e6f6a7583a25530c3c6f4398c80a280754f7d6.tar.bz2 |
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
Diffstat (limited to 'content/common')
-rw-r--r-- | content/common/gpu/image_transport_surface_mac.cc | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/content/common/gpu/image_transport_surface_mac.cc b/content/common/gpu/image_transport_surface_mac.cc index 21ca564..5bcadc4 100644 --- a/content/common/gpu/image_transport_surface_mac.cc +++ b/content/common/gpu/image_transport_surface_mac.cc @@ -18,9 +18,9 @@ namespace { -// We are backed by an Pbuffer offscreen surface for the purposes of creating a -// context, but use FBOs to render to texture backed IOSurface -class IOSurfaceImageTransportSurface : public gfx::PbufferGLSurfaceCGL, +// We are backed by an offscreen surface for the purposes of creating +// a context, but use FBOs to render to texture backed IOSurface +class IOSurfaceImageTransportSurface : public gfx::NoOpGLSurfaceCGL, public ImageTransportSurface { public: IOSurfaceImageTransportSurface(GpuChannelManager* manager, @@ -73,9 +73,9 @@ class IOSurfaceImageTransportSurface : public gfx::PbufferGLSurfaceCGL, DISALLOW_COPY_AND_ASSIGN(IOSurfaceImageTransportSurface); }; -// We are backed by an Pbuffer offscreen surface for the purposes of creating a -// context, but use FBOs to render offscreen. -class TransportDIBImageTransportSurface : public gfx::PbufferGLSurfaceCGL, +// We are backed by an offscreen surface for the purposes of creating +// a context, but use FBOs to render to texture backed IOSurface +class TransportDIBImageTransportSurface : public gfx::NoOpGLSurfaceCGL, public ImageTransportSurface { public: TransportDIBImageTransportSurface(GpuChannelManager* manager, @@ -147,7 +147,7 @@ IOSurfaceImageTransportSurface::IOSurfaceImageTransportSurface( int32 renderer_id, int32 command_buffer_id, gfx::PluginWindowHandle handle) - : gfx::PbufferGLSurfaceCGL(gfx::Size(1, 1)), + : gfx::NoOpGLSurfaceCGL(gfx::Size(1, 1)), fbo_id_(0), texture_id_(0), io_surface_id_(0), @@ -170,12 +170,13 @@ bool IOSurfaceImageTransportSurface::Initialize() { // Only support IOSurfaces if the GL implementation is the native desktop GL. // IO surfaces will not work with, for example, OSMesa software renderer // GL contexts. - if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGL) + if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGL && + gfx::GetGLImplementation() != gfx::kGLImplementationAppleGL) return false; if (!helper_->Initialize()) return false; - return PbufferGLSurfaceCGL::Initialize(); + return NoOpGLSurfaceCGL::Initialize(); } void IOSurfaceImageTransportSurface::Destroy() { @@ -190,7 +191,7 @@ void IOSurfaceImageTransportSurface::Destroy() { } helper_->Destroy(); - PbufferGLSurfaceCGL::Destroy(); + NoOpGLSurfaceCGL::Destroy(); } bool IOSurfaceImageTransportSurface::IsOffscreen() { @@ -374,7 +375,7 @@ TransportDIBImageTransportSurface::TransportDIBImageTransportSurface( int32 renderer_id, int32 command_buffer_id, gfx::PluginWindowHandle handle) - : gfx::PbufferGLSurfaceCGL(gfx::Size(1, 1)), + : gfx::NoOpGLSurfaceCGL(gfx::Size(1, 1)), fbo_id_(0), render_buffer_id_(0), made_current_(false) { @@ -394,7 +395,7 @@ TransportDIBImageTransportSurface::~TransportDIBImageTransportSurface() { bool TransportDIBImageTransportSurface::Initialize() { if (!helper_->Initialize()) return false; - return PbufferGLSurfaceCGL::Initialize(); + return NoOpGLSurfaceCGL::Initialize(); } void TransportDIBImageTransportSurface::Destroy() { @@ -409,7 +410,7 @@ void TransportDIBImageTransportSurface::Destroy() { } helper_->Destroy(); - PbufferGLSurfaceCGL::Destroy(); + NoOpGLSurfaceCGL::Destroy(); } bool TransportDIBImageTransportSurface::IsOffscreen() { @@ -590,6 +591,7 @@ scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface( switch (gfx::GetGLImplementation()) { case gfx::kGLImplementationDesktopGL: + case gfx::kGLImplementationAppleGL: if (!io_surface_support) { surface = new TransportDIBImageTransportSurface(manager, render_view_id, |