Index: cc/test/test_compositor_frame_sink.cc |
diff --git a/cc/test/test_compositor_frame_sink.cc b/cc/test/test_compositor_frame_sink.cc |
index f9d4f46e6c491ef7a7f0396ca6659e97c681a565..92fe9fc2b8ee2e5dcd38cecea95f98c1627a700d 100644 |
--- a/cc/test/test_compositor_frame_sink.cc |
+++ b/cc/test/test_compositor_frame_sink.cc |
@@ -129,17 +129,18 @@ void TestCompositorFrameSink::SetLocalSurfaceId( |
void TestCompositorFrameSink::SubmitCompositorFrame(CompositorFrame frame) { |
test_client_->DisplayReceivedCompositorFrame(frame); |
- if (!delegated_local_surface_id_.is_valid()) { |
- delegated_local_surface_id_ = local_surface_id_allocator_->GenerateId(); |
- } |
- display_->SetLocalSurfaceId(delegated_local_surface_id_, |
- frame.metadata.device_scale_factor); |
- |
gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size(); |
- display_->Resize(frame_size); |
+ float device_scale_factor = frame.metadata.device_scale_factor; |
+ if (!local_surface_id_.is_valid() || frame_size != display_size_ || |
+ device_scale_factor != device_scale_factor_) { |
+ local_surface_id_ = local_surface_id_allocator_->GenerateId(); |
+ display_->SetLocalSurfaceId(local_surface_id_, device_scale_factor); |
+ display_->Resize(frame_size); |
+ display_size_ = frame_size; |
+ device_scale_factor_ = device_scale_factor; |
+ } |
- support_->SubmitCompositorFrame(delegated_local_surface_id_, |
- std::move(frame)); |
+ DCHECK(support_->SubmitCompositorFrame(local_surface_id_, std::move(frame))); |
danakj
2017/05/19 19:00:59
here's another
|
for (std::unique_ptr<CopyOutputRequest>& copy_request : copy_requests_) { |
support_->RequestCopyOfSurface(std::move(copy_request)); |