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

Side by Side Diff: ui/gl/init/gl_initializer_win.cc

Issue 2024953002: Move GL one-off initialization code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@split_x11
Patch Set: Fix windows compile. Created 4 years, 6 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
OLDNEW
(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 // static
17 bool GLInitializer::InitializeOneOffPlatform() {
18 VSyncProviderWin::InitializeOneOff();
19
20 switch (GetGLImplementation()) {
21 case kGLImplementationDesktopGL:
22 if (!GLSurfaceWGL::InitializeOneOff()) {
23 LOG(ERROR) << "GLSurfaceWGL::InitializeOneOff failed.";
24 return false;
25 }
26 break;
27 case kGLImplementationEGLGLES2:
28 if (!GLSurfaceEGL::InitializeOneOff()) {
29 LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed.";
30 return false;
31 }
32 break;
33 case kGLImplementationOSMesaGL:
34 case kGLImplementationMockGL:
35 break;
36 default:
37 NOTREACHED();
38 }
39 return true;
40 }
41
42 } // namespace init
43 } // namespace gl
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698