| 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 #if defined(ENABLE_GPU) | 5 #if defined(ENABLE_GPU) |
| 6 | 6 |
| 7 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" | 7 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" |
| 8 | 8 |
| 9 #include "third_party/khronos/GLES2/gl2.h" | 9 #include "third_party/khronos/GLES2/gl2.h" |
| 10 #ifndef GL_GLEXT_PROTOTYPES | 10 #ifndef GL_GLEXT_PROTOTYPES |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 WGC3Denum access) { | 443 WGC3Denum access) { |
| 444 return gl_->MapTexSubImage2DCHROMIUM( | 444 return gl_->MapTexSubImage2DCHROMIUM( |
| 445 target, level, xoffset, yoffset, width, height, format, type, access); | 445 target, level, xoffset, yoffset, width, height, format, type, access); |
| 446 } | 446 } |
| 447 | 447 |
| 448 void WebGraphicsContext3DCommandBufferImpl::unmapTexSubImage2DCHROMIUM( | 448 void WebGraphicsContext3DCommandBufferImpl::unmapTexSubImage2DCHROMIUM( |
| 449 const void* mem) { | 449 const void* mem) { |
| 450 gl_->UnmapTexSubImage2DCHROMIUM(mem); | 450 gl_->UnmapTexSubImage2DCHROMIUM(mem); |
| 451 } | 451 } |
| 452 | 452 |
| 453 void WebGraphicsContext3DCommandBufferImpl::setVisibilityCHROMIUM( | 453 void WebGraphicsContext3DCommandBufferImpl::setResourceUsageCHROMIUM( |
| 454 bool visible) { | 454 ResourceUsage resourceUsage) { |
| 455 gl_->Flush(); | 455 gl_->Flush(); |
| 456 context_->SetSurfaceVisible(visible); | 456 switch (resourceUsage) { |
| 457 if (!visible) | 457 case RESOURCE_USAGE_FULL: |
| 458 gl_->FreeEverything(); | 458 context_->SetResourceUsage(gfx::GLSurface::RESOURCE_USAGE_FULL); |
| 459 break; |
| 460 case RESOURCE_USAGE_LESS: |
| 461 context_->SetResourceUsage(gfx::GLSurface::RESOURCE_USAGE_LESS); |
| 462 gl_->FreeEverything(); |
| 463 break; |
| 464 case RESOURCE_USAGE_NONE: |
| 465 context_->SetResourceUsage(gfx::GLSurface::RESOURCE_USAGE_NONE); |
| 466 break; |
| 467 } |
| 459 } | 468 } |
| 460 | 469 |
| 461 void WebGraphicsContext3DCommandBufferImpl::copyTextureToParentTextureCHROMIUM( | 470 void WebGraphicsContext3DCommandBufferImpl::copyTextureToParentTextureCHROMIUM( |
| 462 WebGLId texture, WebGLId parentTexture) { | 471 WebGLId texture, WebGLId parentTexture) { |
| 463 NOTIMPLEMENTED(); | 472 NOTIMPLEMENTED(); |
| 464 } | 473 } |
| 465 | 474 |
| 466 void WebGraphicsContext3DCommandBufferImpl:: | 475 void WebGraphicsContext3DCommandBufferImpl:: |
| 467 rateLimitOffscreenContextCHROMIUM() { | 476 rateLimitOffscreenContextCHROMIUM() { |
| 468 gl_->RateLimitOffscreenContextCHROMIUM(); | 477 gl_->RateLimitOffscreenContextCHROMIUM(); |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1199 } | 1208 } |
| 1200 if (attributes_.shareResources) | 1209 if (attributes_.shareResources) |
| 1201 ClearSharedContexts(); | 1210 ClearSharedContexts(); |
| 1202 RenderViewImpl* renderview = | 1211 RenderViewImpl* renderview = |
| 1203 web_view_ ? RenderViewImpl::FromWebView(web_view_) : NULL; | 1212 web_view_ ? RenderViewImpl::FromWebView(web_view_) : NULL; |
| 1204 if (renderview) | 1213 if (renderview) |
| 1205 renderview->OnViewContextSwapBuffersAborted(); | 1214 renderview->OnViewContextSwapBuffersAborted(); |
| 1206 } | 1215 } |
| 1207 | 1216 |
| 1208 #endif // defined(ENABLE_GPU) | 1217 #endif // defined(ENABLE_GPU) |
| OLD | NEW |