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

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

Issue 7890046: Command to mark surface inactive, so gpu process can release resources. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Flush only on hide Created 9 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "gpu/GLES2/gl2.h" 9 #include "gpu/GLES2/gl2.h"
10 #ifndef GL_GLEXT_PROTOTYPES 10 #ifndef GL_GLEXT_PROTOTYPES
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 cached_width_ = width; 265 cached_width_ = width;
266 cached_height_ = height; 266 cached_height_ = height;
267 267
268 gl_->ResizeCHROMIUM(width, height); 268 gl_->ResizeCHROMIUM(width, height);
269 269
270 #ifdef FLIP_FRAMEBUFFER_VERTICALLY 270 #ifdef FLIP_FRAMEBUFFER_VERTICALLY
271 scanline_.reset(new uint8[width * 4]); 271 scanline_.reset(new uint8[width * 4]);
272 #endif // FLIP_FRAMEBUFFER_VERTICALLY 272 #endif // FLIP_FRAMEBUFFER_VERTICALLY
273 } 273 }
274 274
275 void WebGraphicsContext3DCommandBufferImpl::setVisibility(bool visible) {
276 gl_->SetSurfaceVisibleCHROMIUM(visible);
277 if (!visible)
278 gl_->helper()->CommandBufferHelper::Flush();
279 }
280
275 #ifdef FLIP_FRAMEBUFFER_VERTICALLY 281 #ifdef FLIP_FRAMEBUFFER_VERTICALLY
276 void WebGraphicsContext3DCommandBufferImpl::FlipVertically( 282 void WebGraphicsContext3DCommandBufferImpl::FlipVertically(
277 uint8* framebuffer, 283 uint8* framebuffer,
278 unsigned int width, 284 unsigned int width,
279 unsigned int height) { 285 unsigned int height) {
280 uint8* scanline = scanline_.get(); 286 uint8* scanline = scanline_.get();
281 if (!scanline) 287 if (!scanline)
282 return; 288 return;
283 unsigned int row_bytes = width * 4; 289 unsigned int row_bytes = width * 4;
284 unsigned int count = height / 2; 290 unsigned int count = height / 2;
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 } 1096 }
1091 #ifndef WTF_USE_THREADED_COMPOSITING 1097 #ifndef WTF_USE_THREADED_COMPOSITING
1092 RenderView* renderview = 1098 RenderView* renderview =
1093 web_view_ ? RenderView::FromWebView(web_view_) : NULL; 1099 web_view_ ? RenderView::FromWebView(web_view_) : NULL;
1094 if (renderview) 1100 if (renderview)
1095 renderview->OnViewContextSwapBuffersAborted(); 1101 renderview->OnViewContextSwapBuffersAborted();
1096 #endif 1102 #endif
1097 } 1103 }
1098 1104
1099 #endif // defined(ENABLE_GPU) 1105 #endif // defined(ENABLE_GPU)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698