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