diff options
author | kbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-13 02:03:06 +0000 |
---|---|---|
committer | kbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-13 02:03:06 +0000 |
commit | e4b1429ff7f4ec1d9b100482df6970689aa25a31 (patch) | |
tree | 5db93c27dc00c43483685a54b0feb25c0638facb /webkit | |
parent | bf5b3a03c2e353721a629a4fde119d1e1fdc8484 (diff) | |
download | chromium_src-e4b1429ff7f4ec1d9b100482df6970689aa25a31.zip chromium_src-e4b1429ff7f4ec1d9b100482df6970689aa25a31.tar.gz chromium_src-e4b1429ff7f4ec1d9b100482df6970689aa25a31.tar.bz2 |
Fixed bug in allocation of temporary scanline during frame buffer readback.
BUG=174921
Review URL: https://chromiumcodereview.appspot.com/12250017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182088 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc | 9 | ||||
-rw-r--r-- | webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h | 2 |
2 files changed, 4 insertions, 7 deletions
diff --git a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc index 42ada0c..e3a8400 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++) { diff --git a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h index ba7f44a..5125b29 100644 --- a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h +++ b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h @@ -533,7 +533,7 @@ class WEBKIT_GPU_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl std::vector<WGC3Denum> synthetic_errors_; #ifdef FLIP_FRAMEBUFFER_VERTICALLY - scoped_array<uint8> scanline_; + std::vector<uint8> scanline_; void FlipVertically(uint8* framebuffer, unsigned int width, unsigned int height); |