OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 UI_GL_GL_SURFACE_H_ | 5 #ifndef UI_GL_GL_SURFACE_H_ |
6 #define UI_GL_GL_SURFACE_H_ | 6 #define UI_GL_GL_SURFACE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "ui/gl/gl_image.h" | 22 #include "ui/gl/gl_image.h" |
23 #include "ui/gl/gl_implementation.h" | 23 #include "ui/gl/gl_implementation.h" |
24 #include "ui/gl/gl_surface_format.h" | 24 #include "ui/gl/gl_surface_format.h" |
25 | 25 |
26 namespace gfx { | 26 namespace gfx { |
27 class VSyncProvider; | 27 class VSyncProvider; |
28 } | 28 } |
29 | 29 |
30 namespace ui { | 30 namespace ui { |
31 struct CARendererLayerParams; | 31 struct CARendererLayerParams; |
| 32 struct DCRendererLayerParams; |
32 } | 33 } |
33 | 34 |
34 namespace gl { | 35 namespace gl { |
35 | 36 |
36 class GLContext; | 37 class GLContext; |
37 | 38 |
38 // Encapsulates a surface that can be rendered to with GL, hiding platform | 39 // Encapsulates a surface that can be rendered to with GL, hiding platform |
39 // specific management. | 40 // specific management. |
40 class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> { | 41 class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> { |
41 public: | 42 public: |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 struct GL_EXPORT CALayerInUseQuery { | 192 struct GL_EXPORT CALayerInUseQuery { |
192 CALayerInUseQuery(); | 193 CALayerInUseQuery(); |
193 explicit CALayerInUseQuery(const CALayerInUseQuery&); | 194 explicit CALayerInUseQuery(const CALayerInUseQuery&); |
194 ~CALayerInUseQuery(); | 195 ~CALayerInUseQuery(); |
195 unsigned texture = 0; | 196 unsigned texture = 0; |
196 scoped_refptr<GLImage> image; | 197 scoped_refptr<GLImage> image; |
197 }; | 198 }; |
198 virtual void ScheduleCALayerInUseQuery( | 199 virtual void ScheduleCALayerInUseQuery( |
199 std::vector<CALayerInUseQuery> queries); | 200 std::vector<CALayerInUseQuery> queries); |
200 | 201 |
| 202 virtual bool ScheduleDCLayer(const ui::DCRendererLayerParams& params); |
| 203 |
201 virtual bool IsSurfaceless() const; | 204 virtual bool IsSurfaceless() const; |
202 | 205 |
203 virtual bool FlipsVertically() const; | 206 virtual bool FlipsVertically() const; |
204 | 207 |
205 // Returns true if SwapBuffers or PostSubBuffers causes a flip, such that | 208 // Returns true if SwapBuffers or PostSubBuffers causes a flip, such that |
206 // the next buffer may be 2 frames old. | 209 // the next buffer may be 2 frames old. |
207 virtual bool BuffersFlipped() const; | 210 virtual bool BuffersFlipped() const; |
208 | 211 |
209 virtual bool SupportsSetDrawRectangle() const; | 212 virtual bool SupportsSetDrawRectangle() const; |
210 | 213 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 void* GetDisplay() override; | 278 void* GetDisplay() override; |
276 void* GetConfig() override; | 279 void* GetConfig() override; |
277 unsigned long GetCompatibilityKey() override; | 280 unsigned long GetCompatibilityKey() override; |
278 GLSurfaceFormat GetFormat() override; | 281 GLSurfaceFormat GetFormat() override; |
279 gfx::VSyncProvider* GetVSyncProvider() override; | 282 gfx::VSyncProvider* GetVSyncProvider() override; |
280 bool ScheduleOverlayPlane(int z_order, | 283 bool ScheduleOverlayPlane(int z_order, |
281 gfx::OverlayTransform transform, | 284 gfx::OverlayTransform transform, |
282 GLImage* image, | 285 GLImage* image, |
283 const gfx::Rect& bounds_rect, | 286 const gfx::Rect& bounds_rect, |
284 const gfx::RectF& crop_rect) override; | 287 const gfx::RectF& crop_rect) override; |
| 288 bool ScheduleDCLayer(const ui::DCRendererLayerParams& params) override; |
285 bool IsSurfaceless() const override; | 289 bool IsSurfaceless() const override; |
286 bool FlipsVertically() const override; | 290 bool FlipsVertically() const override; |
287 bool BuffersFlipped() const override; | 291 bool BuffersFlipped() const override; |
288 bool SupportsSetDrawRectangle() const override; | 292 bool SupportsSetDrawRectangle() const override; |
289 bool SetDrawRectangle(const gfx::Rect& rect) override; | 293 bool SetDrawRectangle(const gfx::Rect& rect) override; |
290 gfx::Vector2d GetDrawOffset() const override; | 294 gfx::Vector2d GetDrawOffset() const override; |
291 void OnSetSwapInterval(int interval) override; | 295 void OnSetSwapInterval(int interval) override; |
292 | 296 |
293 GLSurface* surface() const { return surface_.get(); } | 297 GLSurface* surface() const { return surface_.get(); } |
294 | 298 |
(...skipping 11 matching lines...) Expand all Loading... |
306 // initialization fails. | 310 // initialization fails. |
307 GL_EXPORT scoped_refptr<GLSurface> InitializeGLSurface( | 311 GL_EXPORT scoped_refptr<GLSurface> InitializeGLSurface( |
308 scoped_refptr<GLSurface> surface); | 312 scoped_refptr<GLSurface> surface); |
309 | 313 |
310 GL_EXPORT scoped_refptr<GLSurface> InitializeGLSurfaceWithFormat( | 314 GL_EXPORT scoped_refptr<GLSurface> InitializeGLSurfaceWithFormat( |
311 scoped_refptr<GLSurface> surface, GLSurfaceFormat format); | 315 scoped_refptr<GLSurface> surface, GLSurfaceFormat format); |
312 | 316 |
313 } // namespace gl | 317 } // namespace gl |
314 | 318 |
315 #endif // UI_GL_GL_SURFACE_H_ | 319 #endif // UI_GL_GL_SURFACE_H_ |
OLD | NEW |