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

Unified Diff: ui/gl/init/gl_factory_mac.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_android.cc ('k') | ui/gl/init/gl_factory_ozone.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/init/gl_factory_mac.cc
diff --git a/ui/gl/init/gl_factory_mac.cc b/ui/gl/init/gl_factory_mac.cc
index 243a7909b59e5ab9efa0e425a0a2079d6e55b868..1bcfbadd2e42d337b5e3201e8a2f9f4517eddc73 100644
--- a/ui/gl/init/gl_factory_mac.cc
+++ b/ui/gl/init/gl_factory_mac.cc
@@ -32,7 +32,7 @@ class NoOpGLSurface : public GLSurface {
explicit NoOpGLSurface(const gfx::Size& size) : size_(size) {}
// Implement GLSurface.
- bool Initialize(GLSurface::Format format) override { return true; }
+ bool Initialize(GLSurfaceFormat format) override { return true; }
void Destroy() override {}
bool IsOffscreen() override { return true; }
gfx::SwapResult SwapBuffers() override {
@@ -113,16 +113,19 @@ scoped_refptr<GLSurface> CreateViewGLSurface(gfx::AcceleratedWidget 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");
switch (GetGLImplementation()) {
case kGLImplementationOSMesaGL:
- return InitializeGLSurface(
- new GLSurfaceOSMesa(GLSurface::SURFACE_OSMESA_RGBA, size));
+ format.SetDefaultPixelLayout(GLSurfaceFormat::PIXEL_LAYOUT_RGBA);
+ return InitializeGLSurfaceWithFormat(
+ new GLSurfaceOSMesa(format, size), format);
case kGLImplementationDesktopGL:
case kGLImplementationDesktopGLCoreProfile:
case kGLImplementationAppleGL:
- return InitializeGLSurface(new NoOpGLSurface(size));
+ return InitializeGLSurfaceWithFormat(
+ new NoOpGLSurface(size), format);
case kGLImplementationMockGL:
return new GLSurfaceStub;
default:
« no previous file with comments | « ui/gl/init/gl_factory_android.cc ('k') | ui/gl/init/gl_factory_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698