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

Side by Side Diff: ui/gl/init/gl_factory_ozone.cc

Issue 2764853002: gl: Remove redundant methods/variables from GLSurfaceFormat (Closed)
Patch Set: Replaced format.IsDefault() check with format.IsCompatible(GLSurfaceFormat()) Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « ui/gl/gl_surface_format_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gl/init/gl_factory.h" 5 #include "ui/gl/init/gl_factory.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 #include "ui/gl/gl_context.h" 9 #include "ui/gl/gl_context.h"
10 #include "ui/gl/gl_context_stub.h" 10 #include "ui/gl/gl_context_stub.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 if (HasGLOzone()) 78 if (HasGLOzone())
79 return GetGLOzone()->CreateSurfacelessViewGLSurface(window); 79 return GetGLOzone()->CreateSurfacelessViewGLSurface(window);
80 80
81 return nullptr; 81 return nullptr;
82 } 82 }
83 83
84 scoped_refptr<GLSurface> CreateOffscreenGLSurfaceWithFormat( 84 scoped_refptr<GLSurface> CreateOffscreenGLSurfaceWithFormat(
85 const gfx::Size& size, GLSurfaceFormat format) { 85 const gfx::Size& size, GLSurfaceFormat format) {
86 TRACE_EVENT0("gpu", "gl::init::CreateOffscreenGLSurface"); 86 TRACE_EVENT0("gpu", "gl::init::CreateOffscreenGLSurface");
87 87
88 if (!format.IsDefault()) { 88 if (!format.IsCompatible(GLSurfaceFormat())) {
89 NOTREACHED() << "FATAL: Ozone only supports default-format surfaces."; 89 NOTREACHED() << "FATAL: Ozone only supports default-format surfaces.";
90 return nullptr; 90 return nullptr;
91 } 91 }
92 92
93 if (HasGLOzone()) 93 if (HasGLOzone())
94 return GetGLOzone()->CreateOffscreenGLSurface(size); 94 return GetGLOzone()->CreateOffscreenGLSurface(size);
95 95
96 switch (GetGLImplementation()) { 96 switch (GetGLImplementation()) {
97 case kGLImplementationMockGL: 97 case kGLImplementationMockGL:
98 case kGLImplementationStubGL: 98 case kGLImplementationStubGL:
99 return InitializeGLSurface(new GLSurfaceStub); 99 return InitializeGLSurface(new GLSurfaceStub);
100 default: 100 default:
101 NOTREACHED(); 101 NOTREACHED();
102 } 102 }
103 103
104 return nullptr; 104 return nullptr;
105 } 105 }
106 106
107 } // namespace init 107 } // namespace init
108 } // namespace gl 108 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/gl_surface_format_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698