| 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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 bool visible) { | 449 bool visible) { |
| 450 gl_->Flush(); | 450 gl_->Flush(); |
| 451 visible_ = visible; | 451 visible_ = visible; |
| 452 context_->SetSurfaceVisible(visible); | 452 context_->SetSurfaceVisible(visible); |
| 453 if (!visible) | 453 if (!visible) |
| 454 gl_->FreeEverything(); | 454 gl_->FreeEverything(); |
| 455 } | 455 } |
| 456 | 456 |
| 457 void WebGraphicsContext3DCommandBufferImpl::discardFramebufferEXT( | 457 void WebGraphicsContext3DCommandBufferImpl::discardFramebufferEXT( |
| 458 WGC3Denum target, WGC3Dsizei numAttachments, const WGC3Denum* attachments) { | 458 WGC3Denum target, WGC3Dsizei numAttachments, const WGC3Denum* attachments) { |
| 459 gl_->Flush(); | 459 gl_->DiscardBackbufferCHROMIUM(); |
| 460 context_->DiscardBackbuffer(); | |
| 461 } | 460 } |
| 462 | 461 |
| 463 void WebGraphicsContext3DCommandBufferImpl::ensureFramebufferCHROMIUM() { | 462 void WebGraphicsContext3DCommandBufferImpl::ensureFramebufferCHROMIUM() { |
| 464 gl_->Flush(); | 463 gl_->EnsureBackbufferCHROMIUM(); |
| 465 context_->EnsureBackbuffer(); | |
| 466 } | 464 } |
| 467 | 465 |
| 468 void WebGraphicsContext3DCommandBufferImpl:: | 466 void WebGraphicsContext3DCommandBufferImpl:: |
| 469 setMemoryAllocationChangedCallbackCHROMIUM( | 467 setMemoryAllocationChangedCallbackCHROMIUM( |
| 470 WebGraphicsMemoryAllocationChangedCallbackCHROMIUM* callback) { | 468 WebGraphicsMemoryAllocationChangedCallbackCHROMIUM* callback) { |
| 471 memory_allocation_changed_callback_ = callback; | 469 memory_allocation_changed_callback_ = callback; |
| 472 } | 470 } |
| 473 | 471 |
| 474 | 472 |
| 475 void WebGraphicsContext3DCommandBufferImpl::copyTextureToParentTextureCHROMIUM( | 473 void WebGraphicsContext3DCommandBufferImpl::copyTextureToParentTextureCHROMIUM( |
| (...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1262 swap_client_->OnViewContextSwapBuffersAborted(); | 1260 swap_client_->OnViewContextSwapBuffersAborted(); |
| 1263 } | 1261 } |
| 1264 | 1262 |
| 1265 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( | 1263 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( |
| 1266 const std::string& message, int id) { | 1264 const std::string& message, int id) { |
| 1267 if (error_message_callback_) { | 1265 if (error_message_callback_) { |
| 1268 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); | 1266 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); |
| 1269 error_message_callback_->onErrorMessage(str, id); | 1267 error_message_callback_->onErrorMessage(str, id); |
| 1270 } | 1268 } |
| 1271 } | 1269 } |
| 1272 | |
| OLD | NEW |