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

Side by Side Diff: ui/gl/gl_surface_win.cc

Issue 1652873002: Android: Use virtualized context only for those with compatible config (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 4 years, 10 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_ozone.cc ('k') | ui/gl/gl_surface_x11.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/gl_surface.h" 5 #include "ui/gl/gl_surface.h"
6 6
7 #include <dwmapi.h> 7 #include <dwmapi.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 NOTREACHED(); 74 NOTREACHED();
75 case kGLImplementationOSMesaGL: 75 case kGLImplementationOSMesaGL:
76 case kGLImplementationMockGL: 76 case kGLImplementationMockGL:
77 break; 77 break;
78 } 78 }
79 return true; 79 return true;
80 } 80 }
81 81
82 NativeViewGLSurfaceOSMesa::NativeViewGLSurfaceOSMesa( 82 NativeViewGLSurfaceOSMesa::NativeViewGLSurfaceOSMesa(
83 gfx::AcceleratedWidget window) 83 gfx::AcceleratedWidget window)
84 : GLSurfaceOSMesa(OSMesaSurfaceFormatRGBA, gfx::Size(1, 1)), 84 : GLSurfaceOSMesa(SURFACE_OSMESA_RGBA, gfx::Size(1, 1)),
85 window_(window), 85 window_(window),
86 device_context_(NULL) { 86 device_context_(NULL) {
87 DCHECK(window); 87 DCHECK(window);
88 } 88 }
89 89
90 NativeViewGLSurfaceOSMesa::~NativeViewGLSurfaceOSMesa() { 90 NativeViewGLSurfaceOSMesa::~NativeViewGLSurfaceOSMesa() {
91 Destroy(); 91 Destroy();
92 } 92 }
93 93
94 bool NativeViewGLSurfaceOSMesa::Initialize(GLSurface::Format format) { 94 bool NativeViewGLSurfaceOSMesa::Initialize(GLSurface::Format format) {
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 } 224 }
225 case kGLImplementationMockGL: 225 case kGLImplementationMockGL:
226 return new GLSurfaceStub; 226 return new GLSurfaceStub;
227 default: 227 default:
228 NOTREACHED(); 228 NOTREACHED();
229 return NULL; 229 return NULL;
230 } 230 }
231 } 231 }
232 232
233 scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface( 233 scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface(
234 const gfx::Size& size, GLSurface::Format format) { 234 const gfx::Size& size) {
235 TRACE_EVENT0("gpu", "GLSurface::CreateOffscreenGLSurface"); 235 TRACE_EVENT0("gpu", "GLSurface::CreateOffscreenGLSurface");
236 switch (GetGLImplementation()) { 236 switch (GetGLImplementation()) {
237 case kGLImplementationOSMesaGL: { 237 case kGLImplementationOSMesaGL: {
238 scoped_refptr<GLSurface> surface( 238 scoped_refptr<GLSurface> surface(
239 new GLSurfaceOSMesa(OSMesaSurfaceFormatRGBA, size)); 239 new GLSurfaceOSMesa(SURFACE_OSMESA_RGBA, size));
240 if (!surface->Initialize(format)) 240 if (!surface->Initialize())
241 return NULL; 241 return NULL;
242 242
243 return surface; 243 return surface;
244 } 244 }
245 case kGLImplementationEGLGLES2: { 245 case kGLImplementationEGLGLES2: {
246 scoped_refptr<GLSurface> surface(new PbufferGLSurfaceEGL(size)); 246 scoped_refptr<GLSurface> surface(new PbufferGLSurfaceEGL(size));
247 if (!surface->Initialize(format)) 247 if (!surface->Initialize())
248 return NULL; 248 return NULL;
249 249
250 return surface; 250 return surface;
251 } 251 }
252 case kGLImplementationDesktopGL: { 252 case kGLImplementationDesktopGL: {
253 scoped_refptr<GLSurface> surface(new PbufferGLSurfaceWGL(size)); 253 scoped_refptr<GLSurface> surface(new PbufferGLSurfaceWGL(size));
254 if (!surface->Initialize(format)) 254 if (!surface->Initialize())
255 return NULL; 255 return NULL;
256 256
257 return surface; 257 return surface;
258 } 258 }
259 case kGLImplementationMockGL: 259 case kGLImplementationMockGL:
260 return new GLSurfaceStub; 260 return new GLSurfaceStub;
261 default: 261 default:
262 NOTREACHED(); 262 NOTREACHED();
263 return NULL; 263 return NULL;
264 } 264 }
265 } 265 }
266 266
267 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { 267 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() {
268 return GetDC(NULL); 268 return GetDC(NULL);
269 } 269 }
270 270
271 } // namespace gfx 271 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gl/gl_surface_ozone.cc ('k') | ui/gl/gl_surface_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698