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 disable_display_vsync); |
61 ~TestCompositorFrameSink() override; | 62 ~TestCompositorFrameSink() override; |
62 | 63 |
63 // This client must be set before BindToClient() happens. | 64 // This client must be set before BindToClient() happens. |
64 void SetClient(TestCompositorFrameSinkClient* client) { | 65 void SetClient(TestCompositorFrameSinkClient* client) { |
65 test_client_ = client; | 66 test_client_ = client; |
66 } | 67 } |
67 void SetEnlargePassTextureAmount(const gfx::Size& s) { | 68 void SetEnlargePassTextureAmount(const gfx::Size& s) { |
68 enlarge_pass_texture_amount_ = s; | 69 enlarge_pass_texture_amount_ = s; |
69 } | 70 } |
70 | 71 |
(...skipping 23 matching lines...) Expand all Loading... |
94 void DisplayDidDrawAndSwap() override; | 95 void DisplayDidDrawAndSwap() override; |
95 | 96 |
96 private: | 97 private: |
97 // ExternalBeginFrameSource implementation. | 98 // ExternalBeginFrameSource implementation. |
98 void OnNeedsBeginFrames(bool needs_begin_frames) override; | 99 void OnNeedsBeginFrames(bool needs_begin_frames) override; |
99 void OnDidFinishFrame(const BeginFrameAck& ack) override; | 100 void OnDidFinishFrame(const BeginFrameAck& ack) override; |
100 | 101 |
101 void SendCompositorFrameAckToClient(); | 102 void SendCompositorFrameAckToClient(); |
102 | 103 |
103 const bool synchronous_composite_; | 104 const bool synchronous_composite_; |
| 105 const bool disable_display_vsync_; |
104 const RendererSettings renderer_settings_; | 106 const RendererSettings renderer_settings_; |
105 | 107 |
106 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 108 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
107 | 109 |
108 FrameSinkId frame_sink_id_; | 110 FrameSinkId frame_sink_id_; |
109 // TODO(danakj): These don't need to be stored in unique_ptrs when | 111 // TODO(danakj): These don't need to be stored in unique_ptrs when |
110 // CompositorFrameSink is owned/destroyed on the compositor thread. | 112 // CompositorFrameSink is owned/destroyed on the compositor thread. |
111 std::unique_ptr<SurfaceManager> surface_manager_; | 113 std::unique_ptr<SurfaceManager> surface_manager_; |
112 std::unique_ptr<LocalSurfaceIdAllocator> local_surface_id_allocator_; | 114 std::unique_ptr<LocalSurfaceIdAllocator> local_surface_id_allocator_; |
113 LocalSurfaceId delegated_local_surface_id_; | 115 LocalSurfaceId delegated_local_surface_id_; |
(...skipping 11 matching lines...) Expand all Loading... |
125 gfx::Size enlarge_pass_texture_amount_; | 127 gfx::Size enlarge_pass_texture_amount_; |
126 | 128 |
127 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests_; | 129 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests_; |
128 | 130 |
129 base::WeakPtrFactory<TestCompositorFrameSink> weak_ptr_factory_; | 131 base::WeakPtrFactory<TestCompositorFrameSink> weak_ptr_factory_; |
130 }; | 132 }; |
131 | 133 |
132 } // namespace cc | 134 } // namespace cc |
133 | 135 |
134 #endif // CC_TEST_TEST_COMPOSITOR_FRAME_SINK_H_ | 136 #endif // CC_TEST_TEST_COMPOSITOR_FRAME_SINK_H_ |
OLD | NEW |