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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
147 | 147 |
148 command_buffer_->SetContextLostCallback( | 148 command_buffer_->SetContextLostCallback( |
149 base::Bind(&WebGraphicsContext3DCommandBufferImpl::OnContextLost, | 149 base::Bind(&WebGraphicsContext3DCommandBufferImpl::OnContextLost, |
150 weak_ptr_factory_.GetWeakPtr())); | 150 weak_ptr_factory_.GetWeakPtr())); |
151 | 151 |
152 command_buffer_->SetOnConsoleMessageCallback( | 152 command_buffer_->SetOnConsoleMessageCallback( |
153 base::Bind(&WebGraphicsContext3DCommandBufferImpl::OnErrorMessage, | 153 base::Bind(&WebGraphicsContext3DCommandBufferImpl::OnErrorMessage, |
154 weak_ptr_factory_.GetWeakPtr())); | 154 weak_ptr_factory_.GetWeakPtr())); |
155 | 155 |
156 real_gl_->SetErrorMessageCallback(getErrorMessageCallback()); | 156 real_gl_->SetErrorMessageCallback(getErrorMessageCallback()); |
157 real_gl_->TraceBeginCHROMIUM("WebGraphicsContext3D", | |
no sievers
2015/12/08 22:17:42
and this doesn't need 'end'?
David Yen
2015/12/08 22:20:40
It automatically ends when the context is destroye
| |
158 "CommandBufferContext"); | |
157 | 159 |
158 visible_ = true; | 160 visible_ = true; |
159 initialized_ = true; | 161 initialized_ = true; |
160 return true; | 162 return true; |
161 } | 163 } |
162 | 164 |
163 bool WebGraphicsContext3DCommandBufferImpl::InitializeCommandBuffer( | 165 bool WebGraphicsContext3DCommandBufferImpl::InitializeCommandBuffer( |
164 bool onscreen, WebGraphicsContext3DCommandBufferImpl* share_context) { | 166 bool onscreen, WebGraphicsContext3DCommandBufferImpl* share_context) { |
165 if (!host_.get()) | 167 if (!host_.get()) |
166 return false; | 168 return false; |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
366 { | 368 { |
367 base::AutoLock lock(g_default_share_groups_lock.Get()); | 369 base::AutoLock lock(g_default_share_groups_lock.Get()); |
368 g_default_share_groups.Get().erase(host_.get()); | 370 g_default_share_groups.Get().erase(host_.get()); |
369 } | 371 } |
370 | 372 |
371 gpu::CommandBuffer::State state = command_buffer_->GetLastState(); | 373 gpu::CommandBuffer::State state = command_buffer_->GetLastState(); |
372 UmaRecordContextLost(context_type_, state.error, state.context_lost_reason); | 374 UmaRecordContextLost(context_type_, state.error, state.context_lost_reason); |
373 } | 375 } |
374 | 376 |
375 } // namespace content | 377 } // namespace content |
OLD | NEW |