| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 explicit CALayerInUseQuery(const CALayerInUseQuery&); | 194 explicit CALayerInUseQuery(const CALayerInUseQuery&); |
| 195 ~CALayerInUseQuery(); | 195 ~CALayerInUseQuery(); |
| 196 unsigned texture = 0; | 196 unsigned texture = 0; |
| 197 scoped_refptr<GLImage> image; | 197 scoped_refptr<GLImage> image; |
| 198 }; | 198 }; |
| 199 virtual void ScheduleCALayerInUseQuery( | 199 virtual void ScheduleCALayerInUseQuery( |
| 200 std::vector<CALayerInUseQuery> queries); | 200 std::vector<CALayerInUseQuery> queries); |
| 201 | 201 |
| 202 virtual bool ScheduleDCLayer(const ui::DCRendererLayerParams& params); | 202 virtual bool ScheduleDCLayer(const ui::DCRendererLayerParams& params); |
| 203 | 203 |
| 204 virtual bool SetEnableDCLayers(bool enable); |
| 205 |
| 204 virtual bool IsSurfaceless() const; | 206 virtual bool IsSurfaceless() const; |
| 205 | 207 |
| 206 virtual bool FlipsVertically() const; | 208 virtual bool FlipsVertically() const; |
| 207 | 209 |
| 208 // Returns true if SwapBuffers or PostSubBuffers causes a flip, such that | 210 // Returns true if SwapBuffers or PostSubBuffers causes a flip, such that |
| 209 // the next buffer may be 2 frames old. | 211 // the next buffer may be 2 frames old. |
| 210 virtual bool BuffersFlipped() const; | 212 virtual bool BuffersFlipped() const; |
| 211 | 213 |
| 212 virtual bool SupportsSetDrawRectangle() const; | 214 virtual bool SupportsDCLayers() const; |
| 213 | 215 |
| 214 // Set the rectangle that will be drawn into on the surface. | 216 // Set the rectangle that will be drawn into on the surface. |
| 215 virtual bool SetDrawRectangle(const gfx::Rect& rect); | 217 virtual bool SetDrawRectangle(const gfx::Rect& rect); |
| 216 | 218 |
| 217 // This is the amount by which the scissor and viewport rectangles should be | 219 // This is the amount by which the scissor and viewport rectangles should be |
| 218 // offset. | 220 // offset. |
| 219 virtual gfx::Vector2d GetDrawOffset() const; | 221 virtual gfx::Vector2d GetDrawOffset() const; |
| 220 | 222 |
| 221 static GLSurface* GetCurrent(); | 223 static GLSurface* GetCurrent(); |
| 222 | 224 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 void* GetConfig() override; | 281 void* GetConfig() override; |
| 280 unsigned long GetCompatibilityKey() override; | 282 unsigned long GetCompatibilityKey() override; |
| 281 GLSurfaceFormat GetFormat() override; | 283 GLSurfaceFormat GetFormat() override; |
| 282 gfx::VSyncProvider* GetVSyncProvider() override; | 284 gfx::VSyncProvider* GetVSyncProvider() override; |
| 283 bool ScheduleOverlayPlane(int z_order, | 285 bool ScheduleOverlayPlane(int z_order, |
| 284 gfx::OverlayTransform transform, | 286 gfx::OverlayTransform transform, |
| 285 GLImage* image, | 287 GLImage* image, |
| 286 const gfx::Rect& bounds_rect, | 288 const gfx::Rect& bounds_rect, |
| 287 const gfx::RectF& crop_rect) override; | 289 const gfx::RectF& crop_rect) override; |
| 288 bool ScheduleDCLayer(const ui::DCRendererLayerParams& params) override; | 290 bool ScheduleDCLayer(const ui::DCRendererLayerParams& params) override; |
| 291 bool SetEnableDCLayers(bool enable) override; |
| 289 bool IsSurfaceless() const override; | 292 bool IsSurfaceless() const override; |
| 290 bool FlipsVertically() const override; | 293 bool FlipsVertically() const override; |
| 291 bool BuffersFlipped() const override; | 294 bool BuffersFlipped() const override; |
| 292 bool SupportsSetDrawRectangle() const override; | 295 bool SupportsDCLayers() const override; |
| 293 bool SetDrawRectangle(const gfx::Rect& rect) override; | 296 bool SetDrawRectangle(const gfx::Rect& rect) override; |
| 294 gfx::Vector2d GetDrawOffset() const override; | 297 gfx::Vector2d GetDrawOffset() const override; |
| 295 void OnSetSwapInterval(int interval) override; | 298 void OnSetSwapInterval(int interval) override; |
| 296 | 299 |
| 297 GLSurface* surface() const { return surface_.get(); } | 300 GLSurface* surface() const { return surface_.get(); } |
| 298 | 301 |
| 299 protected: | 302 protected: |
| 300 ~GLSurfaceAdapter() override; | 303 ~GLSurfaceAdapter() override; |
| 301 | 304 |
| 302 private: | 305 private: |
| 303 scoped_refptr<GLSurface> surface_; | 306 scoped_refptr<GLSurface> surface_; |
| 304 | 307 |
| 305 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); | 308 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); |
| 306 }; | 309 }; |
| 307 | 310 |
| 308 // Wraps GLSurface in scoped_refptr and tries to initializes it. Returns a | 311 // Wraps GLSurface in scoped_refptr and tries to initializes it. Returns a |
| 309 // scoped_refptr containing the initialized GLSurface or nullptr if | 312 // scoped_refptr containing the initialized GLSurface or nullptr if |
| 310 // initialization fails. | 313 // initialization fails. |
| 311 GL_EXPORT scoped_refptr<GLSurface> InitializeGLSurface( | 314 GL_EXPORT scoped_refptr<GLSurface> InitializeGLSurface( |
| 312 scoped_refptr<GLSurface> surface); | 315 scoped_refptr<GLSurface> surface); |
| 313 | 316 |
| 314 GL_EXPORT scoped_refptr<GLSurface> InitializeGLSurfaceWithFormat( | 317 GL_EXPORT scoped_refptr<GLSurface> InitializeGLSurfaceWithFormat( |
| 315 scoped_refptr<GLSurface> surface, GLSurfaceFormat format); | 318 scoped_refptr<GLSurface> surface, GLSurfaceFormat format); |
| 316 | 319 |
| 317 } // namespace gl | 320 } // namespace gl |
| 318 | 321 |
| 319 #endif // UI_GL_GL_SURFACE_H_ | 322 #endif // UI_GL_GL_SURFACE_H_ |
| OLD | NEW |