| 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_delegating_output_surface.h" | 5 #include "cc/test/test_delegating_output_surface.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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 surface_factory_->SubmitCompositorFrame( | 86 surface_factory_->SubmitCompositorFrame( |
| 87 delegated_surface_id_, std::move(frame), | 87 delegated_surface_id_, std::move(frame), |
| 88 base::Bind(&TestDelegatingOutputSurface::DrawCallback, | 88 base::Bind(&TestDelegatingOutputSurface::DrawCallback, |
| 89 weak_ptrs_.GetWeakPtr())); | 89 weak_ptrs_.GetWeakPtr())); |
| 90 | 90 |
| 91 if (!display_->has_scheduler()) | 91 if (!display_->has_scheduler()) |
| 92 display_->DrawAndSwap(); | 92 display_->DrawAndSwap(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void TestDelegatingOutputSurface::DrawCallback(SurfaceDrawStatus) { | 95 void TestDelegatingOutputSurface::DrawCallback() { |
| 96 client_->DidSwapBuffersComplete(); | 96 client_->DidSwapBuffersComplete(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void TestDelegatingOutputSurface::ForceReclaimResources() { | 99 void TestDelegatingOutputSurface::ForceReclaimResources() { |
| 100 if (capabilities_.can_force_reclaim_resources && | 100 if (capabilities_.can_force_reclaim_resources && |
| 101 !delegated_surface_id_.is_null()) { | 101 !delegated_surface_id_.is_null()) { |
| 102 surface_factory_->SubmitCompositorFrame(delegated_surface_id_, | 102 surface_factory_->SubmitCompositorFrame(delegated_surface_id_, |
| 103 CompositorFrame(), | 103 CompositorFrame(), |
| 104 SurfaceFactory::DrawCallback()); | 104 SurfaceFactory::DrawCallback()); |
| 105 } | 105 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 120 const ReturnedResourceArray& resources) { | 120 const ReturnedResourceArray& resources) { |
| 121 client_->ReclaimResources(resources); | 121 client_->ReclaimResources(resources); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void TestDelegatingOutputSurface::SetBeginFrameSource( | 124 void TestDelegatingOutputSurface::SetBeginFrameSource( |
| 125 BeginFrameSource* begin_frame_source) { | 125 BeginFrameSource* begin_frame_source) { |
| 126 client_->SetBeginFrameSource(begin_frame_source); | 126 client_->SetBeginFrameSource(begin_frame_source); |
| 127 } | 127 } |
| 128 | 128 |
| 129 } // namespace cc | 129 } // namespace cc |
| OLD | NEW |