Index: webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc |
diff --git a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc |
index 42ada0cd3511f8975ac2c2158a9c033eb99ebe0d..e3a8400bf70c0f7e734919f164d263b85f3eef60 100644 |
--- a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc |
+++ b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc |
@@ -706,10 +706,6 @@ void WebGraphicsContext3DInProcessCommandBufferImpl::reshape( |
// ClearContext(); |
gl_->ResizeCHROMIUM(width, height); |
- |
-#ifdef FLIP_FRAMEBUFFER_VERTICALLY |
- scanline_.reset(new uint8[width * 4]); |
-#endif // FLIP_FRAMEBUFFER_VERTICALLY |
} |
WebGLId WebGraphicsContext3DInProcessCommandBufferImpl::createCompositorTexture( |
@@ -731,9 +727,10 @@ void WebGraphicsContext3DInProcessCommandBufferImpl::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++) { |