Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(619)

Unified Diff: ui/gl/gl_surface.h

Issue 1168993002: Update the native_viewport interface to allow specification of the surface configuration, currently… (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Final cleanups Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/shell/gpu/rasterizer.cc ('k') | ui/gl/gl_surface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface.h
diff --git a/ui/gl/gl_surface.h b/ui/gl/gl_surface.h
index da704228af12ce7c68bfbad278bd05c45ef615e9..73c085d4da56ac55da4e23ac0bb2bc99851b94ad 100644
--- a/ui/gl/gl_surface.h
+++ b/ui/gl/gl_surface.h
@@ -24,11 +24,20 @@ class GLContext;
class GLImage;
class VSyncProvider;
+struct SurfaceConfiguration {
+ uint8_t red_bits = 8;
+ uint8_t green_bits = 8;
+ uint8_t blue_bits = 8;
+ uint8_t alpha_bits = 8;
+ uint8_t depth_bits = 0;
+ uint8_t stencil_bits = 0;
+};
+
// 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(const gfx::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 +163,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,
+ const gfx::SurfaceConfiguration& requested_configuration);
#if defined(USE_OZONE)
// Create a GL surface that renders directly into a window with surfaceless
@@ -162,18 +172,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,
+ const gfx::SurfaceConfiguration& requested_configuration);
#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,
+ const gfx::SurfaceConfiguration& requested_configuration);
static GLSurface* GetCurrent();
// Called when the swap interval for the associated context changes.
virtual void OnSetSwapInterval(int interval);
+ const gfx::SurfaceConfiguration get_surface_configuration() {
+ return surface_configuration_;
+ }
+
protected:
virtual ~GLSurface();
static bool InitializeOneOffImplementation(GLImplementation impl,
@@ -189,6 +205,8 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> {
friend class base::RefCounted<GLSurface>;
friend class GLContext;
+ gfx::SurfaceConfiguration surface_configuration_;
+
DISALLOW_COPY_AND_ASSIGN(GLSurface);
};
« no previous file with comments | « sky/shell/gpu/rasterizer.cc ('k') | ui/gl/gl_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698