OLD | NEW |
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 Loading... |
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 |
OLD | NEW |