Commit e4b1429f authored by kbr@chromium.org's avatar kbr@chromium.org

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
parent bf5b3a03
...@@ -706,10 +706,6 @@ void WebGraphicsContext3DInProcessCommandBufferImpl::reshape( ...@@ -706,10 +706,6 @@ void WebGraphicsContext3DInProcessCommandBufferImpl::reshape(
// ClearContext(); // ClearContext();
gl_->ResizeCHROMIUM(width, height); gl_->ResizeCHROMIUM(width, height);
#ifdef FLIP_FRAMEBUFFER_VERTICALLY
scanline_.reset(new uint8[width * 4]);
#endif // FLIP_FRAMEBUFFER_VERTICALLY
} }
WebGLId WebGraphicsContext3DInProcessCommandBufferImpl::createCompositorTexture( WebGLId WebGraphicsContext3DInProcessCommandBufferImpl::createCompositorTexture(
...@@ -731,9 +727,10 @@ void WebGraphicsContext3DInProcessCommandBufferImpl::FlipVertically( ...@@ -731,9 +727,10 @@ void WebGraphicsContext3DInProcessCommandBufferImpl::FlipVertically(
uint8* framebuffer, uint8* framebuffer,
unsigned int width, unsigned int width,
unsigned int height) { unsigned int height) {
uint8* scanline = scanline_.get(); if (width == 0)
if (!scanline)
return; return;
scanline_.resize(width * 4);
uint8* scanline = &scanline_[0];
unsigned int row_bytes = width * 4; unsigned int row_bytes = width * 4;
unsigned int count = height / 2; unsigned int count = height / 2;
for (unsigned int i = 0; i < count; i++) { for (unsigned int i = 0; i < count; i++) {
......
...@@ -533,7 +533,7 @@ class WEBKIT_GPU_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl ...@@ -533,7 +533,7 @@ class WEBKIT_GPU_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl
std::vector<WGC3Denum> synthetic_errors_; std::vector<WGC3Denum> synthetic_errors_;
#ifdef FLIP_FRAMEBUFFER_VERTICALLY #ifdef FLIP_FRAMEBUFFER_VERTICALLY
scoped_array<uint8> scanline_; std::vector<uint8> scanline_;
void FlipVertically(uint8* framebuffer, void FlipVertically(uint8* framebuffer,
unsigned int width, unsigned int width,
unsigned int height); unsigned int height);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment