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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 | 474 |
475 if (command_buffer_) { | 475 if (command_buffer_) { |
476 if (host_.get()) | 476 if (host_.get()) |
477 host_->DestroyCommandBuffer(command_buffer_.release()); | 477 host_->DestroyCommandBuffer(command_buffer_.release()); |
478 command_buffer_.reset(); | 478 command_buffer_.reset(); |
479 } | 479 } |
480 | 480 |
481 host_ = NULL; | 481 host_ = NULL; |
482 } | 482 } |
483 | 483 |
484 // TODO(apatrick,piman): This should be renamed to something clearer. | |
485 int WebGraphicsContext3DCommandBufferImpl::GetGPUProcessID() { | |
486 return host_.get() ? host_->gpu_host_id() : 0; | |
487 } | |
488 | |
489 gpu::ContextSupport* | 484 gpu::ContextSupport* |
490 WebGraphicsContext3DCommandBufferImpl::GetContextSupport() { | 485 WebGraphicsContext3DCommandBufferImpl::GetContextSupport() { |
491 return real_gl_.get(); | 486 return real_gl_.get(); |
492 } | 487 } |
493 | 488 |
494 void WebGraphicsContext3DCommandBufferImpl::prepareTexture() { | 489 void WebGraphicsContext3DCommandBufferImpl::prepareTexture() { |
495 TRACE_EVENT1("gpu", | 490 TRACE_EVENT1("gpu", |
496 "WebGraphicsContext3DCommandBufferImpl::SwapBuffers", | 491 "WebGraphicsContext3DCommandBufferImpl::SwapBuffers", |
497 "frame", frame_number_); | 492 "frame", frame_number_); |
498 frame_number_++; | 493 frame_number_++; |
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1423 | 1418 |
1424 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( | 1419 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( |
1425 const std::string& message, int id) { | 1420 const std::string& message, int id) { |
1426 if (error_message_callback_) { | 1421 if (error_message_callback_) { |
1427 blink::WebString str = blink::WebString::fromUTF8(message.c_str()); | 1422 blink::WebString str = blink::WebString::fromUTF8(message.c_str()); |
1428 error_message_callback_->onErrorMessage(str, id); | 1423 error_message_callback_->onErrorMessage(str, id); |
1429 } | 1424 } |
1430 } | 1425 } |
1431 | 1426 |
1432 } // namespace content | 1427 } // namespace content |
OLD | NEW |