OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_FAKE_OUTPUT_SURFACE_H_ | 5 #ifndef CC_TEST_FAKE_OUTPUT_SURFACE_H_ |
6 #define CC_TEST_FAKE_OUTPUT_SURFACE_H_ | 6 #define CC_TEST_FAKE_OUTPUT_SURFACE_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
11 #include "cc/output/begin_frame_args.h" | 11 #include "cc/output/begin_frame_args.h" |
12 #include "cc/output/compositor_frame.h" | 12 #include "cc/output/compositor_frame.h" |
13 #include "cc/output/managed_memory_policy.h" | |
14 #include "cc/output/output_surface.h" | 13 #include "cc/output/output_surface.h" |
15 #include "cc/output/software_output_device.h" | 14 #include "cc/output/software_output_device.h" |
16 #include "cc/test/test_context_provider.h" | 15 #include "cc/test/test_context_provider.h" |
17 #include "cc/test/test_web_graphics_context_3d.h" | 16 #include "cc/test/test_web_graphics_context_3d.h" |
18 | 17 |
19 namespace cc { | 18 namespace cc { |
20 | 19 |
21 class FakeOutputSurface : public OutputSurface { | 20 class FakeOutputSurface : public OutputSurface { |
22 public: | 21 public: |
23 ~FakeOutputSurface() override; | 22 ~FakeOutputSurface() override; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 } | 115 } |
117 | 116 |
118 void ReturnResource(unsigned id, CompositorFrameAck* ack); | 117 void ReturnResource(unsigned id, CompositorFrameAck* ack); |
119 | 118 |
120 bool HasExternalStencilTest() const override; | 119 bool HasExternalStencilTest() const override; |
121 | 120 |
122 void set_has_external_stencil_test(bool has_test) { | 121 void set_has_external_stencil_test(bool has_test) { |
123 has_external_stencil_test_ = has_test; | 122 has_external_stencil_test_ = has_test; |
124 } | 123 } |
125 | 124 |
126 void SetMemoryPolicyToSetAtBind( | |
127 scoped_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind); | |
128 | |
129 gfx::Rect last_swap_rect() const { | 125 gfx::Rect last_swap_rect() const { |
130 return last_swap_rect_; | 126 return last_swap_rect_; |
131 } | 127 } |
132 | 128 |
133 protected: | 129 protected: |
134 FakeOutputSurface( | 130 FakeOutputSurface( |
135 scoped_refptr<ContextProvider> context_provider, | 131 scoped_refptr<ContextProvider> context_provider, |
136 bool delegated_rendering); | 132 bool delegated_rendering); |
137 | 133 |
138 FakeOutputSurface(scoped_refptr<ContextProvider> context_provider, | 134 FakeOutputSurface(scoped_refptr<ContextProvider> context_provider, |
139 scoped_refptr<ContextProvider> worker_context_provider, | 135 scoped_refptr<ContextProvider> worker_context_provider, |
140 bool delegated_rendering); | 136 bool delegated_rendering); |
141 | 137 |
142 FakeOutputSurface(scoped_ptr<SoftwareOutputDevice> software_device, | 138 FakeOutputSurface(scoped_ptr<SoftwareOutputDevice> software_device, |
143 bool delegated_rendering); | 139 bool delegated_rendering); |
144 | 140 |
145 FakeOutputSurface( | 141 FakeOutputSurface( |
146 scoped_refptr<ContextProvider> context_provider, | 142 scoped_refptr<ContextProvider> context_provider, |
147 scoped_ptr<SoftwareOutputDevice> software_device, | 143 scoped_ptr<SoftwareOutputDevice> software_device, |
148 bool delegated_rendering); | 144 bool delegated_rendering); |
149 | 145 |
150 OutputSurfaceClient* client_; | 146 OutputSurfaceClient* client_; |
151 CompositorFrame last_sent_frame_; | 147 CompositorFrame last_sent_frame_; |
152 size_t num_sent_frames_; | 148 size_t num_sent_frames_; |
153 bool has_external_stencil_test_; | 149 bool has_external_stencil_test_; |
154 unsigned framebuffer_; | 150 unsigned framebuffer_; |
155 TransferableResourceArray resources_held_by_parent_; | 151 TransferableResourceArray resources_held_by_parent_; |
156 scoped_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind_; | |
157 gfx::Rect last_swap_rect_; | 152 gfx::Rect last_swap_rect_; |
158 }; | 153 }; |
159 | 154 |
160 } // namespace cc | 155 } // namespace cc |
161 | 156 |
162 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_ | 157 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_ |
OLD | NEW |