| 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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 | 451 |
| 452 void WebGraphicsContext3DCommandBufferImpl::setVisibilityCHROMIUM( | 452 void WebGraphicsContext3DCommandBufferImpl::setVisibilityCHROMIUM( |
| 453 bool visible) { | 453 bool visible) { |
| 454 gl_->Flush(); | 454 gl_->Flush(); |
| 455 visible_ = visible; | 455 visible_ = visible; |
| 456 context_->SetSurfaceVisible(visible); | 456 context_->SetSurfaceVisible(visible); |
| 457 if (!visible) | 457 if (!visible) |
| 458 gl_->FreeEverything(); | 458 gl_->FreeEverything(); |
| 459 } | 459 } |
| 460 | 460 |
| 461 void WebGraphicsContext3DCommandBufferImpl::discardFramebufferEXT( |
| 462 WGC3Denum target, WGC3Dsizei numAttachments, const WGC3Denum* attachments) { |
| 463 gl_->Flush(); |
| 464 context_->DiscardBackbuffer(); |
| 465 } |
| 466 |
| 467 void WebGraphicsContext3DCommandBufferImpl::ensureFramebufferCHROMIUM() { |
| 468 gl_->Flush(); |
| 469 context_->EnsureBackbuffer(); |
| 470 } |
| 471 |
| 461 void WebGraphicsContext3DCommandBufferImpl:: | 472 void WebGraphicsContext3DCommandBufferImpl:: |
| 462 setMemoryAllocationChangedCallbackCHROMIUM( | 473 setMemoryAllocationChangedCallbackCHROMIUM( |
| 463 WebGraphicsMemoryAllocationChangedCallbackCHROMIUM* callback) { | 474 WebGraphicsMemoryAllocationChangedCallbackCHROMIUM* callback) { |
| 464 memory_allocation_changed_callback_ = callback; | 475 memory_allocation_changed_callback_ = callback; |
| 465 } | 476 } |
| 466 | 477 |
| 467 | 478 |
| 468 void WebGraphicsContext3DCommandBufferImpl::copyTextureToParentTextureCHROMIUM( | 479 void WebGraphicsContext3DCommandBufferImpl::copyTextureToParentTextureCHROMIUM( |
| 469 WebGLId texture, WebGLId parentTexture) { | 480 WebGLId texture, WebGLId parentTexture) { |
| 470 NOTIMPLEMENTED(); | 481 NOTIMPLEMENTED(); |
| (...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1256 } | 1267 } |
| 1257 | 1268 |
| 1258 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( | 1269 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( |
| 1259 const std::string& message, int id) { | 1270 const std::string& message, int id) { |
| 1260 if (error_message_callback_) { | 1271 if (error_message_callback_) { |
| 1261 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); | 1272 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); |
| 1262 error_message_callback_->onErrorMessage(str, id); | 1273 error_message_callback_->onErrorMessage(str, id); |
| 1263 } | 1274 } |
| 1264 } | 1275 } |
| 1265 | 1276 |
| OLD | NEW |