summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-14 18:39:40 +0000
committerkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-14 18:39:40 +0000
commit7d9ce4f8730d81751cbbfd057481d2de9ef111b5 (patch)
treefe4736374da78cef664dfe575b61e57c3cd327b2 /webkit
parent4cff2151771dc748f2e0e24d82f72efc6ddf3809 (diff)
downloadchromium_src-7d9ce4f8730d81751cbbfd057481d2de9ef111b5.zip
chromium_src-7d9ce4f8730d81751cbbfd057481d2de9ef111b5.tar.gz
chromium_src-7d9ce4f8730d81751cbbfd057481d2de9ef111b5.tar.bz2
Fixed loss of rendered output on Mac OS X if Pepper 3D application uses
framebuffer objects. Conditionalized allocation of FBO in AcceleratedSurface class, and changed SwapBuffers to optionally copy from the current context's back buffer. Changed GPUProcessor on Mac to always use PbufferGLContext, and hooked in optional call to AcceleratedSurface's SwapBufers before calling user's callback. Completely disabled ViewGLContext on Mac OS X. This causes Pepper 3D applications to use the GGL default back buffer on Mac, which is the desired behavior. Ideally the FBO allocation would be factored out of the AcceleratedSurface class, and ideally the pbuffer setup code would not be duplicated between this class and PbufferGLContext. However, these cleanups are being deferred because they require substantial refactorings. Removed accelerated_surface_stub.cc, which isn't needed any more since AcceleratedSurface moved to app/. Tested: - Pepper 3D plugin with glBindFramebuffer(GL_FRAMEBUFFER, 0) in place with both IOSurface and TransportDIB code paths - Unity 3D with IOSurface / Core Animation code path BUG=41004 TEST=none (ran above tests) Review URL: http://codereview.chromium.org/1637007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44507 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/plugins/webplugin_delegate_impl_mac.mm2
-rw-r--r--webkit/tools/test_shell/mac/accelerated_surface_stub.cc50
-rw-r--r--webkit/tools/test_shell/test_shell.gypi1
3 files changed, 1 insertions, 52 deletions
diff --git a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm
index 77aae29..7f33a52 100644
--- a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm
+++ b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm
@@ -296,7 +296,7 @@ bool WebPluginDelegateImpl::PlatformInitialize() {
layer_ = layer;
plugin_->BindFakePluginWindowHandle();
surface_ = new AcceleratedSurface;
- surface_->Initialize();
+ surface_->Initialize(NULL, true);
renderer_ = [[CARenderer rendererWithCGLContext:surface_->context()
options:NULL] retain];
[renderer_ setLayer:layer_];
diff --git a/webkit/tools/test_shell/mac/accelerated_surface_stub.cc b/webkit/tools/test_shell/mac/accelerated_surface_stub.cc
deleted file mode 100644
index a4ca5de..0000000
--- a/webkit/tools/test_shell/mac/accelerated_surface_stub.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This file is a complete and total hack intended to stub out some classes
-// used by WebPluginDelegateImpl on Mac. Unfortunately, they live in
-// chrome/common, so we can't compile them into TestShell. Instead, provide
-// some stubs. It will need to be updated if new methods are added to
-// AcceleratedSurface that get called from WebPluginDelegateImpl. It's not
-// like plug-ins work in TestShell anyway.
-
-#include <CoreFoundation/CoreFoundation.h>
-#include <OpenGL/OpenGL.h>
-
-#include "base/basictypes.h"
-#include "base/scoped_ptr.h"
-#include "gfx/rect.h"
-#include "gfx/size.h"
-
-class TransportDIB {
- public:
- TransportDIB() { }
- ~TransportDIB() { }
-};
-
-class AcceleratedSurface {
- public:
- AcceleratedSurface();
- virtual ~AcceleratedSurface();
-
- bool Initialize();
- void Destroy();
- uint64 SetSurfaceSize(const gfx::Size& size);
- bool MakeCurrent();
- void Clear(const gfx::Rect& rect);
- void SwapBuffers();
- CGLContextObj context() { return NULL; }
- private:
- scoped_ptr<TransportDIB> ignore_;
-};
-
-AcceleratedSurface::AcceleratedSurface() { }
-AcceleratedSurface::~AcceleratedSurface() { }
-bool AcceleratedSurface::Initialize() { return false; }
-void AcceleratedSurface::Destroy() { }
-uint64 AcceleratedSurface::SetSurfaceSize(const gfx::Size& size)
- { return 0; }
-bool AcceleratedSurface::MakeCurrent() { return false; }
-void AcceleratedSurface::Clear(const gfx::Rect& rect) { }
-void AcceleratedSurface::SwapBuffers() { }
diff --git a/webkit/tools/test_shell/test_shell.gypi b/webkit/tools/test_shell/test_shell.gypi
index 84c085f..79a8242 100644
--- a/webkit/tools/test_shell/test_shell.gypi
+++ b/webkit/tools/test_shell/test_shell.gypi
@@ -47,7 +47,6 @@
],
'msvs_guid': '77C32787-1B96-CB84-B905-7F170629F0AC',
'sources': [
- 'mac/accelerated_surface_stub.cc',
'mac/DumpRenderTreePasteboard.h',
'mac/DumpRenderTreePasteboard.m',
'mac/test_shell_webview.h',