summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/plugin/command_buffer_stub.cc17
-rw-r--r--chrome/plugin/command_buffer_stub_win.cc5
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>(