| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 std::vector<CALayerInUseQuery> queries); | 198 std::vector<CALayerInUseQuery> queries); |
| 199 | 199 |
| 200 virtual bool IsSurfaceless() const; | 200 virtual bool IsSurfaceless() const; |
| 201 | 201 |
| 202 virtual bool FlipsVertically() const; | 202 virtual bool FlipsVertically() const; |
| 203 | 203 |
| 204 // Returns true if SwapBuffers or PostSubBuffers causes a flip, such that | 204 // Returns true if SwapBuffers or PostSubBuffers causes a flip, such that |
| 205 // the next buffer may be 2 frames old. | 205 // the next buffer may be 2 frames old. |
| 206 virtual bool BuffersFlipped() const; | 206 virtual bool BuffersFlipped() const; |
| 207 | 207 |
| 208 virtual bool SupportsSetDrawRectangle() const; |
| 209 |
| 210 // Set the rectangle that will be drawn into on the surface. |
| 211 virtual bool SetDrawRectangle(const gfx::Rect& rect); |
| 212 |
| 208 static GLSurface* GetCurrent(); | 213 static GLSurface* GetCurrent(); |
| 209 | 214 |
| 210 // Called when the swap interval for the associated context changes. | 215 // Called when the swap interval for the associated context changes. |
| 211 virtual void OnSetSwapInterval(int interval); | 216 virtual void OnSetSwapInterval(int interval); |
| 212 | 217 |
| 213 protected: | 218 protected: |
| 214 virtual ~GLSurface(); | 219 virtual ~GLSurface(); |
| 215 | 220 |
| 216 static void SetCurrent(GLSurface* surface); | 221 static void SetCurrent(GLSurface* surface); |
| 217 | 222 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 GLSurfaceFormat GetFormat() override; | 273 GLSurfaceFormat GetFormat() override; |
| 269 gfx::VSyncProvider* GetVSyncProvider() override; | 274 gfx::VSyncProvider* GetVSyncProvider() override; |
| 270 bool ScheduleOverlayPlane(int z_order, | 275 bool ScheduleOverlayPlane(int z_order, |
| 271 gfx::OverlayTransform transform, | 276 gfx::OverlayTransform transform, |
| 272 GLImage* image, | 277 GLImage* image, |
| 273 const gfx::Rect& bounds_rect, | 278 const gfx::Rect& bounds_rect, |
| 274 const gfx::RectF& crop_rect) override; | 279 const gfx::RectF& crop_rect) override; |
| 275 bool IsSurfaceless() const override; | 280 bool IsSurfaceless() const override; |
| 276 bool FlipsVertically() const override; | 281 bool FlipsVertically() const override; |
| 277 bool BuffersFlipped() const override; | 282 bool BuffersFlipped() const override; |
| 283 bool SupportsSetDrawRectangle() const override; |
| 284 bool SetDrawRectangle(const gfx::Rect& rect) override; |
| 278 void OnSetSwapInterval(int interval) override; | 285 void OnSetSwapInterval(int interval) override; |
| 279 | 286 |
| 280 GLSurface* surface() const { return surface_.get(); } | 287 GLSurface* surface() const { return surface_.get(); } |
| 281 | 288 |
| 282 protected: | 289 protected: |
| 283 ~GLSurfaceAdapter() override; | 290 ~GLSurfaceAdapter() override; |
| 284 | 291 |
| 285 private: | 292 private: |
| 286 scoped_refptr<GLSurface> surface_; | 293 scoped_refptr<GLSurface> surface_; |
| 287 | 294 |
| 288 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); | 295 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); |
| 289 }; | 296 }; |
| 290 | 297 |
| 291 // Wraps GLSurface in scoped_refptr and tries to initializes it. Returns a | 298 // Wraps GLSurface in scoped_refptr and tries to initializes it. Returns a |
| 292 // scoped_refptr containing the initialized GLSurface or nullptr if | 299 // scoped_refptr containing the initialized GLSurface or nullptr if |
| 293 // initialization fails. | 300 // initialization fails. |
| 294 GL_EXPORT scoped_refptr<GLSurface> InitializeGLSurface( | 301 GL_EXPORT scoped_refptr<GLSurface> InitializeGLSurface( |
| 295 scoped_refptr<GLSurface> surface); | 302 scoped_refptr<GLSurface> surface); |
| 296 | 303 |
| 297 GL_EXPORT scoped_refptr<GLSurface> InitializeGLSurfaceWithFormat( | 304 GL_EXPORT scoped_refptr<GLSurface> InitializeGLSurfaceWithFormat( |
| 298 scoped_refptr<GLSurface> surface, GLSurfaceFormat format); | 305 scoped_refptr<GLSurface> surface, GLSurfaceFormat format); |
| 299 | 306 |
| 300 } // namespace gl | 307 } // namespace gl |
| 301 | 308 |
| 302 #endif // UI_GL_GL_SURFACE_H_ | 309 #endif // UI_GL_GL_SURFACE_H_ |
| OLD | NEW |