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

Unified Diff: ui/gl/init/gl_factory_ozone.cc

Issue 2616723002: Refactor GL surface format handling (Closed)
Patch Set: Fix copyright notice on new files Created 3 years, 11 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 | « ui/gl/init/gl_factory_mac.cc ('k') | ui/gl/init/gl_factory_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/init/gl_factory_ozone.cc
diff --git a/ui/gl/init/gl_factory_ozone.cc b/ui/gl/init/gl_factory_ozone.cc
index ef3cb9a0872f885d0271a606d7725faa68368c56..f2d1cbd9aaaa996116060a63d067f4a5ee5fbf5c 100644
--- a/ui/gl/init/gl_factory_ozone.cc
+++ b/ui/gl/init/gl_factory_ozone.cc
@@ -48,7 +48,8 @@ scoped_refptr<GLSurface> CreateDefaultOffscreenGLSurface(
switch (GetGLImplementation()) {
case kGLImplementationOSMesaGL:
return InitializeGLSurface(
- new GLSurfaceOSMesa(GLSurface::SURFACE_OSMESA_BGRA, size));
+ new GLSurfaceOSMesa(
+ GLSurfaceFormat(GLSurfaceFormat::PIXEL_LAYOUT_BGRA), size));
case kGLImplementationMockGL:
return InitializeGLSurface(new GLSurfaceStub);
default:
@@ -131,9 +132,15 @@ scoped_refptr<GLSurface> CreateSurfacelessViewGLSurface(
GetGLImplementation(), window);
}
-scoped_refptr<GLSurface> CreateOffscreenGLSurface(const gfx::Size& size) {
+scoped_refptr<GLSurface> CreateOffscreenGLSurfaceWithFormat(
+ const gfx::Size& size, GLSurfaceFormat format) {
TRACE_EVENT0("gpu", "gl::init::CreateOffscreenGLSurface");
+ if (!format.IsDefault()) {
+ NOTREACHED() << "FATAL: Ozone only supports default-format surfaces.";
+ return nullptr;
+ }
+
if (HasGLOzone())
return GetGLOzone()->CreateOffscreenGLSurface(size);
« no previous file with comments | « ui/gl/init/gl_factory_mac.cc ('k') | ui/gl/init/gl_factory_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698