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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 public: | 50 public: |
51 // Pass true for |force_disable_reclaim_resources| to act like the Display | 51 // Pass true for |force_disable_reclaim_resources| to act like the Display |
52 // is out-of-process and can't return resources synchronously. | 52 // is out-of-process and can't return resources synchronously. |
53 TestCompositorFrameSink( | 53 TestCompositorFrameSink( |
54 scoped_refptr<ContextProvider> compositor_context_provider, | 54 scoped_refptr<ContextProvider> compositor_context_provider, |
55 scoped_refptr<ContextProvider> worker_context_provider, | 55 scoped_refptr<ContextProvider> worker_context_provider, |
56 SharedBitmapManager* shared_bitmap_manager, | 56 SharedBitmapManager* shared_bitmap_manager, |
57 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 57 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
58 const RendererSettings& renderer_settings, | 58 const RendererSettings& renderer_settings, |
59 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 59 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
60 bool synchronous_composite, | 60 bool synchronous_composite); |
61 bool force_disable_reclaim_resources); | |
62 ~TestCompositorFrameSink() override; | 61 ~TestCompositorFrameSink() override; |
63 | 62 |
64 // This client must be set before BindToClient() happens. | 63 // This client must be set before BindToClient() happens. |
65 void SetClient(TestCompositorFrameSinkClient* client) { | 64 void SetClient(TestCompositorFrameSinkClient* client) { |
66 test_client_ = client; | 65 test_client_ = client; |
67 } | 66 } |
68 void SetEnlargePassTextureAmount(const gfx::Size& s) { | 67 void SetEnlargePassTextureAmount(const gfx::Size& s) { |
69 enlarge_pass_texture_amount_ = s; | 68 enlarge_pass_texture_amount_ = s; |
70 } | 69 } |
71 | 70 |
72 Display* display() const { return display_.get(); } | 71 Display* display() const { return display_.get(); } |
73 | 72 |
74 // Will be included with the next SubmitCompositorFrame. | 73 // Will be included with the next SubmitCompositorFrame. |
75 void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> request); | 74 void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> request); |
76 | 75 |
77 // CompositorFrameSink implementation. | 76 // CompositorFrameSink implementation. |
78 bool BindToClient(CompositorFrameSinkClient* client) override; | 77 bool BindToClient(CompositorFrameSinkClient* client) override; |
79 void DetachFromClient() override; | 78 void DetachFromClient() override; |
80 void SetLocalSurfaceId(const LocalSurfaceId& local_surface_id) override; | 79 void SetLocalSurfaceId(const LocalSurfaceId& local_surface_id) override; |
81 void SubmitCompositorFrame(CompositorFrame frame) override; | 80 void SubmitCompositorFrame(CompositorFrame frame) override; |
82 void ForceReclaimResources() override; | |
83 | 81 |
84 // CompositorFrameSinkSupportClient implementation. | 82 // CompositorFrameSinkSupportClient implementation. |
85 void DidReceiveCompositorFrameAck( | 83 void DidReceiveCompositorFrameAck( |
86 const ReturnedResourceArray& resources) override; | 84 const ReturnedResourceArray& resources) override; |
87 void OnBeginFrame(const BeginFrameArgs& args) override; | 85 void OnBeginFrame(const BeginFrameArgs& args) override; |
88 void ReclaimResources(const ReturnedResourceArray& resources) override; | 86 void ReclaimResources(const ReturnedResourceArray& resources) override; |
89 void WillDrawSurface(const LocalSurfaceId& local_surface_id, | 87 void WillDrawSurface(const LocalSurfaceId& local_surface_id, |
90 const gfx::Rect& damage_rect) override; | 88 const gfx::Rect& damage_rect) override; |
91 | 89 |
92 // DisplayClient implementation. | 90 // DisplayClient implementation. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 gfx::Size enlarge_pass_texture_amount_; | 125 gfx::Size enlarge_pass_texture_amount_; |
128 | 126 |
129 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests_; | 127 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests_; |
130 | 128 |
131 base::WeakPtrFactory<TestCompositorFrameSink> weak_ptr_factory_; | 129 base::WeakPtrFactory<TestCompositorFrameSink> weak_ptr_factory_; |
132 }; | 130 }; |
133 | 131 |
134 } // namespace cc | 132 } // namespace cc |
135 | 133 |
136 #endif // CC_TEST_TEST_COMPOSITOR_FRAME_SINK_H_ | 134 #endif // CC_TEST_TEST_COMPOSITOR_FRAME_SINK_H_ |
OLD | NEW |