| 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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 } | 399 } |
| 400 | 400 |
| 401 int WebGraphicsContext3DCommandBufferImpl::width() { | 401 int WebGraphicsContext3DCommandBufferImpl::width() { |
| 402 return cached_width_; | 402 return cached_width_; |
| 403 } | 403 } |
| 404 | 404 |
| 405 int WebGraphicsContext3DCommandBufferImpl::height() { | 405 int WebGraphicsContext3DCommandBufferImpl::height() { |
| 406 return cached_height_; | 406 return cached_height_; |
| 407 } | 407 } |
| 408 | 408 |
| 409 bool WebGraphicsContext3DCommandBufferImpl::isGLES2Compliant() { | |
| 410 return true; | |
| 411 } | |
| 412 | |
| 413 bool WebGraphicsContext3DCommandBufferImpl::setParentContext( | 409 bool WebGraphicsContext3DCommandBufferImpl::setParentContext( |
| 414 WebGraphicsContext3D* parent_context) { | 410 WebGraphicsContext3D* parent_context) { |
| 415 WebGraphicsContext3DCommandBufferImpl* parent_context_impl = | 411 WebGraphicsContext3DCommandBufferImpl* parent_context_impl = |
| 416 static_cast<WebGraphicsContext3DCommandBufferImpl*>(parent_context); | 412 static_cast<WebGraphicsContext3DCommandBufferImpl*>(parent_context); |
| 417 return SetParent(parent_context_impl); | 413 return SetParent(parent_context_impl); |
| 418 } | 414 } |
| 419 | 415 |
| 420 unsigned int WebGraphicsContext3DCommandBufferImpl::insertSyncPoint() { | 416 unsigned int WebGraphicsContext3DCommandBufferImpl::insertSyncPoint() { |
| 421 return gl_->InsertSyncPointCHROMIUM(); | 417 return gl_->InsertSyncPointCHROMIUM(); |
| 422 } | 418 } |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 } | 513 } |
| 518 | 514 |
| 519 int WebGraphicsContext3DCommandBufferImpl::GetChannelID() { | 515 int WebGraphicsContext3DCommandBufferImpl::GetChannelID() { |
| 520 return host_ ? host_->client_id() : 0; | 516 return host_ ? host_->client_id() : 0; |
| 521 } | 517 } |
| 522 | 518 |
| 523 int WebGraphicsContext3DCommandBufferImpl::GetContextID() { | 519 int WebGraphicsContext3DCommandBufferImpl::GetContextID() { |
| 524 return command_buffer_->GetRouteID(); | 520 return command_buffer_->GetRouteID(); |
| 525 } | 521 } |
| 526 | 522 |
| 527 WebGLId WebGraphicsContext3DCommandBufferImpl::getPlatformTextureId() { | |
| 528 return parent_texture_id_; | |
| 529 } | |
| 530 | |
| 531 void WebGraphicsContext3DCommandBufferImpl::prepareTexture() { | 523 void WebGraphicsContext3DCommandBufferImpl::prepareTexture() { |
| 532 TRACE_EVENT1("gpu", | 524 TRACE_EVENT1("gpu", |
| 533 "WebGraphicsContext3DCommandBufferImpl::SwapBuffers", | 525 "WebGraphicsContext3DCommandBufferImpl::SwapBuffers", |
| 534 "frame", frame_number_); | 526 "frame", frame_number_); |
| 535 frame_number_++; | 527 frame_number_++; |
| 536 // Copies the contents of the off-screen render target into the texture | 528 // Copies the contents of the off-screen render target into the texture |
| 537 // used by the compositor. | 529 // used by the compositor. |
| 538 if (ShouldUseSwapClient()) | 530 if (ShouldUseSwapClient()) |
| 539 swap_client_->OnViewContextSwapBuffersPosted(); | 531 swap_client_->OnViewContextSwapBuffersPosted(); |
| 540 | 532 |
| (...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1739 | 1731 |
| 1740 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( | 1732 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( |
| 1741 const std::string& message, int id) { | 1733 const std::string& message, int id) { |
| 1742 if (error_message_callback_) { | 1734 if (error_message_callback_) { |
| 1743 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); | 1735 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); |
| 1744 error_message_callback_->onErrorMessage(str, id); | 1736 error_message_callback_->onErrorMessage(str, id); |
| 1745 } | 1737 } |
| 1746 } | 1738 } |
| 1747 | 1739 |
| 1748 } // namespace content | 1740 } // namespace content |
| OLD | NEW |