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/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "cc/output/compositor_frame_sink.h" | 10 #include "cc/output/compositor_frame_sink.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 void SetClient(TestCompositorFrameSinkClient* client) { | 57 void SetClient(TestCompositorFrameSinkClient* client) { |
58 test_client_ = client; | 58 test_client_ = client; |
59 } | 59 } |
60 void SetEnlargePassTextureAmount(const gfx::Size& s) { | 60 void SetEnlargePassTextureAmount(const gfx::Size& s) { |
61 enlarge_pass_texture_amount_ = s; | 61 enlarge_pass_texture_amount_ = s; |
62 } | 62 } |
63 | 63 |
64 Display* display() const { return display_.get(); } | 64 Display* display() const { return display_.get(); } |
65 | 65 |
66 // Will be submitted with the next SwapBuffers. | 66 // Will be included with the next SubmitCompositorFrame. |
67 void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> request); | 67 void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> request); |
68 | 68 |
69 // CompositorFrameSink implementation. | 69 // CompositorFrameSink implementation. |
70 bool BindToClient(CompositorFrameSinkClient* client) override; | 70 bool BindToClient(CompositorFrameSinkClient* client) override; |
71 void DetachFromClient() override; | 71 void DetachFromClient() override; |
72 void SwapBuffers(CompositorFrame frame) override; | 72 void SubmitCompositorFrame(CompositorFrame frame) override; |
73 void ForceReclaimResources() override; | 73 void ForceReclaimResources() override; |
74 | 74 |
75 // SurfaceFactoryClient implementation. | 75 // SurfaceFactoryClient implementation. |
76 void ReturnResources(const ReturnedResourceArray& resources) override; | 76 void ReturnResources(const ReturnedResourceArray& resources) override; |
77 void SetBeginFrameSource(BeginFrameSource* begin_frame_source) override; | 77 void SetBeginFrameSource(BeginFrameSource* begin_frame_source) override; |
78 | 78 |
79 // DisplayClient implementation. | 79 // DisplayClient implementation. |
80 void DisplayOutputSurfaceLost() override; | 80 void DisplayOutputSurfaceLost() override; |
81 void DisplayWillDrawAndSwap(bool will_draw_and_swap, | 81 void DisplayWillDrawAndSwap(bool will_draw_and_swap, |
82 const RenderPassList& render_passes) override; | 82 const RenderPassList& render_passes) override; |
(...skipping 24 matching lines...) Expand all Loading... |
107 gfx::Size enlarge_pass_texture_amount_; | 107 gfx::Size enlarge_pass_texture_amount_; |
108 | 108 |
109 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests_; | 109 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests_; |
110 | 110 |
111 base::WeakPtrFactory<TestCompositorFrameSink> weak_ptr_factory_; | 111 base::WeakPtrFactory<TestCompositorFrameSink> weak_ptr_factory_; |
112 }; | 112 }; |
113 | 113 |
114 } // namespace cc | 114 } // namespace cc |
115 | 115 |
116 #endif // CC_TEST_TEST_COMPOSITOR_FRAME_SINK_H_ | 116 #endif // CC_TEST_TEST_COMPOSITOR_FRAME_SINK_H_ |
OLD | NEW |