diff options
author | John Reck <jreck@google.com> | 2010-11-04 12:00:17 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2010-11-09 11:35:04 -0800 |
commit | e14391e94c850b8bd03680c23b38978db68687a8 (patch) | |
tree | 3fed87e6620fecaf3edc7259ae58a11662bedcb2 /WebCore/platform/image-decoders/ImageDecoder.cpp | |
parent | 1bd705833a68f07850cf7e204b26f8d328d16951 (diff) | |
download | external_webkit-e14391e94c850b8bd03680c23b38978db68687a8.zip external_webkit-e14391e94c850b8bd03680c23b38978db68687a8.tar.gz external_webkit-e14391e94c850b8bd03680c23b38978db68687a8.tar.bz2 |
Merge Webkit at r70949: Initial merge by git.
Change-Id: I77b8645c083b5d0da8dba73ed01d4014aab9848e
Diffstat (limited to 'WebCore/platform/image-decoders/ImageDecoder.cpp')
-rw-r--r-- | WebCore/platform/image-decoders/ImageDecoder.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
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; |