| 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_DELEGATING_OUTPUT_SURFACE_H_ | 5 #ifndef CC_TEST_TEST_DELEGATING_OUTPUT_SURFACE_H_ |
| 6 #define CC_TEST_TEST_DELEGATING_OUTPUT_SURFACE_H_ | 6 #define CC_TEST_TEST_DELEGATING_OUTPUT_SURFACE_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "cc/output/output_surface.h" | 9 #include "cc/output/output_surface.h" |
| 10 #include "cc/output/renderer_settings.h" | 10 #include "cc/output/renderer_settings.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 44 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 45 const RendererSettings& renderer_settings, | 45 const RendererSettings& renderer_settings, |
| 46 base::SingleThreadTaskRunner* task_runner, | 46 base::SingleThreadTaskRunner* task_runner, |
| 47 bool synchronous_composite, | 47 bool synchronous_composite, |
| 48 bool force_disable_reclaim_resources); | 48 bool force_disable_reclaim_resources); |
| 49 ~TestDelegatingOutputSurface() override; | 49 ~TestDelegatingOutputSurface() override; |
| 50 | 50 |
| 51 void SetClient(TestDelegatingOutputSurfaceClient* client) { | 51 void SetClient(TestDelegatingOutputSurfaceClient* client) { |
| 52 test_client_ = client; | 52 test_client_ = client; |
| 53 } | 53 } |
| 54 void SetEnlargePassTextureAmount(const gfx::Size& s) { |
| 55 enlarge_pass_texture_amount_ = s; |
| 56 } |
| 54 | 57 |
| 55 Display* display() const { return display_.get(); } | 58 Display* display() const { return display_.get(); } |
| 56 | 59 |
| 57 // Will be submitted with the next SwapBuffers. | 60 // Will be submitted with the next SwapBuffers. |
| 58 void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> request); | 61 void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> request); |
| 59 | 62 |
| 60 // OutputSurface implementation. | 63 // OutputSurface implementation. |
| 61 bool BindToClient(OutputSurfaceClient* client) override; | 64 bool BindToClient(OutputSurfaceClient* client) override; |
| 62 void DetachFromClient() override; | 65 void DetachFromClient() override; |
| 63 void SwapBuffers(CompositorFrame frame) override; | 66 void SwapBuffers(CompositorFrame frame) override; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 86 SurfaceId delegated_surface_id_; | 89 SurfaceId delegated_surface_id_; |
| 87 | 90 |
| 88 // Uses surface_manager_. | 91 // Uses surface_manager_. |
| 89 std::unique_ptr<SurfaceFactory> surface_factory_; | 92 std::unique_ptr<SurfaceFactory> surface_factory_; |
| 90 | 93 |
| 91 // Uses surface_manager_. | 94 // Uses surface_manager_. |
| 92 std::unique_ptr<Display> display_; | 95 std::unique_ptr<Display> display_; |
| 93 | 96 |
| 94 bool bound_ = false; | 97 bool bound_ = false; |
| 95 TestDelegatingOutputSurfaceClient* test_client_ = nullptr; | 98 TestDelegatingOutputSurfaceClient* test_client_ = nullptr; |
| 99 gfx::Size enlarge_pass_texture_amount_; |
| 96 | 100 |
| 97 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests_; | 101 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests_; |
| 98 | 102 |
| 99 base::WeakPtrFactory<TestDelegatingOutputSurface> weak_ptrs_; | 103 base::WeakPtrFactory<TestDelegatingOutputSurface> weak_ptrs_; |
| 100 }; | 104 }; |
| 101 | 105 |
| 102 } // namespace cc | 106 } // namespace cc |
| 103 | 107 |
| 104 #endif // CC_TEST_TEST_DELEGATING_OUTPUT_SURFACE_H_ | 108 #endif // CC_TEST_TEST_DELEGATING_OUTPUT_SURFACE_H_ |
| OLD | NEW |