| 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 172f639261b1830894063b59770200b2d3ed90fa..48c2bf1e7720576df20fcc126a9b96e6dc5bf490 100644
|
| --- a/content/browser/android/in_process/synchronous_compositor_output_surface.cc
|
| +++ b/content/browser/android/in_process/synchronous_compositor_output_surface.cc
|
| @@ -71,7 +71,9 @@
|
| registered_(false),
|
| current_sw_canvas_(nullptr),
|
| memory_policy_(0),
|
| - frame_swap_message_queue_(frame_swap_message_queue) {
|
| + output_surface_client_(nullptr),
|
| + frame_swap_message_queue_(frame_swap_message_queue),
|
| + begin_frame_source_(nullptr) {
|
| capabilities_.deferred_gl_initialization = true;
|
| capabilities_.draw_and_swap_full_viewport_every_frame = true;
|
| capabilities_.adjust_deadline_for_parent = false;
|
| @@ -87,6 +89,7 @@
|
| SynchronousCompositorRegistry::GetInstance()->UnregisterOutputSurface(
|
| routing_id_, this);
|
| }
|
| + DCHECK(!begin_frame_source_);
|
| }
|
|
|
| bool SynchronousCompositorOutputSurface::BindToClient(
|
| @@ -95,7 +98,8 @@
|
| if (!cc::OutputSurface::BindToClient(surface_client))
|
| return false;
|
|
|
| - client_->SetMemoryPolicy(memory_policy_);
|
| + output_surface_client_ = surface_client;
|
| + output_surface_client_->SetMemoryPolicy(memory_policy_);
|
|
|
| SynchronousCompositorRegistry::GetInstance()->RegisterOutputSurface(
|
| routing_id_, this);
|
| @@ -104,12 +108,6 @@
|
| return true;
|
| }
|
|
|
| -void SynchronousCompositorOutputSurface::SetCompositor(
|
| - SynchronousCompositorImpl* compositor) {
|
| - DCHECK(CalledOnValidThread());
|
| - compositor_ = compositor;
|
| -}
|
| -
|
| void SynchronousCompositorOutputSurface::Reshape(
|
| const gfx::Size& size, float scale_factor) {
|
| // Intentional no-op: surface size is controlled by the embedder.
|
| @@ -125,9 +123,9 @@
|
| client_->DidSwapBuffers();
|
| }
|
|
|
| -void SynchronousCompositorOutputSurface::Invalidate() {
|
| - DCHECK(CalledOnValidThread());
|
| - compositor_->PostInvalidate();
|
| +void SynchronousCompositorOutputSurface::SetBeginFrameSource(
|
| + SynchronousCompositorExternalBeginFrameSource* begin_frame_source) {
|
| + begin_frame_source_ = begin_frame_source;
|
| }
|
|
|
| namespace {
|
| @@ -181,7 +179,6 @@
|
| DCHECK(CalledOnValidThread());
|
| DCHECK(canvas);
|
| DCHECK(!current_sw_canvas_);
|
| -
|
| base::AutoReset<SkCanvas*> canvas_resetter(¤t_sw_canvas_, canvas);
|
|
|
| SkIRect canvas_clip;
|
| @@ -215,6 +212,7 @@
|
| gfx::Transform transform_for_tile_priority,
|
| bool hardware_draw) {
|
| DCHECK(!frame_holder_.get());
|
| + DCHECK(begin_frame_source_);
|
|
|
| gfx::Transform adjusted_transform = transform;
|
| AdjustTransform(&adjusted_transform, viewport);
|
| @@ -226,7 +224,7 @@
|
| !hardware_draw);
|
| SetNeedsRedrawRect(gfx::Rect(viewport.size()));
|
|
|
| - client_->OnDraw();
|
| + begin_frame_source_->BeginFrame();
|
|
|
| // After software draws (which might move the viewport arbitrarily), restore
|
| // the previous hardware viewport to allow CC's tile manager to prioritize
|
| @@ -262,8 +260,8 @@
|
| memory_policy_.bytes_limit_when_visible = bytes_limit;
|
| memory_policy_.num_resources_limit = kNumResourcesLimit;
|
|
|
| - if (client_)
|
| - client_->SetMemoryPolicy(memory_policy_);
|
| + if (output_surface_client_)
|
| + output_surface_client_->SetMemoryPolicy(memory_policy_);
|
| }
|
|
|
| void SynchronousCompositorOutputSurface::SetTreeActivationCallback(
|
|
|