Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: cc/test/test_compositor_frame_sink.cc

Issue 2669183002: Seems incorrect to se device_scale_factor in SetLocalSurfaceId.
Patch Set: Seems incorrect to set device_scale_factor in SetLocalSurfaceId. Added new function SetDeviceScaleF… Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/test/test_compositor_frame_sink.h" 5 #include "cc/test/test_compositor_frame_sink.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 test_client_ = nullptr; 123 test_client_ = nullptr;
124 CompositorFrameSink::DetachFromClient(); 124 CompositorFrameSink::DetachFromClient();
125 } 125 }
126 126
127 void TestCompositorFrameSink::SubmitCompositorFrame(CompositorFrame frame) { 127 void TestCompositorFrameSink::SubmitCompositorFrame(CompositorFrame frame) {
128 test_client_->DisplayReceivedCompositorFrame(frame); 128 test_client_->DisplayReceivedCompositorFrame(frame);
129 129
130 if (!delegated_local_surface_id_.is_valid()) { 130 if (!delegated_local_surface_id_.is_valid()) {
131 delegated_local_surface_id_ = local_surface_id_allocator_->GenerateId(); 131 delegated_local_surface_id_ = local_surface_id_allocator_->GenerateId();
132 } 132 }
133 display_->SetLocalSurfaceId(delegated_local_surface_id_, 133 display_->SetLocalSurfaceId(delegated_local_surface_id_);
134 frame.metadata.device_scale_factor); 134 display_->SetDeviceScaleFactor(frame.metadata.device_scale_factor);
135 135
136 gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size(); 136 gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size();
137 display_->Resize(frame_size); 137 display_->Resize(frame_size);
138 138
139 bool synchronous = !display_->has_scheduler(); 139 bool synchronous = !display_->has_scheduler();
140 140
141 SurfaceFactory::DrawCallback draw_callback; 141 SurfaceFactory::DrawCallback draw_callback;
142 if (!synchronous) { 142 if (!synchronous) {
143 // For async draws, we use a callback tell when it is done, but for sync 143 // For async draws, we use a callback tell when it is done, but for sync
144 // draws we don't need one. Unretained is safe here because the callback 144 // draws we don't need one. Unretained is safe here because the callback
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 bool will_draw_and_swap, 197 bool will_draw_and_swap,
198 const RenderPassList& render_passes) { 198 const RenderPassList& render_passes) {
199 test_client_->DisplayWillDrawAndSwap(will_draw_and_swap, render_passes); 199 test_client_->DisplayWillDrawAndSwap(will_draw_and_swap, render_passes);
200 } 200 }
201 201
202 void TestCompositorFrameSink::DisplayDidDrawAndSwap() { 202 void TestCompositorFrameSink::DisplayDidDrawAndSwap() {
203 test_client_->DisplayDidDrawAndSwap(); 203 test_client_->DisplayDidDrawAndSwap();
204 } 204 }
205 205
206 } // namespace cc 206 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/display_unittest.cc ('k') | components/display_compositor/gpu_root_compositor_frame_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698