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

Side by Side Diff: trunk/src/ui/gl/gl_implementation_mac.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
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/base_paths.h" 5 #include "base/base_paths.h"
6 #include "base/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/mac/foundation_util.h" 8 #include "base/mac/foundation_util.h"
9 #include "base/native_library.h" 9 #include "base/native_library.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 13 matching lines...) Expand all
24 void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) { 24 void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) {
25 impls->push_back(kGLImplementationDesktopGL); 25 impls->push_back(kGLImplementationDesktopGL);
26 impls->push_back(kGLImplementationAppleGL); 26 impls->push_back(kGLImplementationAppleGL);
27 impls->push_back(kGLImplementationOSMesaGL); 27 impls->push_back(kGLImplementationOSMesaGL);
28 } 28 }
29 29
30 bool InitializeStaticGLBindings(GLImplementation implementation) { 30 bool InitializeStaticGLBindings(GLImplementation implementation) {
31 // Prevent reinitialization with a different implementation. Once the gpu 31 // Prevent reinitialization with a different implementation. Once the gpu
32 // unit tests have initialized with kGLImplementationMock, we don't want to 32 // unit tests have initialized with kGLImplementationMock, we don't want to
33 // later switch to another GL implementation. 33 // later switch to another GL implementation.
34 DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); 34 if (GetGLImplementation() != kGLImplementationNone)
35 return true;
35 36
36 // Allow the main thread or another to initialize these bindings 37 // Allow the main thread or another to initialize these bindings
37 // after instituting restrictions on I/O. Going forward they will 38 // after instituting restrictions on I/O. Going forward they will
38 // likely be used in the browser process on most platforms. The 39 // likely be used in the browser process on most platforms. The
39 // one-time initialization cost is small, between 2 and 5 ms. 40 // one-time initialization cost is small, between 2 and 5 ms.
40 base::ThreadRestrictions::ScopedAllowIO allow_io; 41 base::ThreadRestrictions::ScopedAllowIO allow_io;
41 42
42 switch (implementation) { 43 switch (implementation) {
43 case kGLImplementationOSMesaGL: { 44 case kGLImplementationOSMesaGL: {
44 // osmesa.so is located in the build directory. This code path is only 45 // osmesa.so is located in the build directory. This code path is only
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 SetGLImplementation(kGLImplementationNone); 147 SetGLImplementation(kGLImplementationNone);
147 148
148 UnloadGLNativeLibraries(); 149 UnloadGLNativeLibraries();
149 } 150 }
150 151
151 bool GetGLWindowSystemBindingInfo(GLWindowSystemBindingInfo* info) { 152 bool GetGLWindowSystemBindingInfo(GLWindowSystemBindingInfo* info) {
152 return false; 153 return false;
153 } 154 }
154 155
155 } // namespace gfx 156 } // namespace gfx
OLDNEW
« no previous file with comments | « trunk/src/ui/gl/gl_implementation_android.cc ('k') | trunk/src/ui/gl/gl_implementation_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698