| Index: content/renderer/android/synchronous_compositor_frame_sink.cc
|
| diff --git a/content/renderer/android/synchronous_compositor_frame_sink.cc b/content/renderer/android/synchronous_compositor_frame_sink.cc
|
| index be2a84041928de80e7d66ef149aa80ba0da4fddb..1da0d84f7b2b818efbe7db0d4b8c092d587da9c6 100644
|
| --- a/content/renderer/android/synchronous_compositor_frame_sink.cc
|
| +++ b/content/renderer/android/synchronous_compositor_frame_sink.cc
|
| @@ -242,14 +242,6 @@ void SynchronousCompositorFrameSink::SubmitCompositorFrame(
|
| // the |frame| for the software path below.
|
| submit_frame.metadata = frame.metadata.Clone();
|
|
|
| - if (!root_local_surface_id_.is_valid()) {
|
| - root_local_surface_id_ = local_surface_id_allocator_->GenerateId();
|
| - child_local_surface_id_ = local_surface_id_allocator_->GenerateId();
|
| - }
|
| -
|
| - display_->SetLocalSurfaceId(root_local_surface_id_,
|
| - frame.metadata.device_scale_factor);
|
| -
|
| // The layer compositor should be giving a frame that covers the
|
| // |sw_viewport_for_current_draw_| but at 0,0.
|
| gfx::Size child_size = sw_viewport_for_current_draw_.size();
|
| @@ -261,6 +253,23 @@ void SynchronousCompositorFrameSink::SubmitCompositorFrame(
|
| sw_viewport_for_current_draw_.bottom());
|
| display_->Resize(display_size);
|
|
|
| + if (!root_local_surface_id_.is_valid() || display_size_ != display_size ||
|
| + device_scale_factor_ != frame.metadata.device_scale_factor) {
|
| + root_local_surface_id_ = local_surface_id_allocator_->GenerateId();
|
| + display_size_ = display_size;
|
| + device_scale_factor_ = frame.metadata.device_scale_factor;
|
| + }
|
| +
|
| + if (!child_local_surface_id_.is_valid() || child_size_ != child_size ||
|
| + device_scale_factor_ != frame.metadata.device_scale_factor) {
|
| + child_local_surface_id_ = local_surface_id_allocator_->GenerateId();
|
| + child_size_ = child_size;
|
| + device_scale_factor_ = frame.metadata.device_scale_factor;
|
| + }
|
| +
|
| + display_->SetLocalSurfaceId(root_local_surface_id_,
|
| + frame.metadata.device_scale_factor);
|
| +
|
| // The offset for the child frame relative to the origin of the canvas being
|
| // drawn into.
|
| gfx::Transform child_transform;
|
| @@ -274,6 +283,8 @@ void SynchronousCompositorFrameSink::SubmitCompositorFrame(
|
| // hardware frames in SurfacesInstance?)
|
| cc::CompositorFrame embed_frame;
|
| embed_frame.metadata.begin_frame_ack = frame.metadata.begin_frame_ack;
|
| + embed_frame.metadata.device_scale_factor =
|
| + frame.metadata.device_scale_factor;
|
| embed_frame.render_pass_list.push_back(cc::RenderPass::Create());
|
|
|
| // The embedding RenderPass covers the entire Display's area.
|
|
|