| 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 #ifndef CC_TEST_TEST_COMPOSITOR_FRAME_SINK_H_ | 5 #ifndef CC_TEST_TEST_COMPOSITOR_FRAME_SINK_H_ |
| 6 #define CC_TEST_TEST_COMPOSITOR_FRAME_SINK_H_ | 6 #define CC_TEST_TEST_COMPOSITOR_FRAME_SINK_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "cc/output/compositor_frame_sink.h" | 9 #include "cc/output/compositor_frame_sink.h" |
| 10 #include "cc/output/renderer_settings.h" | 10 #include "cc/output/renderer_settings.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 void ReturnResources(const ReturnedResourceArray& resources) override; | 71 void ReturnResources(const ReturnedResourceArray& resources) override; |
| 72 void SetBeginFrameSource(BeginFrameSource* begin_frame_source) override; | 72 void SetBeginFrameSource(BeginFrameSource* begin_frame_source) override; |
| 73 | 73 |
| 74 // DisplayClient implementation. | 74 // DisplayClient implementation. |
| 75 void DisplayOutputSurfaceLost() override; | 75 void DisplayOutputSurfaceLost() override; |
| 76 void DisplayWillDrawAndSwap(bool will_draw_and_swap, | 76 void DisplayWillDrawAndSwap(bool will_draw_and_swap, |
| 77 const RenderPassList& render_passes) override; | 77 const RenderPassList& render_passes) override; |
| 78 void DisplayDidDrawAndSwap() override; | 78 void DisplayDidDrawAndSwap() override; |
| 79 | 79 |
| 80 private: | 80 private: |
| 81 void DidDrawCallback(); | 81 void DidDrawCallback(bool synchronous); |
| 82 | 82 |
| 83 // TODO(danakj): These don't need to be stored in unique_ptrs when | 83 // TODO(danakj): These don't need to be stored in unique_ptrs when |
| 84 // CompositorFrameSink is owned/destroyed on the compositor thread. | 84 // CompositorFrameSink is owned/destroyed on the compositor thread. |
| 85 std::unique_ptr<SurfaceManager> surface_manager_; | 85 std::unique_ptr<SurfaceManager> surface_manager_; |
| 86 std::unique_ptr<SurfaceIdAllocator> surface_id_allocator_; | 86 std::unique_ptr<SurfaceIdAllocator> surface_id_allocator_; |
| 87 SurfaceId delegated_surface_id_; | 87 SurfaceId delegated_surface_id_; |
| 88 | 88 |
| 89 // Uses surface_manager_. | 89 // Uses surface_manager_. |
| 90 std::unique_ptr<SurfaceFactory> surface_factory_; | 90 std::unique_ptr<SurfaceFactory> surface_factory_; |
| 91 | 91 |
| 92 // Uses surface_manager_. | 92 // Uses surface_manager_. |
| 93 std::unique_ptr<Display> display_; | 93 std::unique_ptr<Display> display_; |
| 94 | 94 |
| 95 bool bound_ = false; | 95 bool bound_ = false; |
| 96 TestCompositorFrameSinkClient* test_client_ = nullptr; | 96 TestCompositorFrameSinkClient* test_client_ = nullptr; |
| 97 gfx::Size enlarge_pass_texture_amount_; | 97 gfx::Size enlarge_pass_texture_amount_; |
| 98 | 98 |
| 99 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests_; | 99 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests_; |
| 100 |
| 101 base::WeakPtrFactory<TestCompositorFrameSink> weak_ptrs_; |
| 100 }; | 102 }; |
| 101 | 103 |
| 102 } // namespace cc | 104 } // namespace cc |
| 103 | 105 |
| 104 #endif // CC_TEST_TEST_COMPOSITOR_FRAME_SINK_H_ | 106 #endif // CC_TEST_TEST_COMPOSITOR_FRAME_SINK_H_ |
| OLD | NEW |