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

Side by Side Diff: trunk/src/ui/gl/gl_implementation_win.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_ozone.cc ('k') | trunk/src/ui/gl/gl_implementation_x11.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 <vector> 5 #include <vector>
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/base_paths.h" 8 #include "base/base_paths.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) { 105 void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) {
106 impls->push_back(kGLImplementationEGLGLES2); 106 impls->push_back(kGLImplementationEGLGLES2);
107 impls->push_back(kGLImplementationDesktopGL); 107 impls->push_back(kGLImplementationDesktopGL);
108 impls->push_back(kGLImplementationOSMesaGL); 108 impls->push_back(kGLImplementationOSMesaGL);
109 } 109 }
110 110
111 bool InitializeStaticGLBindings(GLImplementation implementation) { 111 bool InitializeStaticGLBindings(GLImplementation implementation) {
112 // Prevent reinitialization with a different implementation. Once the gpu 112 // Prevent reinitialization with a different implementation. Once the gpu
113 // unit tests have initialized with kGLImplementationMock, we don't want to 113 // unit tests have initialized with kGLImplementationMock, we don't want to
114 // later switch to another GL implementation. 114 // later switch to another GL implementation.
115 DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); 115 if (GetGLImplementation() != kGLImplementationNone)
116 return true;
116 117
117 // Allow the main thread or another to initialize these bindings 118 // Allow the main thread or another to initialize these bindings
118 // after instituting restrictions on I/O. Going forward they will 119 // after instituting restrictions on I/O. Going forward they will
119 // likely be used in the browser process on most platforms. The 120 // likely be used in the browser process on most platforms. The
120 // one-time initialization cost is small, between 2 and 5 ms. 121 // one-time initialization cost is small, between 2 and 5 ms.
121 base::ThreadRestrictions::ScopedAllowIO allow_io; 122 base::ThreadRestrictions::ScopedAllowIO allow_io;
122 123
123 switch (implementation) { 124 switch (implementation) {
124 case kGLImplementationOSMesaGL: { 125 case kGLImplementationOSMesaGL: {
125 base::FilePath module_path; 126 base::FilePath module_path;
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 return GetGLWindowSystemBindingInfoWGL(info); 375 return GetGLWindowSystemBindingInfoWGL(info);
375 case kGLImplementationEGLGLES2: 376 case kGLImplementationEGLGLES2:
376 return GetGLWindowSystemBindingInfoEGL(info); 377 return GetGLWindowSystemBindingInfoEGL(info);
377 default: 378 default:
378 return false; 379 return false;
379 } 380 }
380 return false; 381 return false;
381 } 382 }
382 383
383 } // namespace gfx 384 } // namespace gfx
OLDNEW
« no previous file with comments | « trunk/src/ui/gl/gl_implementation_ozone.cc ('k') | trunk/src/ui/gl/gl_implementation_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698