| 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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 return true; | 419 return true; |
| 420 } | 420 } |
| 421 | 421 |
| 422 bool WebGraphicsContext3DCommandBufferImpl::setParentContext( | 422 bool WebGraphicsContext3DCommandBufferImpl::setParentContext( |
| 423 WebGraphicsContext3D* parent_context) { | 423 WebGraphicsContext3D* parent_context) { |
| 424 WebGraphicsContext3DCommandBufferImpl* parent_context_impl = | 424 WebGraphicsContext3DCommandBufferImpl* parent_context_impl = |
| 425 static_cast<WebGraphicsContext3DCommandBufferImpl*>(parent_context); | 425 static_cast<WebGraphicsContext3DCommandBufferImpl*>(parent_context); |
| 426 return SetParent(parent_context_impl); | 426 return SetParent(parent_context_impl); |
| 427 } | 427 } |
| 428 | 428 |
| 429 unsigned int WebGraphicsContext3DCommandBufferImpl::insertSyncPoint() { |
| 430 gl_->helper()->CommandBufferHelper::Flush(); |
| 431 return command_buffer_->InsertSyncPoint(); |
| 432 } |
| 433 |
| 434 void WebGraphicsContext3DCommandBufferImpl::waitSyncPoint( |
| 435 unsigned int sync_point) { |
| 436 gl_->helper()->CommandBufferHelper::Flush(); |
| 437 command_buffer_->WaitSyncPoint(sync_point); |
| 438 } |
| 439 |
| 429 bool WebGraphicsContext3DCommandBufferImpl::SetParent( | 440 bool WebGraphicsContext3DCommandBufferImpl::SetParent( |
| 430 WebGraphicsContext3DCommandBufferImpl* new_parent) { | 441 WebGraphicsContext3DCommandBufferImpl* new_parent) { |
| 431 if (parent_ == new_parent) | 442 if (parent_ == new_parent) |
| 432 return true; | 443 return true; |
| 433 | 444 |
| 434 // Allocate a texture ID with respect to the parent and change the parent. | 445 // Allocate a texture ID with respect to the parent and change the parent. |
| 435 uint32 new_parent_texture_id = 0; | 446 uint32 new_parent_texture_id = 0; |
| 436 if (command_buffer_) { | 447 if (command_buffer_) { |
| 437 if (new_parent) { | 448 if (new_parent) { |
| 438 // Flush any remaining commands in the parent context to make sure the | 449 // Flush any remaining commands in the parent context to make sure the |
| (...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1546 swap_client_->OnViewContextSwapBuffersAborted(); | 1557 swap_client_->OnViewContextSwapBuffersAborted(); |
| 1547 } | 1558 } |
| 1548 | 1559 |
| 1549 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( | 1560 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( |
| 1550 const std::string& message, int id) { | 1561 const std::string& message, int id) { |
| 1551 if (error_message_callback_) { | 1562 if (error_message_callback_) { |
| 1552 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); | 1563 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); |
| 1553 error_message_callback_->onErrorMessage(str, id); | 1564 error_message_callback_->onErrorMessage(str, id); |
| 1554 } | 1565 } |
| 1555 } | 1566 } |
| OLD | NEW |