| 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/pixel_test_delegating_output_surface.h" | 5 #include "cc/test/pixel_test_delegating_output_surface.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 display_ = nullptr; | 116 display_ = nullptr; |
| 117 surface_factory_ = nullptr; | 117 surface_factory_ = nullptr; |
| 118 surface_id_allocator_ = nullptr; | 118 surface_id_allocator_ = nullptr; |
| 119 surface_manager_ = nullptr; | 119 surface_manager_ = nullptr; |
| 120 weak_ptrs_.InvalidateWeakPtrs(); | 120 weak_ptrs_.InvalidateWeakPtrs(); |
| 121 OutputSurface::DetachFromClient(); | 121 OutputSurface::DetachFromClient(); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void PixelTestDelegatingOutputSurface::SwapBuffers(CompositorFrame frame) { | 124 void PixelTestDelegatingOutputSurface::SwapBuffers(CompositorFrame frame) { |
| 125 client_->DidSwapBuffers(); | |
| 126 | |
| 127 if (delegated_surface_id_.is_null()) { | 125 if (delegated_surface_id_.is_null()) { |
| 128 delegated_surface_id_ = surface_id_allocator_->GenerateId(); | 126 delegated_surface_id_ = surface_id_allocator_->GenerateId(); |
| 129 surface_factory_->Create(delegated_surface_id_); | 127 surface_factory_->Create(delegated_surface_id_); |
| 130 } | 128 } |
| 131 display_->SetSurfaceId(delegated_surface_id_, | 129 display_->SetSurfaceId(delegated_surface_id_, |
| 132 frame.metadata.device_scale_factor); | 130 frame.metadata.device_scale_factor); |
| 133 | 131 |
| 134 gfx::Size frame_size = | 132 gfx::Size frame_size = |
| 135 frame.delegated_frame_data->render_pass_list.back()->output_rect.size(); | 133 frame.delegated_frame_data->render_pass_list.back()->output_rect.size(); |
| 136 display_->Resize(frame_size); | 134 display_->Resize(frame_size); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 ack.resources = resources; | 177 ack.resources = resources; |
| 180 client_->ReclaimResources(&ack); | 178 client_->ReclaimResources(&ack); |
| 181 } | 179 } |
| 182 | 180 |
| 183 void PixelTestDelegatingOutputSurface::SetBeginFrameSource( | 181 void PixelTestDelegatingOutputSurface::SetBeginFrameSource( |
| 184 BeginFrameSource* begin_frame_source) { | 182 BeginFrameSource* begin_frame_source) { |
| 185 client_->SetBeginFrameSource(begin_frame_source); | 183 client_->SetBeginFrameSource(begin_frame_source); |
| 186 } | 184 } |
| 187 | 185 |
| 188 } // namespace cc | 186 } // namespace cc |
| OLD | NEW |