OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |