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

Side by Side Diff: trunk/src/ui/gl/gl_implementation_ozone.cc

Issue 149953003: Revert 247793 "Ensure GL initialization only happens once, and p..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 10 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 | « trunk/src/ui/gl/gl_implementation_mac.cc ('k') | trunk/src/ui/gl/gl_implementation_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "ui/gfx/ozone/surface_factory_ozone.h" 6 #include "ui/gfx/ozone/surface_factory_ozone.h"
7 #include "ui/gl/gl_bindings.h" 7 #include "ui/gl/gl_bindings.h"
8 #include "ui/gl/gl_context_stub_with_extensions.h" 8 #include "ui/gl/gl_context_stub_with_extensions.h"
9 #include "ui/gl/gl_egl_api_implementation.h" 9 #include "ui/gl/gl_egl_api_implementation.h"
10 #include "ui/gl/gl_gl_api_implementation.h" 10 #include "ui/gl/gl_gl_api_implementation.h"
(...skipping 19 matching lines...) Expand all
30 30
31 void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) { 31 void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) {
32 impls->push_back(kGLImplementationEGLGLES2); 32 impls->push_back(kGLImplementationEGLGLES2);
33 impls->push_back(kGLImplementationOSMesaGL); 33 impls->push_back(kGLImplementationOSMesaGL);
34 } 34 }
35 35
36 bool InitializeStaticGLBindings(GLImplementation implementation) { 36 bool InitializeStaticGLBindings(GLImplementation implementation) {
37 // Prevent reinitialization with a different implementation. Once the gpu 37 // Prevent reinitialization with a different implementation. Once the gpu
38 // unit tests have initialized with kGLImplementationMock, we don't want to 38 // unit tests have initialized with kGLImplementationMock, we don't want to
39 // later switch to another GL implementation. 39 // later switch to another GL implementation.
40 DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); 40 if (GetGLImplementation() != kGLImplementationNone)
41 return true;
41 42
42 switch (implementation) { 43 switch (implementation) {
43 case kGLImplementationOSMesaGL: 44 case kGLImplementationOSMesaGL:
44 return InitializeStaticGLBindingsOSMesaGL(); 45 return InitializeStaticGLBindingsOSMesaGL();
45 case kGLImplementationEGLGLES2: 46 case kGLImplementationEGLGLES2:
46 ui::OzonePlatform::Initialize(); 47 ui::OzonePlatform::Initialize();
47 if (!gfx::SurfaceFactoryOzone::GetInstance()->LoadEGLGLES2Bindings( 48 if (!gfx::SurfaceFactoryOzone::GetInstance()->LoadEGLGLES2Bindings(
48 base::Bind(&AddGLNativeLibrary), 49 base::Bind(&AddGLNativeLibrary),
49 base::Bind(&SetGLGetProcAddressProc))) 50 base::Bind(&SetGLGetProcAddressProc)))
50 return false; 51 return false;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 switch (GetGLImplementation()) { 113 switch (GetGLImplementation()) {
113 case kGLImplementationEGLGLES2: 114 case kGLImplementationEGLGLES2:
114 return GetGLWindowSystemBindingInfoEGL(info); 115 return GetGLWindowSystemBindingInfoEGL(info);
115 default: 116 default:
116 return false; 117 return false;
117 } 118 }
118 return false; 119 return false;
119 } 120 }
120 121
121 } // namespace gfx 122 } // namespace gfx
OLDNEW
« no previous file with comments | « trunk/src/ui/gl/gl_implementation_mac.cc ('k') | trunk/src/ui/gl/gl_implementation_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698