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

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

Issue 1143393007: Teach GPU command buffer whether a context is webgl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 FROM_HERE_WITH_EXPLICIT_FUNCTION( 138 FROM_HERE_WITH_EXPLICIT_FUNCTION(
139 "125248 WebGraphicsContext3DCommandBufferImpl::MaybeInitializeGL")); 139 "125248 WebGraphicsContext3DCommandBufferImpl::MaybeInitializeGL"));
140 140
141 if (!CreateContext(surface_id_ != 0)) { 141 if (!CreateContext(surface_id_ != 0)) {
142 Destroy(); 142 Destroy();
143 143
144 initialize_failed_ = true; 144 initialize_failed_ = true;
145 return false; 145 return false;
146 } 146 }
147 147
148 if (gl_ && attributes_.webGL)
149 gl_->EnableFeatureCHROMIUM("webgl_enable_glsl_webgl_validation");
150
151 command_buffer_->SetContextLostCallback( 148 command_buffer_->SetContextLostCallback(
152 base::Bind(&WebGraphicsContext3DCommandBufferImpl::OnContextLost, 149 base::Bind(&WebGraphicsContext3DCommandBufferImpl::OnContextLost,
153 weak_ptr_factory_.GetWeakPtr())); 150 weak_ptr_factory_.GetWeakPtr()));
154 151
155 command_buffer_->SetOnConsoleMessageCallback( 152 command_buffer_->SetOnConsoleMessageCallback(
156 base::Bind(&WebGraphicsContext3DCommandBufferImpl::OnErrorMessage, 153 base::Bind(&WebGraphicsContext3DCommandBufferImpl::OnErrorMessage,
157 weak_ptr_factory_.GetWeakPtr())); 154 weak_ptr_factory_.GetWeakPtr()));
158 155
159 real_gl_->SetErrorMessageCallback(getErrorMessageCallback()); 156 real_gl_->SetErrorMessageCallback(getErrorMessageCallback());
160 157
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 { 416 {
420 base::AutoLock lock(g_default_share_groups_lock.Get()); 417 base::AutoLock lock(g_default_share_groups_lock.Get());
421 g_default_share_groups.Get().erase(host_.get()); 418 g_default_share_groups.Get().erase(host_.get());
422 } 419 }
423 420
424 gpu::CommandBuffer::State state = command_buffer_->GetLastState(); 421 gpu::CommandBuffer::State state = command_buffer_->GetLastState();
425 UmaRecordContextLost(context_type_, state.error, state.context_lost_reason); 422 UmaRecordContextLost(context_type_, state.error, state.context_lost_reason);
426 } 423 }
427 424
428 } // namespace content 425 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | gpu/blink/webgraphicscontext3d_impl.cc » ('j') | gpu/command_buffer/service/context_group.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698