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" |
(...skipping 23 matching lines...) Expand all Loading... |
34 void DetachFromClient() override; | 34 void DetachFromClient() override; |
35 void SwapBuffers(CompositorFrame* frame) override; | 35 void SwapBuffers(CompositorFrame* frame) override; |
36 void ForceReclaimResources() override; | 36 void ForceReclaimResources() override; |
37 | 37 |
38 // SurfaceFactoryClient implementation. | 38 // SurfaceFactoryClient implementation. |
39 void ReturnResources(const ReturnedResourceArray& resources) override; | 39 void ReturnResources(const ReturnedResourceArray& resources) override; |
40 void SetBeginFrameSource(BeginFrameSource* begin_frame_source) override; | 40 void SetBeginFrameSource(BeginFrameSource* begin_frame_source) override; |
41 | 41 |
42 // Allow tests to enlarge the backing texture for a non-root render pass, to | 42 // Allow tests to enlarge the backing texture for a non-root render pass, to |
43 // simulate reusing a larger texture from a previous frame for a new | 43 // simulate reusing a larger texture from a previous frame for a new |
44 // render pass. | 44 // render pass. This should be called before the output surface is bound. |
45 void SetEnlargePassTextureAmount(const gfx::Size& amount); | 45 void SetEnlargePassTextureAmount(const gfx::Size& amount); |
46 | 46 |
47 private: | 47 private: |
48 void DrawCallback(SurfaceDrawStatus); | 48 void DrawCallback(SurfaceDrawStatus); |
49 | 49 |
50 class PixelTestDisplayClient : public DisplayClient { | 50 class PixelTestDisplayClient : public DisplayClient { |
51 void OutputSurfaceLost() override {} | 51 void DisplayOutputSurfaceLost() override {} |
52 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override {} | 52 void DisplaySetMemoryPolicy(const ManagedMemoryPolicy& policy) override {} |
53 }; | 53 }; |
54 | 54 |
| 55 SharedBitmapManager* const shared_bitmap_manager_; |
| 56 gpu::GpuMemoryBufferManager* const gpu_memory_buffer_manager_; |
55 const bool allow_force_reclaim_resources_; | 57 const bool allow_force_reclaim_resources_; |
56 const bool synchronous_composite_; | 58 const bool synchronous_composite_; |
57 | 59 |
| 60 gfx::Size enlarge_pass_texture_amount_; |
| 61 |
58 std::unique_ptr<BackToBackBeginFrameSource> begin_frame_source_; | 62 std::unique_ptr<BackToBackBeginFrameSource> begin_frame_source_; |
59 | 63 |
60 // TODO(danakj): These don't to be stored in unique_ptrs when OutputSurface | 64 // TODO(danakj): These don't to be stored in unique_ptrs when OutputSurface |
61 // is owned/destroyed on the compositor thread. | 65 // is owned/destroyed on the compositor thread. |
62 std::unique_ptr<SurfaceManager> surface_manager_; | 66 std::unique_ptr<SurfaceManager> surface_manager_; |
63 std::unique_ptr<SurfaceIdAllocator> surface_id_allocator_; | 67 std::unique_ptr<SurfaceIdAllocator> surface_id_allocator_; |
64 SurfaceId delegated_surface_id_; | 68 SurfaceId delegated_surface_id_; |
65 | 69 |
66 // Uses surface_manager_. | 70 // Uses surface_manager_. |
67 std::unique_ptr<SurfaceFactory> surface_factory_; | 71 std::unique_ptr<SurfaceFactory> surface_factory_; |
68 | 72 |
69 PixelTestDisplayClient display_client_; | 73 PixelTestDisplayClient display_client_; |
70 // Uses surface_manager_. | 74 // Uses surface_manager_. |
71 std::unique_ptr<Display> display_; | 75 std::unique_ptr<Display> display_; |
72 | 76 |
73 base::WeakPtrFactory<PixelTestDelegatingOutputSurface> weak_ptrs_; | 77 base::WeakPtrFactory<PixelTestDelegatingOutputSurface> weak_ptrs_; |
74 }; | 78 }; |
75 | 79 |
76 } // namespace cc | 80 } // namespace cc |
77 | 81 |
78 #endif // CC_TEST_PIXEL_TEST_DELEGATING_OUTPUT_SURFACE_H_ | 82 #endif // CC_TEST_PIXEL_TEST_DELEGATING_OUTPUT_SURFACE_H_ |
OLD | NEW |