Index: content/browser/android/in_process/synchronous_compositor_output_surface.cc |
diff --git a/content/browser/android/in_process/synchronous_compositor_output_surface.cc b/content/browser/android/in_process/synchronous_compositor_output_surface.cc |
index 04abdc0c69de4d742c0629fadc43f96c102aa0be..97470b81038668d263e33f3a87af490baa471f63 100644 |
--- a/content/browser/android/in_process/synchronous_compositor_output_surface.cc |
+++ b/content/browser/android/in_process/synchronous_compositor_output_surface.cc |
@@ -13,6 +13,7 @@ |
#include "cc/output/software_output_device.h" |
#include "content/browser/android/in_process/synchronous_compositor_impl.h" |
#include "content/public/browser/browser_thread.h" |
+#include "content/renderer/gpu/frame_swap_message_queue.h" |
#include "gpu/command_buffer/client/gles2_interface.h" |
#include "gpu/command_buffer/common/gpu_memory_allocation.h" |
#include "third_party/skia/include/core/SkCanvas.h" |
@@ -66,7 +67,8 @@ class SynchronousCompositorOutputSurface::SoftwareDevice |
}; |
SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface( |
- int routing_id) |
+ int routing_id, |
+ scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue) |
: cc::OutputSurface( |
scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareDevice(this))), |
routing_id_(routing_id), |
@@ -76,6 +78,7 @@ SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface( |
current_sw_canvas_(NULL), |
memory_policy_(0), |
output_surface_client_(NULL), |
+ frame_swap_message_queue_(frame_swap_message_queue), |
weak_ptr_factory_(this) { |
capabilities_.deferred_gl_initialization = true; |
capabilities_.draw_and_swap_full_viewport_every_frame = true; |
@@ -144,6 +147,15 @@ void SynchronousCompositorOutputSurface::SwapBuffers( |
did_swap_buffer_ = true; |
client_->DidSwapBuffers(); |
+ |
+ // We don't care about the SendMessageScope since we're already on the UI |
boliu
2014/05/23 06:27:00
This might not be UI in webview until we turn on u
mkosiba (inactive)
2014/05/23 15:50:38
What?! Then the DCHECK(CalledOnValidThread()); on
|
+ // thread. |
+ std::vector<IPC::Message> messages_to_deliver_with_frame; |
+ frame_swap_message_queue_->DrainMessages(client_->GetSourceFrameNumber(), |
boliu
2014/05/23 06:27:00
Should the SourceFrameNumber be part of Compositor
mkosiba (inactive)
2014/05/23 15:50:38
Don't need it at all now.
|
+ &messages_to_deliver_with_frame); |
+ SynchronousCompositorOutputSurfaceDelegate* delegate = GetDelegate(); |
+ if (delegate) |
+ delegate->DeliverMessages(messages_to_deliver_with_frame); |
} |
void SynchronousCompositorOutputSurface::UpdateFrameMetaData( |