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

Side by Side Diff: content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc

Issue 421513002: Use webGL context creation attribute to activate GLSL validation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.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 "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" 5 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
6 6
7 #include "third_party/khronos/GLES2/gl2.h" 7 #include "third_party/khronos/GLES2/gl2.h"
8 #ifndef GL_GLEXT_PROTOTYPES 8 #ifndef GL_GLEXT_PROTOTYPES
9 #define GL_GLEXT_PROTOTYPES 1 9 #define GL_GLEXT_PROTOTYPES 1
10 #endif 10 #endif
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 return false; 149 return false;
150 150
151 TRACE_EVENT0("gpu", "WebGfxCtx3DCmdBfrImpl::MaybeInitializeGL"); 151 TRACE_EVENT0("gpu", "WebGfxCtx3DCmdBfrImpl::MaybeInitializeGL");
152 152
153 if (!CreateContext(surface_id_ != 0)) { 153 if (!CreateContext(surface_id_ != 0)) {
154 Destroy(); 154 Destroy();
155 initialize_failed_ = true; 155 initialize_failed_ = true;
156 return false; 156 return false;
157 } 157 }
158 158
159 // TODO(twiz): This code is too fragile in that it assumes that only WebGL 159 if (gl_ && attributes_.webGL)
160 // contexts will request noExtensions.
161 if (gl_ && attributes_.noExtensions)
162 gl_->EnableFeatureCHROMIUM("webgl_enable_glsl_webgl_validation"); 160 gl_->EnableFeatureCHROMIUM("webgl_enable_glsl_webgl_validation");
163 161
164 command_buffer_->SetChannelErrorCallback( 162 command_buffer_->SetChannelErrorCallback(
165 base::Bind(&WebGraphicsContext3DCommandBufferImpl::OnGpuChannelLost, 163 base::Bind(&WebGraphicsContext3DCommandBufferImpl::OnGpuChannelLost,
166 weak_ptr_factory_.GetWeakPtr())); 164 weak_ptr_factory_.GetWeakPtr()));
167 165
168 command_buffer_->SetOnConsoleMessageCallback( 166 command_buffer_->SetOnConsoleMessageCallback(
169 base::Bind(&WebGraphicsContext3DCommandBufferImpl::OnErrorMessage, 167 base::Bind(&WebGraphicsContext3DCommandBufferImpl::OnErrorMessage,
170 weak_ptr_factory_.GetWeakPtr())); 168 weak_ptr_factory_.GetWeakPtr()));
171 169
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 share_group_->RemoveAllContexts(); 433 share_group_->RemoveAllContexts();
436 434
437 DCHECK(host_.get()); 435 DCHECK(host_.get());
438 { 436 {
439 base::AutoLock lock(g_default_share_groups_lock.Get()); 437 base::AutoLock lock(g_default_share_groups_lock.Get());
440 g_default_share_groups.Get().erase(host_.get()); 438 g_default_share_groups.Get().erase(host_.get());
441 } 439 }
442 } 440 }
443 441
444 } // namespace content 442 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698