diff options
author | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-16 20:02:37 +0000 |
---|---|---|
committer | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-16 20:02:37 +0000 |
commit | 46c2d4376ba925d135b0459be354e5d068f1b29e (patch) | |
tree | 46d148c05ea9c7f21c9deeb5099e3efa35d8e523 /chrome/plugin | |
parent | 1045b5449332f18c6d7bcfe2c0b772affcc6f8e9 (diff) | |
download | chromium_src-46c2d4376ba925d135b0459be354e5d068f1b29e.zip chromium_src-46c2d4376ba925d135b0459be354e5d068f1b29e.tar.gz chromium_src-46c2d4376ba925d135b0459be354e5d068f1b29e.tar.bz2 |
Fixed problem with Pepper 3D plugins not rendering on Mac OS X if they
only expect to repaint once.
BUG=37961
TEST=OS X: ran Pepper test plugin, GLES2 book demos as trusted Pepper plugins
Review URL: http://codereview.chromium.org/1023001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41751 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin')
-rw-r--r-- | chrome/plugin/command_buffer_stub.cc | 17 | ||||
-rw-r--r-- | chrome/plugin/command_buffer_stub_win.cc | 5 |
2 files changed, 14 insertions, 8 deletions
diff --git a/chrome/plugin/command_buffer_stub.cc b/chrome/plugin/command_buffer_stub.cc index 577bcfc..7dc049c 100644 --- a/chrome/plugin/command_buffer_stub.cc +++ b/chrome/plugin/command_buffer_stub.cc @@ -60,6 +60,10 @@ bool CommandBufferStub::Send(IPC::Message* message) { return channel_->Send(message); } +void CommandBufferStub::NotifyRepaint() { + Send(new GpuCommandBufferMsg_NotifyRepaint(route_id_)); +} + void CommandBufferStub::OnInitialize(int32 size, base::SharedMemoryHandle* ring_buffer) { DCHECK(!command_buffer_.get()); @@ -115,9 +119,9 @@ void CommandBufferStub::OnInitialize(int32 size, processor_->SetSwapBuffersCallback( NewCallback(this, &CommandBufferStub::SwapBuffersCallback)); - processor_->SetTransportDIBAllocAndFree( - NewCallback(this, &CommandBufferStub::AllocTransportDIB), - NewCallback(this, &CommandBufferStub::FreeTransportDIB)); + processor_->SetTransportDIBAllocAndFree( + NewCallback(this, &CommandBufferStub::AllocTransportDIB), + NewCallback(this, &CommandBufferStub::FreeTransportDIB)); #endif } @@ -189,6 +193,7 @@ void CommandBufferStub::DestroyPlatformSpecific() { #if defined(OS_MACOSX) void CommandBufferStub::OnSetWindowSize(int32 width, int32 height) { // Try using the IOSurface version first. + bool notify_repaint = false; uint64 new_backing_store = processor_->SetWindowSizeForIOSurface(width, height); if (new_backing_store) { @@ -198,6 +203,7 @@ void CommandBufferStub::OnSetWindowSize(int32 width, int32 height) { width, height, new_backing_store)); + notify_repaint = true; } else { // If |new_backing_store| is 0, it might mean that the IOSurface APIs are // not available. In this case, see if TransportDIBs are supported. @@ -210,8 +216,13 @@ void CommandBufferStub::OnSetWindowSize(int32 width, int32 height) { width, height, transport_dib)); + notify_repaint = true; } } + if (notify_repaint) { + // Indicate to the client that at least one repaint is needed. + NotifyRepaint(); + } } void CommandBufferStub::SwapBuffersCallback() { diff --git a/chrome/plugin/command_buffer_stub_win.cc b/chrome/plugin/command_buffer_stub_win.cc index abf13b1..11369a6 100644 --- a/chrome/plugin/command_buffer_stub_win.cc +++ b/chrome/plugin/command_buffer_stub_win.cc @@ -4,7 +4,6 @@ #include <windows.h> -#include "chrome/common/gpu_messages.h" #include "chrome/plugin/command_buffer_stub.h" namespace { @@ -44,10 +43,6 @@ LRESULT WINAPI WndProc(HWND handle, } } // namespace anonymous -void CommandBufferStub::NotifyRepaint() { - Send(new GpuCommandBufferMsg_NotifyRepaint(route_id_)); -} - bool CommandBufferStub::InitializePlatformSpecific() { // Subclass window. WNDPROC previous_wnd_proc = reinterpret_cast<WNDPROC>( |