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

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: Added image_transport_surface_win changes 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 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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)
OLDNEW
« no previous file with comments | « content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h ('k') | ui/gfx/compositor/test_web_graphics_context_3d.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698