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

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

Issue 2473933002: Enable WebGL 2 by default! (on desktop) (Closed)
Patch Set: undo rename of GpuPreferences::enable_unsafe_es3_apis 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 | « tools/metrics/histograms/histograms.xml ('k') | ui/gl/gl_surface_egl.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 // This file implements the GLContextWGL and PbufferGLContext classes. 5 // This file implements the GLContextWGL and PbufferGLContext classes.
6 6
7 #include "ui/gl/gl_context_wgl.h" 7 #include "ui/gl/gl_context_wgl.h"
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 13 matching lines...) Expand all
24 // Get the handle of another initialized context in the share group _before_ 24 // Get the handle of another initialized context in the share group _before_
25 // setting context_. Otherwise this context will be considered initialized 25 // setting context_. Otherwise this context will be considered initialized
26 // and could potentially be returned by GetHandle. 26 // and could potentially be returned by GetHandle.
27 HGLRC share_handle = static_cast<HGLRC>(share_group()->GetHandle()); 27 HGLRC share_handle = static_cast<HGLRC>(share_group()->GetHandle());
28 28
29 HDC device_context = static_cast<HDC>(compatible_surface->GetHandle()); 29 HDC device_context = static_cast<HDC>(compatible_surface->GetHandle());
30 bool has_wgl_create_context_arb = 30 bool has_wgl_create_context_arb =
31 strstr(wglGetExtensionsStringARB(device_context), 31 strstr(wglGetExtensionsStringARB(device_context),
32 "WGL_ARB_create_context") != nullptr; 32 "WGL_ARB_create_context") != nullptr;
33 bool create_core_profile = has_wgl_create_context_arb && 33 bool create_core_profile = has_wgl_create_context_arb &&
34 base::CommandLine::ForCurrentProcess()->HasSwitch( 34 !base::CommandLine::ForCurrentProcess()->HasSwitch(
35 switches::kEnableUnsafeES3APIs); 35 switches::kDisableES3GLContext);
36 36
37 if (create_core_profile) { 37 if (create_core_profile) {
38 std::pair<int, int> attempt_versions[] = { 38 std::pair<int, int> attempt_versions[] = {
39 {4, 5}, {4, 4}, {4, 3}, {4, 2}, {4, 1}, {4, 0}, {3, 3}, {3, 2}, 39 {4, 5}, {4, 4}, {4, 3}, {4, 2}, {4, 1}, {4, 0}, {3, 3}, {3, 2},
40 }; 40 };
41 41
42 for (const auto& version : attempt_versions) { 42 for (const auto& version : attempt_versions) {
43 const int attribs[] = { 43 const int attribs[] = {
44 WGL_CONTEXT_MAJOR_VERSION_ARB, 44 WGL_CONTEXT_MAJOR_VERSION_ARB,
45 version.first, 45 version.first,
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 return GLContext::GetExtensions() + " " + extensions; 168 return GLContext::GetExtensions() + " " + extensions;
169 169
170 return GLContext::GetExtensions(); 170 return GLContext::GetExtensions();
171 } 171 }
172 172
173 GLContextWGL::~GLContextWGL() { 173 GLContextWGL::~GLContextWGL() {
174 Destroy(); 174 Destroy();
175 } 175 }
176 176
177 } // namespace gl 177 } // namespace gl
OLDNEW
« no previous file with comments | « tools/metrics/histograms/histograms.xml ('k') | ui/gl/gl_surface_egl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698