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

Side by Side Diff: ui/gl/gl_surface_egl.cc

Issue 2444813002: Remove unsafe mode to enable es3 api by default for WebGL2 and ES3 context (Closed)
Patch Set: fix a bug Created 4 years, 1 month 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
« no previous file with comments | « ui/gl/gl_context_wgl.cc ('k') | ui/gl/gl_switches.h » ('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 "ui/gl/gl_surface_egl.h" 5 #include "ui/gl/gl_surface_egl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 if (*num_configs == 0) { 224 if (*num_configs == 0) {
225 return false; 225 return false;
226 } 226 }
227 return true; 227 return true;
228 } 228 }
229 229
230 EGLConfig ChooseConfig(GLSurface::Format format) { 230 EGLConfig ChooseConfig(GLSurface::Format format) {
231 // Choose an EGL configuration. 231 // Choose an EGL configuration.
232 // On X this is only used for PBuffer surfaces. 232 // On X this is only used for PBuffer surfaces.
233 std::vector<EGLint> renderable_types; 233 std::vector<EGLint> renderable_types;
234 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
235 switches::kEnableUnsafeES3APIs)) {
236 renderable_types.push_back(EGL_OPENGL_ES3_BIT);
237 }
238 renderable_types.push_back(EGL_OPENGL_ES2_BIT); 234 renderable_types.push_back(EGL_OPENGL_ES2_BIT);
235 renderable_types.push_back(EGL_OPENGL_ES3_BIT);
239 236
240 EGLint buffer_size = 32; 237 EGLint buffer_size = 32;
241 EGLint alpha_size = 8; 238 EGLint alpha_size = 8;
242 239
243 #if defined(USE_X11) && !defined(OS_CHROMEOS) 240 #if defined(USE_X11) && !defined(OS_CHROMEOS)
244 ui::XVisualManager::GetInstance()->ChooseVisualForWindow( 241 ui::XVisualManager::GetInstance()->ChooseVisualForWindow(
245 true, nullptr, &buffer_size, nullptr, nullptr); 242 true, nullptr, &buffer_size, nullptr, nullptr);
246 alpha_size = buffer_size == 32 ? 8 : 0; 243 alpha_size = buffer_size == 32 ? 8 : 0;
247 #endif 244 #endif
248 245
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after
1200 } 1197 }
1201 1198
1202 void* SurfacelessEGL::GetShareHandle() { 1199 void* SurfacelessEGL::GetShareHandle() {
1203 return NULL; 1200 return NULL;
1204 } 1201 }
1205 1202
1206 SurfacelessEGL::~SurfacelessEGL() { 1203 SurfacelessEGL::~SurfacelessEGL() {
1207 } 1204 }
1208 1205
1209 } // namespace gl 1206 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/gl_context_wgl.cc ('k') | ui/gl/gl_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698