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

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

Issue 216433008: [Ozone] Explicitly whilelist valid GL platforms and fail GL initialization otherwise (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "ui/gfx/native_widget_types.h" 9 #include "ui/gfx/native_widget_types.h"
10 #include "ui/gfx/ozone/surface_factory_ozone.h" 10 #include "ui/gfx/ozone/surface_factory_ozone.h"
(...skipping 11 matching lines...) Expand all
22 if (gfx::SurfaceFactoryOzone::GetInstance()->InitializeHardware() != 22 if (gfx::SurfaceFactoryOzone::GetInstance()->InitializeHardware() !=
23 gfx::SurfaceFactoryOzone::INITIALIZED) { 23 gfx::SurfaceFactoryOzone::INITIALIZED) {
24 LOG(ERROR) << "Ozone failed to initialize hardware"; 24 LOG(ERROR) << "Ozone failed to initialize hardware";
25 return false; 25 return false;
26 } 26 }
27 27
28 if (!GLSurfaceEGL::InitializeOneOff()) { 28 if (!GLSurfaceEGL::InitializeOneOff()) {
29 LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed."; 29 LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed.";
30 return false; 30 return false;
31 } 31 }
32
33 return true;
34 case kGLImplementationOSMesaGL:
35 case kGLImplementationMockGL:
36 return true;
32 default: 37 default:
33 break; 38 return false;
34 } 39 }
35 return true;
36 } 40 }
37 41
38 // static 42 // static
39 scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface( 43 scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface(
40 gfx::AcceleratedWidget window) { 44 gfx::AcceleratedWidget window) {
41 if (GetGLImplementation() == kGLImplementationOSMesaGL) { 45 if (GetGLImplementation() == kGLImplementationOSMesaGL) {
42 scoped_refptr<GLSurface> surface(new GLSurfaceOSMesaHeadless()); 46 scoped_refptr<GLSurface> surface(new GLSurfaceOSMesaHeadless());
43 if (!surface->Initialize()) 47 if (!surface->Initialize())
44 return NULL; 48 return NULL;
45 return surface; 49 return surface;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 NOTREACHED(); 95 NOTREACHED();
92 return NULL; 96 return NULL;
93 } 97 }
94 } 98 }
95 99
96 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { 100 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() {
97 return SurfaceFactoryOzone::GetInstance()->GetNativeDisplay(); 101 return SurfaceFactoryOzone::GetInstance()->GetNativeDisplay();
98 } 102 }
99 103
100 } // namespace gfx 104 } // namespace gfx
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698