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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 using OutputSurface::InitializeAndSetContext3d; | 101 using OutputSurface::InitializeAndSetContext3d; |
102 | 102 |
103 void SetTreeActivationCallback(const base::Closure& callback); | 103 void SetTreeActivationCallback(const base::Closure& callback); |
104 | 104 |
105 const TransferableResourceArray& resources_held_by_parent() { | 105 const TransferableResourceArray& resources_held_by_parent() { |
106 return resources_held_by_parent_; | 106 return resources_held_by_parent_; |
107 } | 107 } |
108 | 108 |
109 void ReturnResource(unsigned id, CompositorFrameAck* ack); | 109 void ReturnResource(unsigned id, CompositorFrameAck* ack); |
110 | 110 |
| 111 virtual bool HasExternalStencilTest() const OVERRIDE; |
| 112 |
| 113 void set_has_external_stencil_test(bool has_test) { |
| 114 has_external_stencil_test_ = has_test; |
| 115 } |
| 116 |
111 protected: | 117 protected: |
112 FakeOutputSurface( | 118 FakeOutputSurface( |
113 scoped_refptr<ContextProvider> context_provider, | 119 scoped_refptr<ContextProvider> context_provider, |
114 bool delegated_rendering); | 120 bool delegated_rendering); |
115 | 121 |
116 FakeOutputSurface( | 122 FakeOutputSurface( |
117 scoped_ptr<SoftwareOutputDevice> software_device, | 123 scoped_ptr<SoftwareOutputDevice> software_device, |
118 bool delegated_rendering); | 124 bool delegated_rendering); |
119 | 125 |
120 FakeOutputSurface( | 126 FakeOutputSurface( |
121 scoped_refptr<ContextProvider> context_provider, | 127 scoped_refptr<ContextProvider> context_provider, |
122 scoped_ptr<SoftwareOutputDevice> software_device, | 128 scoped_ptr<SoftwareOutputDevice> software_device, |
123 bool delegated_rendering); | 129 bool delegated_rendering); |
124 | 130 |
125 void OnBeginFrame(); | 131 void OnBeginFrame(); |
126 | 132 |
127 OutputSurfaceClient* client_; | 133 OutputSurfaceClient* client_; |
128 CompositorFrame last_sent_frame_; | 134 CompositorFrame last_sent_frame_; |
129 size_t num_sent_frames_; | 135 size_t num_sent_frames_; |
130 bool needs_begin_frame_; | 136 bool needs_begin_frame_; |
131 bool forced_draw_to_software_device_; | 137 bool forced_draw_to_software_device_; |
| 138 bool has_external_stencil_test_; |
132 base::WeakPtrFactory<FakeOutputSurface> fake_weak_ptr_factory_; | 139 base::WeakPtrFactory<FakeOutputSurface> fake_weak_ptr_factory_; |
133 TransferableResourceArray resources_held_by_parent_; | 140 TransferableResourceArray resources_held_by_parent_; |
134 }; | 141 }; |
135 | 142 |
136 static inline scoped_ptr<OutputSurface> CreateFakeOutputSurface() { | 143 static inline scoped_ptr<OutputSurface> CreateFakeOutputSurface() { |
137 return FakeOutputSurface::Create3d().PassAs<OutputSurface>(); | 144 return FakeOutputSurface::Create3d().PassAs<OutputSurface>(); |
138 } | 145 } |
139 | 146 |
140 } // namespace cc | 147 } // namespace cc |
141 | 148 |
142 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_ | 149 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_ |
OLD | NEW |