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 TestContextProvider::Create(context.Pass()), false)); | 87 TestContextProvider::Create(context.Pass()), false)); |
88 surface->capabilities_.uses_default_gl_framebuffer = false; | 88 surface->capabilities_.uses_default_gl_framebuffer = false; |
89 return surface.Pass(); | 89 return surface.Pass(); |
90 } | 90 } |
91 | 91 |
92 CompositorFrame& last_sent_frame() { return last_sent_frame_; } | 92 CompositorFrame& last_sent_frame() { return last_sent_frame_; } |
93 size_t num_sent_frames() { return num_sent_frames_; } | 93 size_t num_sent_frames() { return num_sent_frames_; } |
94 | 94 |
95 virtual void SwapBuffers(CompositorFrame* frame) OVERRIDE; | 95 virtual void SwapBuffers(CompositorFrame* frame) OVERRIDE; |
96 | 96 |
97 virtual void SetNeedsBeginFrame(bool enable) OVERRIDE; | |
98 bool needs_begin_frame() const { return needs_begin_frame_; } | |
99 | |
100 virtual bool BindToClient(OutputSurfaceClient* client) OVERRIDE; | 97 virtual bool BindToClient(OutputSurfaceClient* client) OVERRIDE; |
101 | 98 |
102 using OutputSurface::ReleaseGL; | 99 using OutputSurface::ReleaseGL; |
103 using OutputSurface::InitializeAndSetContext3d; | 100 using OutputSurface::InitializeAndSetContext3d; |
104 | 101 |
105 void SetTreeActivationCallback(const base::Closure& callback); | 102 void SetTreeActivationCallback(const base::Closure& callback); |
106 | 103 |
107 const TransferableResourceArray& resources_held_by_parent() { | 104 const TransferableResourceArray& resources_held_by_parent() { |
108 return resources_held_by_parent_; | 105 return resources_held_by_parent_; |
109 } | 106 } |
110 | 107 |
111 void ReturnResource(unsigned id, CompositorFrameAck* ack); | 108 void ReturnResource(unsigned id, CompositorFrameAck* ack); |
112 | 109 |
113 virtual bool HasExternalStencilTest() const OVERRIDE; | 110 virtual bool HasExternalStencilTest() const OVERRIDE; |
114 | 111 |
115 void set_has_external_stencil_test(bool has_test) { | 112 void set_has_external_stencil_test(bool has_test) { |
116 has_external_stencil_test_ = has_test; | 113 has_external_stencil_test_ = has_test; |
117 } | 114 } |
118 | 115 |
119 void SetMemoryPolicyToSetAtBind( | 116 void SetMemoryPolicyToSetAtBind( |
120 scoped_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind); | 117 scoped_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind); |
121 | 118 |
| 119 virtual void SetNeedsBeginFrames(bool needs_begin_frames) OVERRIDE; |
| 120 virtual void AsValueInto(base::debug::TracedValue* dict) const OVERRIDE; |
| 121 |
| 122 void TestSendBeginFrame(const BeginFrameArgs& args) { SendBeginFrame(args); } |
| 123 |
122 protected: | 124 protected: |
123 FakeOutputSurface( | 125 FakeOutputSurface( |
124 scoped_refptr<ContextProvider> context_provider, | 126 scoped_refptr<ContextProvider> context_provider, |
125 bool delegated_rendering); | 127 bool delegated_rendering); |
126 | 128 |
127 FakeOutputSurface( | 129 FakeOutputSurface( |
128 scoped_ptr<SoftwareOutputDevice> software_device, | 130 scoped_ptr<SoftwareOutputDevice> software_device, |
129 bool delegated_rendering); | 131 bool delegated_rendering); |
130 | 132 |
131 FakeOutputSurface( | 133 FakeOutputSurface( |
(...skipping 10 matching lines...) Expand all Loading... |
142 bool has_external_stencil_test_; | 144 bool has_external_stencil_test_; |
143 TransferableResourceArray resources_held_by_parent_; | 145 TransferableResourceArray resources_held_by_parent_; |
144 scoped_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind_; | 146 scoped_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind_; |
145 | 147 |
146 base::WeakPtrFactory<FakeOutputSurface> fake_weak_ptr_factory_; | 148 base::WeakPtrFactory<FakeOutputSurface> fake_weak_ptr_factory_; |
147 }; | 149 }; |
148 | 150 |
149 } // namespace cc | 151 } // namespace cc |
150 | 152 |
151 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_ | 153 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_ |
OLD | NEW |