From e14391e94c850b8bd03680c23b38978db68687a8 Mon Sep 17 00:00:00 2001 From: John Reck Date: Thu, 4 Nov 2010 12:00:17 -0700 Subject: Merge Webkit at r70949: Initial merge by git. Change-Id: I77b8645c083b5d0da8dba73ed01d4014aab9848e --- WebCore/platform/image-decoders/ImageDecoder.cpp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'WebCore/platform/image-decoders/ImageDecoder.cpp') diff --git a/WebCore/platform/image-decoders/ImageDecoder.cpp b/WebCore/platform/image-decoders/ImageDecoder.cpp index 10c0b3b..fa61871 100644 --- a/WebCore/platform/image-decoders/ImageDecoder.cpp +++ b/WebCore/platform/image-decoders/ImageDecoder.cpp @@ -122,7 +122,7 @@ RGBA32Buffer& RGBA32Buffer::operator=(const RGBA32Buffer& other) if (this == &other) return *this; - copyBitmapData(other); + copyReferenceToBitmapData(other); setRect(other.rect()); setStatus(other.status()); setDuration(other.duration()); @@ -133,7 +133,8 @@ RGBA32Buffer& RGBA32Buffer::operator=(const RGBA32Buffer& other) void RGBA32Buffer::clear() { - m_bytes.clear(); + m_backingStore.clear(); + m_bytes = 0; m_status = FrameEmpty; // NOTE: Do not reset other members here; clearFrameBufferCache() calls this // to free the bitmap data, but other functions like initFrameBuffer() and @@ -143,16 +144,25 @@ void RGBA32Buffer::clear() void RGBA32Buffer::zeroFill() { - m_bytes.fill(0); + memset(m_bytes, 0, m_size.width() * m_size.height() * sizeof(PixelData)); m_hasAlpha = true; } +#if !PLATFORM(CF) + +void RGBA32Buffer::copyReferenceToBitmapData(const RGBA32Buffer& other) +{ + ASSERT(this != &other); + copyBitmapData(other); +} + bool RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other) { if (this == &other) return true; - m_bytes = other.m_bytes; + m_backingStore = other.m_backingStore; + m_bytes = m_backingStore.data(); m_size = other.m_size; setHasAlpha(other.m_hasAlpha); return true; @@ -162,7 +172,8 @@ bool RGBA32Buffer::setSize(int newWidth, int newHeight) { // NOTE: This has no way to check for allocation failure if the requested // size was too big... - m_bytes.resize(newWidth * newHeight); + m_backingStore.resize(newWidth * newHeight); + m_bytes = m_backingStore.data(); m_size = IntSize(newWidth, newHeight); // Zero the image. @@ -171,6 +182,8 @@ bool RGBA32Buffer::setSize(int newWidth, int newHeight) return true; } +#endif + bool RGBA32Buffer::hasAlpha() const { return m_hasAlpha; -- cgit v1.1