Chromium Code Reviews| Index: ui/gl/gl_surface.h |
| diff --git a/ui/gl/gl_surface.h b/ui/gl/gl_surface.h |
| index da704228af12ce7c68bfbad278bd05c45ef615e9..f98d37e4d9b2746f719e8d4b68f47e3998ccd5c9 100644 |
| --- a/ui/gl/gl_surface.h |
| +++ b/ui/gl/gl_surface.h |
| @@ -24,11 +24,28 @@ class GLContext; |
| class GLImage; |
| class VSyncProvider; |
| +struct SurfaceConfiguration { |
| + SurfaceConfiguration() |
| + : red_bits(8), |
| + green_bits(8), |
| + blue_bits(8), |
| + alpha_bits(8), |
| + depth_bits(0), |
| + stencil_bits(0) {} |
|
abarth-chromium
2015/06/09 00:30:22
You can delete this constructor and just write:
u
iansf
2015/06/09 01:52:04
Done.
|
| + |
| + uint8_t red_bits; |
| + uint8_t green_bits; |
| + uint8_t blue_bits; |
| + uint8_t alpha_bits; |
| + uint8_t depth_bits; |
| + uint8_t stencil_bits; |
| +}; |
| + |
| // Encapsulates a surface that can be rendered to with GL, hiding platform |
| // specific management. |
| class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> { |
| public: |
| - GLSurface(); |
| + explicit GLSurface(SurfaceConfiguration requested_configuration); |
| // (Re)create the surface. TODO(apatrick): This is an ugly hack to allow the |
| // EGL surface associated to be recreated without destroying the associated |
| @@ -154,7 +171,8 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> { |
| // Create a GL surface that renders directly to a view. |
| static scoped_refptr<GLSurface> CreateViewGLSurface( |
| - gfx::AcceleratedWidget window); |
| + gfx::AcceleratedWidget window, |
| + gfx::SurfaceConfiguration requested_configuration); |
|
abarth-chromium
2015/06/09 00:30:22
const gfx::SurfaceConfiguration&
iansf
2015/06/09 01:52:04
Done.
|
| #if defined(USE_OZONE) |
| // Create a GL surface that renders directly into a window with surfaceless |
| @@ -162,18 +180,24 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> { |
| // be presented as an overlay. If surfaceless mode is not supported or |
| // enabled it will return a null pointer. |
| static scoped_refptr<GLSurface> CreateSurfacelessViewGLSurface( |
| - gfx::AcceleratedWidget window); |
| + gfx::AcceleratedWidget window, |
| + gfx::SurfaceConfiguration requested_configuration); |
|
abarth-chromium
2015/06/09 00:30:22
const gfx::SurfaceConfiguration&
iansf
2015/06/09 01:52:04
Done.
|
| #endif // defined(USE_OZONE) |
| // Create a GL surface used for offscreen rendering. |
| static scoped_refptr<GLSurface> CreateOffscreenGLSurface( |
| - const gfx::Size& size); |
| + const gfx::Size& size, |
| + gfx::SurfaceConfiguration requested_configuration); |
|
abarth-chromium
2015/06/09 00:30:21
const gfx::SurfaceConfiguration&
iansf
2015/06/09 01:52:04
Done.
|
| static GLSurface* GetCurrent(); |
| // Called when the swap interval for the associated context changes. |
| virtual void OnSetSwapInterval(int interval); |
| + SurfaceConfiguration GetSurfaceConfiguration() { |
| + return surface_configuration_; |
| + }; |
|
abarth-chromium
2015/06/09 00:30:21
const GetSurfaceConfiguration&
s/GetSurfaceConfig
iansf
2015/06/09 01:52:04
Done.
|
| + |
| protected: |
| virtual ~GLSurface(); |
| static bool InitializeOneOffImplementation(GLImplementation impl, |
| @@ -186,6 +210,7 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> { |
| static bool ExtensionsContain(const char* extensions, const char* name); |
| private: |
| + SurfaceConfiguration surface_configuration_; |
| friend class base::RefCounted<GLSurface>; |
| friend class GLContext; |