| Index: content/renderer/android/synchronous_compositor_output_surface.cc
|
| diff --git a/content/renderer/android/synchronous_compositor_output_surface.cc b/content/renderer/android/synchronous_compositor_output_surface.cc
|
| index 5feb429d0ec532a27456a0b49686ab56912ac7a3..e2371bfcfd6f8e2bd95e93880285f10fb401e68f 100644
|
| --- a/content/renderer/android/synchronous_compositor_output_surface.cc
|
| +++ b/content/renderer/android/synchronous_compositor_output_surface.cc
|
| @@ -13,13 +13,16 @@
|
| #include "cc/output/software_output_device.h"
|
| #include "content/common/android/sync_compositor_messages.h"
|
| #include "content/renderer/android/synchronous_compositor_external_begin_frame_source.h"
|
| +#include "content/renderer/android/synchronous_compositor_filter.h"
|
| #include "content/renderer/android/synchronous_compositor_registry.h"
|
| #include "content/renderer/gpu/frame_swap_message_queue.h"
|
| +#include "content/renderer/render_thread_impl.h"
|
| #include "gpu/command_buffer/client/context_support.h"
|
| #include "gpu/command_buffer/client/gles2_interface.h"
|
| #include "gpu/command_buffer/common/gpu_memory_allocation.h"
|
| #include "ipc/ipc_message.h"
|
| #include "ipc/ipc_message_macros.h"
|
| +#include "ipc/ipc_sender.h"
|
| #include "third_party/skia/include/core/SkCanvas.h"
|
| #include "ui/gfx/geometry/rect_conversions.h"
|
| #include "ui/gfx/skia_util.h"
|
| @@ -78,6 +81,7 @@ SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface(
|
| routing_id_(routing_id),
|
| output_surface_id_(output_surface_id),
|
| registry_(registry),
|
| + sender_(RenderThreadImpl::current()->sync_compositor_message_filter()),
|
| registered_(false),
|
| sync_client_(nullptr),
|
| current_sw_canvas_(nullptr),
|
| @@ -86,8 +90,9 @@ SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface(
|
| frame_swap_message_queue_(frame_swap_message_queue),
|
| fallback_tick_pending_(false),
|
| fallback_tick_running_(false) {
|
| - thread_checker_.DetachFromThread();
|
| DCHECK(registry_);
|
| + DCHECK(sender_);
|
| + thread_checker_.DetachFromThread();
|
| capabilities_.adjust_deadline_for_parent = false;
|
| capabilities_.delegated_rendering = true;
|
| memory_policy_.priority_cutoff_when_visible =
|
| @@ -106,6 +111,7 @@ bool SynchronousCompositorOutputSurface::OnMessageReceived(
|
| const IPC::Message& message) {
|
| bool handled = true;
|
| IPC_BEGIN_MESSAGE_MAP(SynchronousCompositorOutputSurface, message)
|
| + IPC_MESSAGE_HANDLER(SyncCompositorMsg_SetMemoryPolicy, SetMemoryPolicy)
|
| IPC_MESSAGE_HANDLER(SyncCompositorMsg_ReclaimResources, OnReclaimResources)
|
| IPC_MESSAGE_UNHANDLED(handled = false)
|
| IPC_END_MESSAGE_MAP()
|
| @@ -121,6 +127,8 @@ bool SynchronousCompositorOutputSurface::BindToClient(
|
| client_->SetMemoryPolicy(memory_policy_);
|
| registry_->RegisterOutputSurface(routing_id_, this);
|
| registered_ = true;
|
| + Send(new SyncCompositorHostMsg_OutputSurfaceCreated(routing_id_,
|
| + output_surface_id_));
|
| return true;
|
| }
|
|
|
| @@ -283,6 +291,11 @@ void SynchronousCompositorOutputSurface::GetMessagesToDeliver(
|
| frame_swap_message_queue_->DrainMessages(messages);
|
| }
|
|
|
| +bool SynchronousCompositorOutputSurface::Send(IPC::Message* message) {
|
| + DCHECK(CalledOnValidThread());
|
| + return sender_->Send(message);
|
| +}
|
| +
|
| bool SynchronousCompositorOutputSurface::CalledOnValidThread() const {
|
| return thread_checker_.CalledOnValidThread();
|
| }
|
|
|