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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 public: | 47 public: |
48 // Pass true for |force_disable_reclaim_resources| to act like the Display | 48 // Pass true for |force_disable_reclaim_resources| to act like the Display |
49 // is out-of-process and can't return resources synchronously. | 49 // is out-of-process and can't return resources synchronously. |
50 TestCompositorFrameSink( | 50 TestCompositorFrameSink( |
51 scoped_refptr<ContextProvider> compositor_context_provider, | 51 scoped_refptr<ContextProvider> compositor_context_provider, |
52 scoped_refptr<ContextProvider> worker_context_provider, | 52 scoped_refptr<ContextProvider> worker_context_provider, |
53 SharedBitmapManager* shared_bitmap_manager, | 53 SharedBitmapManager* shared_bitmap_manager, |
54 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 54 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
55 const RendererSettings& renderer_settings, | 55 const RendererSettings& renderer_settings, |
56 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 56 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
57 bool synchronous_composite, | 57 bool synchronous_composite); |
58 bool force_disable_reclaim_resources); | |
59 ~TestCompositorFrameSink() override; | 58 ~TestCompositorFrameSink() override; |
60 | 59 |
61 // This client must be set before BindToClient() happens. | 60 // This client must be set before BindToClient() happens. |
62 void SetClient(TestCompositorFrameSinkClient* client) { | 61 void SetClient(TestCompositorFrameSinkClient* client) { |
63 test_client_ = client; | 62 test_client_ = client; |
64 } | 63 } |
65 void SetEnlargePassTextureAmount(const gfx::Size& s) { | 64 void SetEnlargePassTextureAmount(const gfx::Size& s) { |
66 enlarge_pass_texture_amount_ = s; | 65 enlarge_pass_texture_amount_ = s; |
67 } | 66 } |
68 | 67 |
69 Display* display() const { return display_.get(); } | 68 Display* display() const { return display_.get(); } |
70 | 69 |
71 // Will be included with the next SubmitCompositorFrame. | 70 // Will be included with the next SubmitCompositorFrame. |
72 void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> request); | 71 void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> request); |
73 | 72 |
74 // CompositorFrameSink implementation. | 73 // CompositorFrameSink implementation. |
75 bool BindToClient(CompositorFrameSinkClient* client) override; | 74 bool BindToClient(CompositorFrameSinkClient* client) override; |
76 void DetachFromClient() override; | 75 void DetachFromClient() override; |
77 void SubmitCompositorFrame(CompositorFrame frame) override; | 76 void SubmitCompositorFrame(CompositorFrame frame) override; |
78 void ForceReclaimResources() override; | |
79 | 77 |
80 // SurfaceFactoryClient implementation. | 78 // SurfaceFactoryClient implementation. |
81 void ReturnResources(const ReturnedResourceArray& resources) override; | 79 void ReturnResources(const ReturnedResourceArray& resources) override; |
82 void SetBeginFrameSource(BeginFrameSource* begin_frame_source) override; | 80 void SetBeginFrameSource(BeginFrameSource* begin_frame_source) override; |
83 | 81 |
84 // DisplayClient implementation. | 82 // DisplayClient implementation. |
85 void DisplayOutputSurfaceLost() override; | 83 void DisplayOutputSurfaceLost() override; |
86 void DisplayWillDrawAndSwap(bool will_draw_and_swap, | 84 void DisplayWillDrawAndSwap(bool will_draw_and_swap, |
87 const RenderPassList& render_passes) override; | 85 const RenderPassList& render_passes) override; |
88 void DisplayDidDrawAndSwap() override; | 86 void DisplayDidDrawAndSwap() override; |
(...skipping 26 matching lines...) Expand all Loading... |
115 gfx::Size enlarge_pass_texture_amount_; | 113 gfx::Size enlarge_pass_texture_amount_; |
116 | 114 |
117 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests_; | 115 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests_; |
118 | 116 |
119 base::WeakPtrFactory<TestCompositorFrameSink> weak_ptr_factory_; | 117 base::WeakPtrFactory<TestCompositorFrameSink> weak_ptr_factory_; |
120 }; | 118 }; |
121 | 119 |
122 } // namespace cc | 120 } // namespace cc |
123 | 121 |
124 #endif // CC_TEST_TEST_COMPOSITOR_FRAME_SINK_H_ | 122 #endif // CC_TEST_TEST_COMPOSITOR_FRAME_SINK_H_ |
OLD | NEW |