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

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

Issue 216553007: [Ozone] Initialize SurfaceFactoryOzone when initializing GL (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"
11 #include "ui/gl/gl_implementation.h" 11 #include "ui/gl/gl_implementation.h"
12 #include "ui/gl/gl_surface_egl.h" 12 #include "ui/gl/gl_surface_egl.h"
13 #include "ui/gl/gl_surface_osmesa.h" 13 #include "ui/gl/gl_surface_osmesa.h"
14 #include "ui/gl/gl_surface_stub.h" 14 #include "ui/gl/gl_surface_stub.h"
15 15
16 namespace gfx { 16 namespace gfx {
17 17
18 // static 18 // static
19 bool GLSurface::InitializeOneOffInternal() { 19 bool GLSurface::InitializeOneOffInternal() {
20 if (gfx::SurfaceFactoryOzone::GetInstance()->InitializeHardware() !=
21 gfx::SurfaceFactoryOzone::INITIALIZED) {
22 LOG(ERROR) << "Ozone failed to initialize hardware";
23 return false;
24 }
25
20 switch (GetGLImplementation()) { 26 switch (GetGLImplementation()) {
21 case kGLImplementationEGLGLES2: 27 case kGLImplementationEGLGLES2:
22 if (!GLSurfaceEGL::InitializeOneOff()) { 28 if (!GLSurfaceEGL::InitializeOneOff()) {
23 LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed."; 29 LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed.";
24 return false; 30 return false;
25 } 31 }
26 default: 32 default:
27 break; 33 break;
28 } 34 }
29 return true; 35 return true;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 NOTREACHED(); 91 NOTREACHED();
86 return NULL; 92 return NULL;
87 } 93 }
88 } 94 }
89 95
90 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { 96 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() {
91 return SurfaceFactoryOzone::GetInstance()->GetNativeDisplay(); 97 return SurfaceFactoryOzone::GetInstance()->GetNativeDisplay();
92 } 98 }
93 99
94 } // namespace gfx 100 } // 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