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_PIXEL_TEST_DELEGATING_OUTPUT_SURFACE_H_ | 5 #ifndef CC_TEST_PIXEL_TEST_DELEGATING_OUTPUT_SURFACE_H_ |
6 #define CC_TEST_PIXEL_TEST_DELEGATING_OUTPUT_SURFACE_H_ | 6 #define CC_TEST_PIXEL_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/scheduler/begin_frame_source.h" | 10 #include "cc/scheduler/begin_frame_source.h" |
11 #include "cc/surfaces/display.h" | 11 #include "cc/surfaces/display.h" |
12 #include "cc/surfaces/display_client.h" | 12 #include "cc/surfaces/display_client.h" |
13 #include "cc/surfaces/surface_factory.h" | 13 #include "cc/surfaces/surface_factory.h" |
14 #include "cc/surfaces/surface_factory_client.h" | 14 #include "cc/surfaces/surface_factory_client.h" |
15 #include "cc/surfaces/surface_id_allocator.h" | 15 #include "cc/surfaces/surface_id_allocator.h" |
16 #include "cc/surfaces/surface_manager.h" | 16 #include "cc/surfaces/surface_manager.h" |
17 | 17 |
18 namespace cc { | 18 namespace cc { |
19 | 19 |
20 class PixelTestDelegatingOutputSurface : public OutputSurface, | 20 class PixelTestDelegatingOutputSurface : public OutputSurface, |
21 public SurfaceFactoryClient { | 21 public SurfaceFactoryClient { |
22 public: | 22 public: |
23 PixelTestDelegatingOutputSurface( | 23 PixelTestDelegatingOutputSurface( |
24 scoped_refptr<ContextProvider> compositor_context_provider, | 24 scoped_refptr<ContextProvider> compositor_context_provider, |
25 scoped_refptr<ContextProvider> worker_context_provider, | 25 scoped_refptr<ContextProvider> worker_context_provider, |
| 26 scoped_refptr<ContextProvider> display_context_provider, |
26 SharedBitmapManager* shared_bitmap_manager, | 27 SharedBitmapManager* shared_bitmap_manager, |
27 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 28 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
28 bool allow_force_reclaim_resources, | 29 bool allow_force_reclaim_resources, |
29 bool synchronous_composite); | 30 bool synchronous_composite); |
30 ~PixelTestDelegatingOutputSurface() override; | 31 ~PixelTestDelegatingOutputSurface() override; |
31 | 32 |
32 // OutputSurface implementation. | 33 // OutputSurface implementation. |
33 bool BindToClient(OutputSurfaceClient* client) override; | 34 bool BindToClient(OutputSurfaceClient* client) override; |
34 void DetachFromClient() override; | 35 void DetachFromClient() override; |
35 void SwapBuffers(CompositorFrame* frame) override; | 36 void SwapBuffers(CompositorFrame* frame) override; |
(...skipping 14 matching lines...) Expand all Loading... |
50 class PixelTestDisplayClient : public DisplayClient { | 51 class PixelTestDisplayClient : public DisplayClient { |
51 void DisplayOutputSurfaceLost() override {} | 52 void DisplayOutputSurfaceLost() override {} |
52 void DisplaySetMemoryPolicy(const ManagedMemoryPolicy& policy) override {} | 53 void DisplaySetMemoryPolicy(const ManagedMemoryPolicy& policy) override {} |
53 }; | 54 }; |
54 | 55 |
55 SharedBitmapManager* const shared_bitmap_manager_; | 56 SharedBitmapManager* const shared_bitmap_manager_; |
56 gpu::GpuMemoryBufferManager* const gpu_memory_buffer_manager_; | 57 gpu::GpuMemoryBufferManager* const gpu_memory_buffer_manager_; |
57 const bool allow_force_reclaim_resources_; | 58 const bool allow_force_reclaim_resources_; |
58 const bool synchronous_composite_; | 59 const bool synchronous_composite_; |
59 | 60 |
| 61 // Passed to the Display. |
| 62 scoped_refptr<ContextProvider> display_context_provider_; |
| 63 |
60 gfx::Size enlarge_pass_texture_amount_; | 64 gfx::Size enlarge_pass_texture_amount_; |
61 | 65 |
62 // TODO(danakj): These don't to be stored in unique_ptrs when OutputSurface | 66 // TODO(danakj): These don't to be stored in unique_ptrs when OutputSurface |
63 // is owned/destroyed on the compositor thread. | 67 // is owned/destroyed on the compositor thread. |
64 std::unique_ptr<SurfaceManager> surface_manager_; | 68 std::unique_ptr<SurfaceManager> surface_manager_; |
65 std::unique_ptr<SurfaceIdAllocator> surface_id_allocator_; | 69 std::unique_ptr<SurfaceIdAllocator> surface_id_allocator_; |
66 SurfaceId delegated_surface_id_; | 70 SurfaceId delegated_surface_id_; |
67 | 71 |
68 // Uses surface_manager_. | 72 // Uses surface_manager_. |
69 std::unique_ptr<SurfaceFactory> surface_factory_; | 73 std::unique_ptr<SurfaceFactory> surface_factory_; |
70 | 74 |
71 PixelTestDisplayClient display_client_; | 75 PixelTestDisplayClient display_client_; |
72 // Uses surface_manager_. | 76 // Uses surface_manager_. |
73 std::unique_ptr<Display> display_; | 77 std::unique_ptr<Display> display_; |
74 | 78 |
75 base::WeakPtrFactory<PixelTestDelegatingOutputSurface> weak_ptrs_; | 79 base::WeakPtrFactory<PixelTestDelegatingOutputSurface> weak_ptrs_; |
76 }; | 80 }; |
77 | 81 |
78 } // namespace cc | 82 } // namespace cc |
79 | 83 |
80 #endif // CC_TEST_PIXEL_TEST_DELEGATING_OUTPUT_SURFACE_H_ | 84 #endif // CC_TEST_PIXEL_TEST_DELEGATING_OUTPUT_SURFACE_H_ |
OLD | NEW |