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" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 } | 87 } |
88 | 88 |
89 static scoped_ptr<FakeOutputSurface> CreateOffscreen( | 89 static scoped_ptr<FakeOutputSurface> CreateOffscreen( |
90 scoped_ptr<TestWebGraphicsContext3D> context) { | 90 scoped_ptr<TestWebGraphicsContext3D> context) { |
91 scoped_ptr<FakeOutputSurface> surface(new FakeOutputSurface( | 91 scoped_ptr<FakeOutputSurface> surface(new FakeOutputSurface( |
92 TestContextProvider::Create(context.Pass()), false)); | 92 TestContextProvider::Create(context.Pass()), false)); |
93 surface->capabilities_.uses_default_gl_framebuffer = false; | 93 surface->capabilities_.uses_default_gl_framebuffer = false; |
94 return surface.Pass(); | 94 return surface.Pass(); |
95 } | 95 } |
96 | 96 |
| 97 void set_max_frames_pending(int max) { |
| 98 capabilities_.max_frames_pending = max; |
| 99 } |
| 100 |
97 CompositorFrame& last_sent_frame() { return last_sent_frame_; } | 101 CompositorFrame& last_sent_frame() { return last_sent_frame_; } |
98 size_t num_sent_frames() { return num_sent_frames_; } | 102 size_t num_sent_frames() { return num_sent_frames_; } |
99 | 103 |
100 void SwapBuffers(CompositorFrame* frame) override; | 104 void SwapBuffers(CompositorFrame* frame) override; |
101 | 105 |
102 OutputSurfaceClient* client() { return client_; } | 106 OutputSurfaceClient* client() { return client_; } |
103 bool BindToClient(OutputSurfaceClient* client) override; | 107 bool BindToClient(OutputSurfaceClient* client) override; |
104 | 108 |
105 void set_framebuffer(unsigned framebuffer) { framebuffer_ = framebuffer; } | 109 void set_framebuffer(unsigned framebuffer) { framebuffer_ = framebuffer; } |
106 void BindFramebuffer() override; | 110 void BindFramebuffer() override; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 bool suspended_for_recycle_; | 160 bool suspended_for_recycle_; |
157 unsigned framebuffer_; | 161 unsigned framebuffer_; |
158 TransferableResourceArray resources_held_by_parent_; | 162 TransferableResourceArray resources_held_by_parent_; |
159 scoped_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind_; | 163 scoped_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind_; |
160 gfx::Rect last_swap_rect_; | 164 gfx::Rect last_swap_rect_; |
161 }; | 165 }; |
162 | 166 |
163 } // namespace cc | 167 } // namespace cc |
164 | 168 |
165 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_ | 169 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_ |
OLD | NEW |