Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc

Issue 9192014: Replace WGC3D visibility extension with resource_usage extension. [Part 2 of 3] (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Clarifying a comment Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698