| 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/gl/gl_implementation.h" | 10 #include "ui/gl/gl_implementation.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(GLSurfaceOzoneEGL); | 49 DISALLOW_COPY_AND_ASSIGN(GLSurfaceOzoneEGL); |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 } // namespace | 52 } // namespace |
| 53 | 53 |
| 54 // static | 54 // static |
| 55 bool GLSurface::InitializeOneOffInternal() { | 55 bool GLSurface::InitializeOneOffInternal() { |
| 56 switch (GetGLImplementation()) { | 56 switch (GetGLImplementation()) { |
| 57 case kGLImplementationEGLGLES2: | 57 case kGLImplementationEGLGLES2: |
| 58 if (ui::SurfaceFactoryOzone::GetInstance()->InitializeHardware() != | |
| 59 ui::SurfaceFactoryOzone::INITIALIZED) { | |
| 60 LOG(ERROR) << "Ozone failed to initialize hardware"; | |
| 61 return false; | |
| 62 } | |
| 63 | |
| 64 if (!GLSurfaceEGL::InitializeOneOff()) { | 58 if (!GLSurfaceEGL::InitializeOneOff()) { |
| 65 LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed."; | 59 LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed."; |
| 66 return false; | 60 return false; |
| 67 } | 61 } |
| 68 | 62 |
| 69 return true; | 63 return true; |
| 70 case kGLImplementationOSMesaGL: | 64 case kGLImplementationOSMesaGL: |
| 71 case kGLImplementationMockGL: | 65 case kGLImplementationMockGL: |
| 72 return true; | 66 return true; |
| 73 default: | 67 default: |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 NOTREACHED(); | 128 NOTREACHED(); |
| 135 return NULL; | 129 return NULL; |
| 136 } | 130 } |
| 137 } | 131 } |
| 138 | 132 |
| 139 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { | 133 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { |
| 140 return ui::SurfaceFactoryOzone::GetInstance()->GetNativeDisplay(); | 134 return ui::SurfaceFactoryOzone::GetInstance()->GetNativeDisplay(); |
| 141 } | 135 } |
| 142 | 136 |
| 143 } // namespace gfx | 137 } // namespace gfx |
| OLD | NEW |