| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 unsigned edge_aa_mask, | 176 unsigned edge_aa_mask, |
| 177 const RectF& bounds_rect, | 177 const RectF& bounds_rect, |
| 178 bool is_clipped, | 178 bool is_clipped, |
| 179 const RectF& clip_rect, | 179 const RectF& clip_rect, |
| 180 const Transform& transform); | 180 const Transform& transform); |
| 181 | 181 |
| 182 virtual bool IsSurfaceless() const; | 182 virtual bool IsSurfaceless() const; |
| 183 | 183 |
| 184 virtual bool FlipsVertically() const; | 184 virtual bool FlipsVertically() const; |
| 185 | 185 |
| 186 // Returns true if SwapBuffers or PostSubBuffers causes a flip, such that |
| 187 // the next buffer may be 2 frames old. |
| 188 virtual bool BuffersFlipped() const; |
| 189 |
| 186 // Create a GL surface that renders directly to a view. | 190 // Create a GL surface that renders directly to a view. |
| 187 static scoped_refptr<GLSurface> CreateViewGLSurface( | 191 static scoped_refptr<GLSurface> CreateViewGLSurface( |
| 188 gfx::AcceleratedWidget window); | 192 gfx::AcceleratedWidget window); |
| 189 | 193 |
| 190 #if defined(USE_OZONE) | 194 #if defined(USE_OZONE) |
| 191 // Create a GL surface that renders directly into a window with surfaceless | 195 // Create a GL surface that renders directly into a window with surfaceless |
| 192 // semantics - there is no default framebuffer and the primary surface must | 196 // semantics - there is no default framebuffer and the primary surface must |
| 193 // be presented as an overlay. If surfaceless mode is not supported or | 197 // be presented as an overlay. If surfaceless mode is not supported or |
| 194 // enabled it will return a null pointer. | 198 // enabled it will return a null pointer. |
| 195 static scoped_refptr<GLSurface> CreateSurfacelessViewGLSurface( | 199 static scoped_refptr<GLSurface> CreateSurfacelessViewGLSurface( |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 void* GetConfig() override; | 267 void* GetConfig() override; |
| 264 unsigned GetFormat() override; | 268 unsigned GetFormat() override; |
| 265 VSyncProvider* GetVSyncProvider() override; | 269 VSyncProvider* GetVSyncProvider() override; |
| 266 bool ScheduleOverlayPlane(int z_order, | 270 bool ScheduleOverlayPlane(int z_order, |
| 267 OverlayTransform transform, | 271 OverlayTransform transform, |
| 268 gl::GLImage* image, | 272 gl::GLImage* image, |
| 269 const Rect& bounds_rect, | 273 const Rect& bounds_rect, |
| 270 const RectF& crop_rect) override; | 274 const RectF& crop_rect) override; |
| 271 bool IsSurfaceless() const override; | 275 bool IsSurfaceless() const override; |
| 272 bool FlipsVertically() const override; | 276 bool FlipsVertically() const override; |
| 277 bool BuffersFlipped() const override; |
| 273 | 278 |
| 274 GLSurface* surface() const { return surface_.get(); } | 279 GLSurface* surface() const { return surface_.get(); } |
| 275 | 280 |
| 276 protected: | 281 protected: |
| 277 ~GLSurfaceAdapter() override; | 282 ~GLSurfaceAdapter() override; |
| 278 | 283 |
| 279 private: | 284 private: |
| 280 scoped_refptr<GLSurface> surface_; | 285 scoped_refptr<GLSurface> surface_; |
| 281 | 286 |
| 282 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); | 287 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); |
| 283 }; | 288 }; |
| 284 | 289 |
| 285 } // namespace gfx | 290 } // namespace gfx |
| 286 | 291 |
| 287 #endif // UI_GL_GL_SURFACE_H_ | 292 #endif // UI_GL_GL_SURFACE_H_ |
| OLD | NEW |