Index: content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc |
=================================================================== |
--- content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc (revision 127751) |
+++ content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc (working copy) |
@@ -323,10 +323,6 @@ |
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 |
@@ -334,9 +330,10 @@ |
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++) { |