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

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

Issue 1052153002: Use the desktop GL core profile on Linux when ES3 support is requested. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added link to bug in TODO. Created 5 years, 8 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_implementation_x11.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 (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 "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 gfx::AcceleratedWidget window_; 45 gfx::AcceleratedWidget window_;
46 GC pixmap_graphics_context_; 46 GC pixmap_graphics_context_;
47 Pixmap pixmap_; 47 Pixmap pixmap_;
48 48
49 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceOSMesa); 49 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceOSMesa);
50 }; 50 };
51 51
52 bool GLSurface::InitializeOneOffInternal() { 52 bool GLSurface::InitializeOneOffInternal() {
53 switch (GetGLImplementation()) { 53 switch (GetGLImplementation()) {
54 case kGLImplementationDesktopGL: 54 case kGLImplementationDesktopGL:
55 case kGLImplementationDesktopGLCoreProfile:
55 if (!GLSurfaceGLX::InitializeOneOff()) { 56 if (!GLSurfaceGLX::InitializeOneOff()) {
56 LOG(ERROR) << "GLSurfaceGLX::InitializeOneOff failed."; 57 LOG(ERROR) << "GLSurfaceGLX::InitializeOneOff failed.";
57 return false; 58 return false;
58 } 59 }
59 break; 60 break;
60 case kGLImplementationOSMesaGL: 61 case kGLImplementationOSMesaGL:
61 if (!NativeViewGLSurfaceOSMesa::InitializeOneOff()) { 62 if (!NativeViewGLSurfaceOSMesa::InitializeOneOff()) {
62 LOG(ERROR) << "NativeViewGLSurfaceOSMesa::InitializeOneOff failed."; 63 LOG(ERROR) << "NativeViewGLSurfaceOSMesa::InitializeOneOff failed.";
63 return false; 64 return false;
64 } 65 }
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 TRACE_EVENT0("gpu", "GLSurface::CreateViewGLSurface"); 277 TRACE_EVENT0("gpu", "GLSurface::CreateViewGLSurface");
277 switch (GetGLImplementation()) { 278 switch (GetGLImplementation()) {
278 case kGLImplementationOSMesaGL: { 279 case kGLImplementationOSMesaGL: {
279 scoped_refptr<GLSurface> surface( 280 scoped_refptr<GLSurface> surface(
280 new NativeViewGLSurfaceOSMesa(window)); 281 new NativeViewGLSurfaceOSMesa(window));
281 if (!surface->Initialize()) 282 if (!surface->Initialize())
282 return NULL; 283 return NULL;
283 284
284 return surface; 285 return surface;
285 } 286 }
286 case kGLImplementationDesktopGL: { 287 case kGLImplementationDesktopGL:
288 case kGLImplementationDesktopGLCoreProfile: {
287 scoped_refptr<GLSurface> surface(new NativeViewGLSurfaceGLX(window)); 289 scoped_refptr<GLSurface> surface(new NativeViewGLSurfaceGLX(window));
288 if (!surface->Initialize()) 290 if (!surface->Initialize())
289 return NULL; 291 return NULL;
290 292
291 return surface; 293 return surface;
292 } 294 }
293 case kGLImplementationEGLGLES2: { 295 case kGLImplementationEGLGLES2: {
294 DCHECK(window != gfx::kNullAcceleratedWidget); 296 DCHECK(window != gfx::kNullAcceleratedWidget);
295 scoped_refptr<GLSurface> surface(new NativeViewGLSurfaceEGL(window)); 297 scoped_refptr<GLSurface> surface(new NativeViewGLSurfaceEGL(window));
296 if (!surface->Initialize()) 298 if (!surface->Initialize())
(...skipping 14 matching lines...) Expand all
311 TRACE_EVENT0("gpu", "GLSurface::CreateOffscreenGLSurface"); 313 TRACE_EVENT0("gpu", "GLSurface::CreateOffscreenGLSurface");
312 switch (GetGLImplementation()) { 314 switch (GetGLImplementation()) {
313 case kGLImplementationOSMesaGL: { 315 case kGLImplementationOSMesaGL: {
314 scoped_refptr<GLSurface> surface( 316 scoped_refptr<GLSurface> surface(
315 new GLSurfaceOSMesa(OSMesaSurfaceFormatRGBA, size)); 317 new GLSurfaceOSMesa(OSMesaSurfaceFormatRGBA, size));
316 if (!surface->Initialize()) 318 if (!surface->Initialize())
317 return NULL; 319 return NULL;
318 320
319 return surface; 321 return surface;
320 } 322 }
321 case kGLImplementationDesktopGL: { 323 case kGLImplementationDesktopGL:
324 case kGLImplementationDesktopGLCoreProfile: {
322 scoped_refptr<GLSurface> surface(new PbufferGLSurfaceGLX(size)); 325 scoped_refptr<GLSurface> surface(new PbufferGLSurfaceGLX(size));
323 if (!surface->Initialize()) 326 if (!surface->Initialize())
324 return NULL; 327 return NULL;
325 328
326 return surface; 329 return surface;
327 } 330 }
328 case kGLImplementationEGLGLES2: { 331 case kGLImplementationEGLGLES2: {
329 scoped_refptr<GLSurface> surface(new PbufferGLSurfaceEGL(size)); 332 scoped_refptr<GLSurface> surface(new PbufferGLSurfaceEGL(size));
330 if (!surface->Initialize()) 333 if (!surface->Initialize())
331 return NULL; 334 return NULL;
332 335
333 return surface; 336 return surface;
334 } 337 }
335 case kGLImplementationMockGL: 338 case kGLImplementationMockGL:
336 return new GLSurfaceStub; 339 return new GLSurfaceStub;
337 default: 340 default:
338 NOTREACHED(); 341 NOTREACHED();
339 return NULL; 342 return NULL;
340 } 343 }
341 } 344 }
342 345
343 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { 346 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() {
344 return gfx::GetXDisplay(); 347 return gfx::GetXDisplay();
345 } 348 }
346 349
347 } // namespace gfx 350 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gl/gl_implementation_x11.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698