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

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

Issue 2503203002: Revert "Getting rid of DelegatedFrameData" (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « cc/test/surface_hittest_test_helpers.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "cc/output/begin_frame_args.h" 10 #include "cc/output/begin_frame_args.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 void TestCompositorFrameSink::SubmitCompositorFrame(CompositorFrame frame) { 128 void TestCompositorFrameSink::SubmitCompositorFrame(CompositorFrame frame) {
129 test_client_->DisplayReceivedCompositorFrame(frame); 129 test_client_->DisplayReceivedCompositorFrame(frame);
130 130
131 if (!delegated_local_frame_id_.is_valid()) { 131 if (!delegated_local_frame_id_.is_valid()) {
132 delegated_local_frame_id_ = surface_id_allocator_->GenerateId(); 132 delegated_local_frame_id_ = surface_id_allocator_->GenerateId();
133 surface_factory_->Create(delegated_local_frame_id_); 133 surface_factory_->Create(delegated_local_frame_id_);
134 } 134 }
135 display_->SetLocalFrameId(delegated_local_frame_id_, 135 display_->SetLocalFrameId(delegated_local_frame_id_,
136 frame.metadata.device_scale_factor); 136 frame.metadata.device_scale_factor);
137 137
138 gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size(); 138 gfx::Size frame_size =
139 frame.delegated_frame_data->render_pass_list.back()->output_rect.size();
139 display_->Resize(frame_size); 140 display_->Resize(frame_size);
140 141
141 bool synchronous = !display_->has_scheduler(); 142 bool synchronous = !display_->has_scheduler();
142 143
143 SurfaceFactory::DrawCallback draw_callback; 144 SurfaceFactory::DrawCallback draw_callback;
144 if (!synchronous) { 145 if (!synchronous) {
145 // For async draws, we use a callback tell when it is done, but for sync 146 // For async draws, we use a callback tell when it is done, but for sync
146 // draws we don't need one. Unretained is safe here because the callback 147 // draws we don't need one. Unretained is safe here because the callback
147 // will be run when |surface_factory_| is destroyed which is owned by this 148 // will be run when |surface_factory_| is destroyed which is owned by this
148 // class. 149 // class.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 bool will_draw_and_swap, 203 bool will_draw_and_swap,
203 const RenderPassList& render_passes) { 204 const RenderPassList& render_passes) {
204 test_client_->DisplayWillDrawAndSwap(will_draw_and_swap, render_passes); 205 test_client_->DisplayWillDrawAndSwap(will_draw_and_swap, render_passes);
205 } 206 }
206 207
207 void TestCompositorFrameSink::DisplayDidDrawAndSwap() { 208 void TestCompositorFrameSink::DisplayDidDrawAndSwap() {
208 test_client_->DisplayDidDrawAndSwap(); 209 test_client_->DisplayDidDrawAndSwap();
209 } 210 }
210 211
211 } // namespace cc 212 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/surface_hittest_test_helpers.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698