OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/gl/init/gl_initializer.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "ui/gl/gl_implementation.h" |
| 9 #include "ui/gl/gl_surface_egl.h" |
| 10 #include "ui/gl/gl_surface_wgl.h" |
| 11 #include "ui/gl/vsync_provider_win.h" |
| 12 |
| 13 namespace gl { |
| 14 namespace init { |
| 15 |
| 16 bool InitializeGLOneOffPlatform() { |
| 17 VSyncProviderWin::InitializeOneOff(); |
| 18 |
| 19 switch (GetGLImplementation()) { |
| 20 case kGLImplementationDesktopGL: |
| 21 if (!GLSurfaceWGL::InitializeOneOff()) { |
| 22 LOG(ERROR) << "GLSurfaceWGL::InitializeOneOff failed."; |
| 23 return false; |
| 24 } |
| 25 break; |
| 26 case kGLImplementationEGLGLES2: |
| 27 if (!GLSurfaceEGL::InitializeOneOff()) { |
| 28 LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed."; |
| 29 return false; |
| 30 } |
| 31 break; |
| 32 case kGLImplementationOSMesaGL: |
| 33 case kGLImplementationMockGL: |
| 34 break; |
| 35 default: |
| 36 NOTREACHED(); |
| 37 } |
| 38 return true; |
| 39 } |
| 40 |
| 41 } // namespace init |
| 42 } // namespace gl |
OLD | NEW |