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

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: updating with recent changes 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 cached_width_ = width; 268 cached_width_ = width;
269 cached_height_ = height; 269 cached_height_ = height;
270 270
271 gl_->ResizeCHROMIUM(width, height); 271 gl_->ResizeCHROMIUM(width, height);
272 272
273 #ifdef FLIP_FRAMEBUFFER_VERTICALLY 273 #ifdef FLIP_FRAMEBUFFER_VERTICALLY
274 scanline_.reset(new uint8[width * 4]); 274 scanline_.reset(new uint8[width * 4]);
275 #endif // FLIP_FRAMEBUFFER_VERTICALLY 275 #endif // FLIP_FRAMEBUFFER_VERTICALLY
276 } 276 }
277 277
278 void WebGraphicsContext3DCommandBufferImpl::setVisibility(bool visible) {
279 printf("\nVisibility Changed: %s\n", visible ? "true" : "false");
280 fflush(stdout);
281 gl_->SetSurfaceVisibleCHROMIUM(visible);
282 gl_->Flush();
jonathan.backer 2011/09/27 16:53:14 Don't think that the flush is necessary if you're
mmocny 2011/09/28 21:37:33 See discussion in other comment. On 2011/09/27 16
283 }
284
278 #ifdef FLIP_FRAMEBUFFER_VERTICALLY 285 #ifdef FLIP_FRAMEBUFFER_VERTICALLY
279 void WebGraphicsContext3DCommandBufferImpl::FlipVertically( 286 void WebGraphicsContext3DCommandBufferImpl::FlipVertically(
280 uint8* framebuffer, 287 uint8* framebuffer,
281 unsigned int width, 288 unsigned int width,
282 unsigned int height) { 289 unsigned int height) {
283 uint8* scanline = scanline_.get(); 290 uint8* scanline = scanline_.get();
284 if (!scanline) 291 if (!scanline)
285 return; 292 return;
286 unsigned int row_bytes = width * 4; 293 unsigned int row_bytes = width * 4;
287 unsigned int count = height / 2; 294 unsigned int count = height / 2;
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 } 1100 }
1094 #ifndef WTF_USE_THREADED_COMPOSITING 1101 #ifndef WTF_USE_THREADED_COMPOSITING
1095 RenderView* renderview = 1102 RenderView* renderview =
1096 web_view_ ? RenderView::FromWebView(web_view_) : NULL; 1103 web_view_ ? RenderView::FromWebView(web_view_) : NULL;
1097 if (renderview) 1104 if (renderview)
1098 renderview->OnViewContextSwapBuffersAborted(); 1105 renderview->OnViewContextSwapBuffersAborted();
1099 #endif 1106 #endif
1100 } 1107 }
1101 1108
1102 #endif // defined(ENABLE_GPU) 1109 #endif // defined(ENABLE_GPU)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698