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

Unified Diff: content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc

Issue 9617038: Fix mismanagement in handling of temporary scanline for vertical flip. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address apatrick's review feedback. Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
index 3e8ba28ad74009cf01c42cbc9c4e9c268a5f2f31..ea5f90d78151db78e0026a1ef679b03d66b1bf18 100644
--- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
+++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
@@ -313,10 +313,6 @@ void WebGraphicsContext3DCommandBufferImpl::reshape(int width, int height) {
cached_height_ = height;
gl_->ResizeCHROMIUM(width, height);
-
-#ifdef FLIP_FRAMEBUFFER_VERTICALLY
- scanline_.reset(new uint8[width * 4]);
-#endif // FLIP_FRAMEBUFFER_VERTICALLY
}
#ifdef FLIP_FRAMEBUFFER_VERTICALLY
@@ -324,9 +320,10 @@ void WebGraphicsContext3DCommandBufferImpl::FlipVertically(
uint8* framebuffer,
unsigned int width,
unsigned int height) {
- uint8* scanline = scanline_.get();
- if (!scanline)
+ if (width == 0)
return;
+ scanline_.resize(width * 4);
+ uint8* scanline = &scanline_[0];
unsigned int row_bytes = width * 4;
unsigned int count = height / 2;
for (unsigned int i = 0; i < count; i++) {
« no previous file with comments | « content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698