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_OUTPUT_OUTPUT_SURFACE_H_ | 5 #ifndef CC_OUTPUT_OUTPUT_SURFACE_H_ |
6 #define CC_OUTPUT_OUTPUT_SURFACE_H_ | 6 #define CC_OUTPUT_OUTPUT_SURFACE_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // surface. Either of these may return a null pointer, but not both. | 87 // surface. Either of these may return a null pointer, but not both. |
88 // In the event of a lost context, the entire output surface should be | 88 // In the event of a lost context, the entire output surface should be |
89 // recreated. | 89 // recreated. |
90 scoped_refptr<ContextProvider> context_provider() const { | 90 scoped_refptr<ContextProvider> context_provider() const { |
91 return context_provider_.get(); | 91 return context_provider_.get(); |
92 } | 92 } |
93 SoftwareOutputDevice* software_device() const { | 93 SoftwareOutputDevice* software_device() const { |
94 return software_device_.get(); | 94 return software_device_.get(); |
95 } | 95 } |
96 | 96 |
97 // In the case where both the context3d and software_device are present | |
98 // (namely Android WebView), this is called to determine whether the software | |
99 // device should be used on the current frame. | |
100 virtual bool ForcedDrawToSoftwareDevice() const; | |
101 | |
102 // Called by the compositor on the compositor thread. This is a place where | 97 // Called by the compositor on the compositor thread. This is a place where |
103 // thread-specific data for the output surface can be initialized, since from | 98 // thread-specific data for the output surface can be initialized, since from |
104 // this point on the output surface will only be used on the compositor | 99 // this point on the output surface will only be used on the compositor |
105 // thread. | 100 // thread. |
106 virtual bool BindToClient(OutputSurfaceClient* client); | 101 virtual bool BindToClient(OutputSurfaceClient* client); |
107 | 102 |
108 // This is called by the compositor on the compositor thread inside ReleaseGL | 103 // This is called by the compositor on the compositor thread inside ReleaseGL |
109 // in order to release the ContextProvider. Only used with | 104 // in order to release the ContextProvider. Only used with |
110 // deferred_gl_initialization capability. | 105 // deferred_gl_initialization capability. |
111 void ReleaseContextProvider(); | 106 void ReleaseContextProvider(); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 void CommitVSyncParameters(base::TimeTicks timebase, | 159 void CommitVSyncParameters(base::TimeTicks timebase, |
165 base::TimeDelta interval); | 160 base::TimeDelta interval); |
166 | 161 |
167 void SetNeedsRedrawRect(const gfx::Rect& damage_rect); | 162 void SetNeedsRedrawRect(const gfx::Rect& damage_rect); |
168 void ReclaimResources(const CompositorFrameAck* ack); | 163 void ReclaimResources(const CompositorFrameAck* ack); |
169 void DidLoseOutputSurface(); | 164 void DidLoseOutputSurface(); |
170 void SetExternalStencilTest(bool enabled); | 165 void SetExternalStencilTest(bool enabled); |
171 void SetExternalDrawConstraints(const gfx::Transform& transform, | 166 void SetExternalDrawConstraints(const gfx::Transform& transform, |
172 const gfx::Rect& viewport, | 167 const gfx::Rect& viewport, |
173 const gfx::Rect& clip, | 168 const gfx::Rect& clip, |
174 bool valid_for_tile_management); | 169 bool resourceless_software_draw); |
175 | 170 |
176 private: | 171 private: |
177 void SetUpContext3d(); | 172 void SetUpContext3d(); |
178 void ResetContext3d(); | 173 void ResetContext3d(); |
179 void SetMemoryPolicy(const ManagedMemoryPolicy& policy); | 174 void SetMemoryPolicy(const ManagedMemoryPolicy& policy); |
180 | 175 |
181 bool external_stencil_test_enabled_; | 176 bool external_stencil_test_enabled_; |
182 | 177 |
183 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; | 178 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; |
184 | 179 |
185 DISALLOW_COPY_AND_ASSIGN(OutputSurface); | 180 DISALLOW_COPY_AND_ASSIGN(OutputSurface); |
186 }; | 181 }; |
187 | 182 |
188 } // namespace cc | 183 } // namespace cc |
189 | 184 |
190 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ | 185 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ |
OLD | NEW |