| OLD | NEW |
| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 if (test_client_) | 121 if (test_client_) |
| 122 test_client_->DisplayReceivedCompositorFrame(frame); | 122 test_client_->DisplayReceivedCompositorFrame(frame); |
| 123 | 123 |
| 124 if (delegated_local_frame_id_.is_null()) { | 124 if (delegated_local_frame_id_.is_null()) { |
| 125 delegated_local_frame_id_ = surface_id_allocator_->GenerateId(); | 125 delegated_local_frame_id_ = surface_id_allocator_->GenerateId(); |
| 126 surface_factory_->Create(delegated_local_frame_id_); | 126 surface_factory_->Create(delegated_local_frame_id_); |
| 127 } | 127 } |
| 128 display_->SetSurfaceId(SurfaceId(frame_sink_id_, delegated_local_frame_id_), | 128 display_->SetSurfaceId(SurfaceId(frame_sink_id_, delegated_local_frame_id_), |
| 129 frame.metadata.device_scale_factor); | 129 frame.metadata.device_scale_factor); |
| 130 | 130 |
| 131 gfx::Size frame_size = | 131 gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size(); |
| 132 frame.delegated_frame_data->render_pass_list.back()->output_rect.size(); | |
| 133 display_->Resize(frame_size); | 132 display_->Resize(frame_size); |
| 134 | 133 |
| 135 bool synchronous = !display_->has_scheduler(); | 134 bool synchronous = !display_->has_scheduler(); |
| 136 | 135 |
| 137 SurfaceFactory::DrawCallback draw_callback; | 136 SurfaceFactory::DrawCallback draw_callback; |
| 138 if (!synchronous) { | 137 if (!synchronous) { |
| 139 // For async draws, we use a callback tell when it is done, but for sync | 138 // For async draws, we use a callback tell when it is done, but for sync |
| 140 // draws we don't need one. Unretained is safe here because the callback | 139 // draws we don't need one. Unretained is safe here because the callback |
| 141 // will be run when |surface_factory_| is destroyed which is owned by this | 140 // will be run when |surface_factory_| is destroyed which is owned by this |
| 142 // class. | 141 // class. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 if (test_client_) | 197 if (test_client_) |
| 199 test_client_->DisplayWillDrawAndSwap(will_draw_and_swap, render_passes); | 198 test_client_->DisplayWillDrawAndSwap(will_draw_and_swap, render_passes); |
| 200 } | 199 } |
| 201 | 200 |
| 202 void TestCompositorFrameSink::DisplayDidDrawAndSwap() { | 201 void TestCompositorFrameSink::DisplayDidDrawAndSwap() { |
| 203 if (test_client_) | 202 if (test_client_) |
| 204 test_client_->DisplayDidDrawAndSwap(); | 203 test_client_->DisplayDidDrawAndSwap(); |
| 205 } | 204 } |
| 206 | 205 |
| 207 } // namespace cc | 206 } // namespace cc |
| OLD | NEW |