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

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: Fix header issue 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
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) {}
+
+ 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);
#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);
#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);
static GLSurface* GetCurrent();
// Called when the swap interval for the associated context changes.
virtual void OnSetSwapInterval(int interval);
+ SurfaceConfiguration GetSurfaceConfiguration() {
+ return surface_configuration_;
+ };
viettrungluu 2015/06/09 00:48:15 no semicolon
iansf 2015/06/09 01:52:05 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_;
viettrungluu 2015/06/09 00:48:15 nit: I believe members should be declared after fr
iansf 2015/06/09 01:52:05 Done.
friend class base::RefCounted<GLSurface>;
friend class GLContext;

Powered by Google App Engine
This is Rietveld 408576698