summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/image-decoders
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-13 16:23:25 +0100
committerBen Murdoch <benm@google.com>2011-05-16 11:35:02 +0100
commit65f03d4f644ce73618e5f4f50dd694b26f55ae12 (patch)
treef478babb801e720de7bfaee23443ffe029f58731 /Source/WebCore/platform/image-decoders
parent47de4a2fb7262c7ebdb9cd133ad2c54c187454d0 (diff)
downloadexternal_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.zip
external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.tar.gz
external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.tar.bz2
Merge WebKit at r75993: Initial merge by git.
Change-Id: I602bbdc3974787a3b0450456a30a7868286921c3
Diffstat (limited to 'Source/WebCore/platform/image-decoders')
-rw-r--r--Source/WebCore/platform/image-decoders/ImageDecoder.cpp26
-rw-r--r--Source/WebCore/platform/image-decoders/ImageDecoder.h20
-rw-r--r--Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp8
-rw-r--r--Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.h2
-rw-r--r--Source/WebCore/platform/image-decoders/bmp/BMPImageReader.cpp6
-rw-r--r--Source/WebCore/platform/image-decoders/bmp/BMPImageReader.h6
-rw-r--r--Source/WebCore/platform/image-decoders/cairo/ImageDecoderCairo.cpp2
-rw-r--r--Source/WebCore/platform/image-decoders/cg/ImageDecoderCG.cpp14
-rw-r--r--Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp52
-rw-r--r--Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.h4
-rw-r--r--Source/WebCore/platform/image-decoders/gif/GIFImageReader.cpp4
-rw-r--r--Source/WebCore/platform/image-decoders/gif/GIFImageReader.h4
-rw-r--r--Source/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp2
-rw-r--r--Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp8
-rw-r--r--Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h2
-rw-r--r--Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp16
-rw-r--r--Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h2
-rw-r--r--Source/WebCore/platform/image-decoders/openvg/ImageDecoderOpenVG.cpp2
-rw-r--r--Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp14
-rw-r--r--Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h4
-rw-r--r--Source/WebCore/platform/image-decoders/qt/ImageFrameQt.cpp (renamed from Source/WebCore/platform/image-decoders/qt/RGBA32BufferQt.cpp)28
-rw-r--r--Source/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp26
-rw-r--r--Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp12
-rw-r--r--Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h2
-rw-r--r--Source/WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp2
25 files changed, 134 insertions, 134 deletions
diff --git a/Source/WebCore/platform/image-decoders/ImageDecoder.cpp b/Source/WebCore/platform/image-decoders/ImageDecoder.cpp
index 8491da9..17208b5 100644
--- a/Source/WebCore/platform/image-decoders/ImageDecoder.cpp
+++ b/Source/WebCore/platform/image-decoders/ImageDecoder.cpp
@@ -108,7 +108,7 @@ ImageDecoder* ImageDecoder::create(const SharedBuffer& data, ImageSource::AlphaO
#if !PLATFORM(SKIA)
-RGBA32Buffer::RGBA32Buffer()
+ImageFrame::ImageFrame()
: m_hasAlpha(false)
, m_status(FrameEmpty)
, m_duration(0)
@@ -117,7 +117,7 @@ RGBA32Buffer::RGBA32Buffer()
{
}
-RGBA32Buffer& RGBA32Buffer::operator=(const RGBA32Buffer& other)
+ImageFrame& ImageFrame::operator=(const ImageFrame& other)
{
if (this == &other)
return *this;
@@ -131,7 +131,7 @@ RGBA32Buffer& RGBA32Buffer::operator=(const RGBA32Buffer& other)
return *this;
}
-void RGBA32Buffer::clear()
+void ImageFrame::clear()
{
m_backingStore.clear();
m_bytes = 0;
@@ -142,7 +142,7 @@ void RGBA32Buffer::clear()
// later.
}
-void RGBA32Buffer::zeroFill()
+void ImageFrame::zeroFill()
{
memset(m_bytes, 0, m_size.width() * m_size.height() * sizeof(PixelData));
m_hasAlpha = true;
@@ -150,13 +150,13 @@ void RGBA32Buffer::zeroFill()
#if !PLATFORM(CG)
-void RGBA32Buffer::copyReferenceToBitmapData(const RGBA32Buffer& other)
+void ImageFrame::copyReferenceToBitmapData(const ImageFrame& other)
{
ASSERT(this != &other);
copyBitmapData(other);
}
-bool RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other)
+bool ImageFrame::copyBitmapData(const ImageFrame& other)
{
if (this == &other)
return true;
@@ -168,7 +168,7 @@ bool RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other)
return true;
}
-bool RGBA32Buffer::setSize(int newWidth, int newHeight)
+bool ImageFrame::setSize(int newWidth, int newHeight)
{
// NOTE: This has no way to check for allocation failure if the requested
// size was too big...
@@ -184,32 +184,32 @@ bool RGBA32Buffer::setSize(int newWidth, int newHeight)
#endif
-bool RGBA32Buffer::hasAlpha() const
+bool ImageFrame::hasAlpha() const
{
return m_hasAlpha;
}
-void RGBA32Buffer::setHasAlpha(bool alpha)
+void ImageFrame::setHasAlpha(bool alpha)
{
m_hasAlpha = alpha;
}
-void RGBA32Buffer::setColorProfile(const ColorProfile& colorProfile)
+void ImageFrame::setColorProfile(const ColorProfile& colorProfile)
{
m_colorProfile = colorProfile;
}
-void RGBA32Buffer::setStatus(FrameStatus status)
+void ImageFrame::setStatus(FrameStatus status)
{
m_status = status;
}
-int RGBA32Buffer::width() const
+int ImageFrame::width() const
{
return m_size.width();
}
-int RGBA32Buffer::height() const
+int ImageFrame::height() const
{
return m_size.height();
}
diff --git a/Source/WebCore/platform/image-decoders/ImageDecoder.h b/Source/WebCore/platform/image-decoders/ImageDecoder.h
index c3d73c0..13069de 100644
--- a/Source/WebCore/platform/image-decoders/ImageDecoder.h
+++ b/Source/WebCore/platform/image-decoders/ImageDecoder.h
@@ -50,10 +50,10 @@ namespace WebCore {
// FIXME: Do we want better encapsulation?
typedef Vector<char> ColorProfile;
- // The RGBA32Buffer object represents the decoded image data in RGBA32
+ // The ImageFrame object represents the decoded image data in RGBA32
// format. This buffer is what all decoders write a single frame into.
// Frames are then instantiated for drawing by being handed this buffer.
- class RGBA32Buffer {
+ class ImageFrame {
public:
enum FrameStatus { FrameEmpty, FramePartial, FrameComplete };
enum FrameDisposalMethod {
@@ -72,13 +72,13 @@ namespace WebCore {
typedef unsigned PixelData;
#endif
- RGBA32Buffer();
+ ImageFrame();
- RGBA32Buffer(const RGBA32Buffer& other) { operator=(other); }
+ ImageFrame(const ImageFrame& other) { operator=(other); }
// For backends which refcount their data, this operator doesn't need to
// create a new copy of the image data, only increase the ref count.
- RGBA32Buffer& operator=(const RGBA32Buffer& other);
+ ImageFrame& operator=(const ImageFrame& other);
// Deletes the pixel data entirely; used by ImageDecoder to save memory
// when we no longer need to display a frame and only need its metadata.
@@ -89,11 +89,11 @@ namespace WebCore {
// Creates a new copy of the image data in |other|, so the two images
// can be modified independently. Returns whether the copy succeeded.
- bool copyBitmapData(const RGBA32Buffer&);
+ bool copyBitmapData(const ImageFrame&);
// Creates a new reference to the image data in |other|. The two images
// share a common backing store.
- void copyReferenceToBitmapData(const RGBA32Buffer&);
+ void copyReferenceToBitmapData(const ImageFrame&);
// Copies the pixel data at [(startX, startY), (endX, startY)) to the
// same X-coordinates on each subsequent row up to but not including
@@ -317,10 +317,10 @@ namespace WebCore {
// The number of repetitions to perform for an animation loop.
virtual int repetitionCount() const { return cAnimationNone; }
- // Called to obtain the RGBA32Buffer full of decoded data for rendering.
+ // Called to obtain the ImageFrame full of decoded data for rendering.
// The decoder plugin will decode as much of the frame as it can before
// handing back the buffer.
- virtual RGBA32Buffer* frameBufferAtIndex(size_t) = 0;
+ virtual ImageFrame* frameBufferAtIndex(size_t) = 0;
// Whether or not the underlying image format even supports alpha
// transparency.
@@ -364,7 +364,7 @@ namespace WebCore {
int scaledY(int origY, int searchStart = 0);
RefPtr<SharedBuffer> m_data; // The encoded data.
- Vector<RGBA32Buffer> m_frameBufferCache;
+ Vector<ImageFrame> m_frameBufferCache;
ColorProfile m_colorProfile;
bool m_scaled;
Vector<int> m_scaledColumns;
diff --git a/Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp b/Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp
index 220a1ed..0d0e8a7 100644
--- a/Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp
+++ b/Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp
@@ -65,7 +65,7 @@ bool BMPImageDecoder::isSizeAvailable()
return ImageDecoder::isSizeAvailable();
}
-RGBA32Buffer* BMPImageDecoder::frameBufferAtIndex(size_t index)
+ImageFrame* BMPImageDecoder::frameBufferAtIndex(size_t index)
{
if (index)
return 0;
@@ -75,8 +75,8 @@ RGBA32Buffer* BMPImageDecoder::frameBufferAtIndex(size_t index)
m_frameBufferCache.first().setPremultiplyAlpha(m_premultiplyAlpha);
}
- RGBA32Buffer* buffer = &m_frameBufferCache.first();
- if (buffer->status() != RGBA32Buffer::FrameComplete)
+ ImageFrame* buffer = &m_frameBufferCache.first();
+ if (buffer->status() != ImageFrame::FrameComplete)
decode(false);
return buffer;
}
@@ -98,7 +98,7 @@ void BMPImageDecoder::decode(bool onlySize)
setFailed();
// If we're done decoding the image, we don't need the BMPImageReader
// anymore. (If we failed, |m_reader| has already been cleared.)
- else if (!m_frameBufferCache.isEmpty() && (m_frameBufferCache.first().status() == RGBA32Buffer::FrameComplete))
+ else if (!m_frameBufferCache.isEmpty() && (m_frameBufferCache.first().status() == ImageFrame::FrameComplete))
m_reader.clear();
}
diff --git a/Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.h b/Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.h
index 5f4ed82..f5b9d5e 100644
--- a/Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.h
+++ b/Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.h
@@ -45,7 +45,7 @@ namespace WebCore {
virtual String filenameExtension() const { return "bmp"; }
virtual void setData(SharedBuffer*, bool allDataReceived);
virtual bool isSizeAvailable();
- virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
+ virtual ImageFrame* frameBufferAtIndex(size_t index);
// CAUTION: setFailed() deletes |m_reader|. Be careful to avoid
// accessing deleted memory, especially when calling this from inside
// BMPImageReader!
diff --git a/Source/WebCore/platform/image-decoders/bmp/BMPImageReader.cpp b/Source/WebCore/platform/image-decoders/bmp/BMPImageReader.cpp
index 93bedf3..1805bc7 100644
--- a/Source/WebCore/platform/image-decoders/bmp/BMPImageReader.cpp
+++ b/Source/WebCore/platform/image-decoders/bmp/BMPImageReader.cpp
@@ -77,10 +77,10 @@ bool BMPImageReader::decodeBMP(bool onlySize)
// Initialize the framebuffer if needed.
ASSERT(m_buffer); // Parent should set this before asking us to decode!
- if (m_buffer->status() == RGBA32Buffer::FrameEmpty) {
+ if (m_buffer->status() == ImageFrame::FrameEmpty) {
if (!m_buffer->setSize(m_parent->size().width(), m_parent->size().height()))
return m_parent->setFailed(); // Unable to allocate.
- m_buffer->setStatus(RGBA32Buffer::FramePartial);
+ m_buffer->setStatus(ImageFrame::FramePartial);
// setSize() calls eraseARGB(), which resets the alpha flag, so we force
// it back to false here. We'll set it true below in all cases where
// these 0s could actually show through.
@@ -122,7 +122,7 @@ bool BMPImageReader::decodeBMP(bool onlySize)
}
// Done!
- m_buffer->setStatus(RGBA32Buffer::FrameComplete);
+ m_buffer->setStatus(ImageFrame::FrameComplete);
return true;
}
diff --git a/Source/WebCore/platform/image-decoders/bmp/BMPImageReader.h b/Source/WebCore/platform/image-decoders/bmp/BMPImageReader.h
index 0a6dc84..dfaa9ec 100644
--- a/Source/WebCore/platform/image-decoders/bmp/BMPImageReader.h
+++ b/Source/WebCore/platform/image-decoders/bmp/BMPImageReader.h
@@ -64,11 +64,11 @@ namespace WebCore {
// |parent| is the decoder that owns us.
// |startOffset| points to the start of the BMP within the file.
- // |buffer| points at an empty RGBA32Buffer that we'll initialize and
+ // |buffer| points at an empty ImageFrame that we'll initialize and
// fill with decoded data.
BMPImageReader(ImageDecoder* parent, size_t decodedAndHeaderOffset, size_t imgDataOffset, bool usesAndMask);
- void setBuffer(RGBA32Buffer* buffer) { m_buffer = buffer; }
+ void setBuffer(ImageFrame* buffer) { m_buffer = buffer; }
void setData(SharedBuffer* data) { m_data = data; }
// Does the actual decoding. If |onlySize| is true, decoding only
@@ -274,7 +274,7 @@ namespace WebCore {
ImageDecoder* m_parent;
// The destination for the pixel data.
- RGBA32Buffer* m_buffer;
+ ImageFrame* m_buffer;
// The file to decode.
RefPtr<SharedBuffer> m_data;
diff --git a/Source/WebCore/platform/image-decoders/cairo/ImageDecoderCairo.cpp b/Source/WebCore/platform/image-decoders/cairo/ImageDecoderCairo.cpp
index d741882..618c1d0 100644
--- a/Source/WebCore/platform/image-decoders/cairo/ImageDecoderCairo.cpp
+++ b/Source/WebCore/platform/image-decoders/cairo/ImageDecoderCairo.cpp
@@ -30,7 +30,7 @@
namespace WebCore {
-NativeImagePtr RGBA32Buffer::asNewNativeImage() const
+NativeImagePtr ImageFrame::asNewNativeImage() const
{
return cairo_image_surface_create_for_data(
reinterpret_cast<unsigned char*>(const_cast<PixelData*>(
diff --git a/Source/WebCore/platform/image-decoders/cg/ImageDecoderCG.cpp b/Source/WebCore/platform/image-decoders/cg/ImageDecoderCG.cpp
index 03b4c8f..0b90107 100644
--- a/Source/WebCore/platform/image-decoders/cg/ImageDecoderCG.cpp
+++ b/Source/WebCore/platform/image-decoders/cg/ImageDecoderCG.cpp
@@ -33,22 +33,22 @@
namespace WebCore {
-static RGBA32Buffer::PixelData* getPtrAsPixelData(CFMutableDataRef data)
+static ImageFrame::PixelData* getPtrAsPixelData(CFMutableDataRef data)
{
- return data ? reinterpret_cast<RGBA32Buffer::PixelData*>(CFDataGetMutableBytePtr(data)) : 0;
+ return data ? reinterpret_cast<ImageFrame::PixelData*>(CFDataGetMutableBytePtr(data)) : 0;
}
-void RGBA32Buffer::copyReferenceToBitmapData(const RGBA32Buffer& other)
+void ImageFrame::copyReferenceToBitmapData(const ImageFrame& other)
{
ASSERT(this != &other);
m_backingStore = other.m_backingStore;
m_bytes = getPtrAsPixelData(m_backingStore.get());
- // FIXME: The rest of this function seems redundant with RGBA32Buffer::copyBitmapData.
+ // FIXME: The rest of this function seems redundant with ImageFrame::copyBitmapData.
m_size = other.m_size;
setHasAlpha(other.m_hasAlpha);
}
-bool RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other)
+bool ImageFrame::copyBitmapData(const ImageFrame& other)
{
if (this == &other)
return true;
@@ -60,7 +60,7 @@ bool RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other)
return true;
}
-bool RGBA32Buffer::setSize(int newWidth, int newHeight)
+bool ImageFrame::setSize(int newWidth, int newHeight)
{
ASSERT(!m_backingStore);
size_t backingStoreSize = newWidth * newHeight * sizeof(PixelData);
@@ -91,7 +91,7 @@ static CGColorSpaceRef createColorSpace(const ColorProfile& colorProfile)
#endif
}
-NativeImagePtr RGBA32Buffer::asNewNativeImage() const
+NativeImagePtr ImageFrame::asNewNativeImage() const
{
RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, createColorSpace(m_colorProfile));
RetainPtr<CGDataProviderRef> dataProvider(AdoptCF, CGDataProviderCreateWithCFData(m_backingStore.get()));
diff --git a/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp b/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
index e92f264..e6de597 100644
--- a/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
+++ b/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
@@ -118,13 +118,13 @@ int GIFImageDecoder::repetitionCount() const
return m_repetitionCount;
}
-RGBA32Buffer* GIFImageDecoder::frameBufferAtIndex(size_t index)
+ImageFrame* GIFImageDecoder::frameBufferAtIndex(size_t index)
{
if (index >= frameCount())
return 0;
- RGBA32Buffer& frame = m_frameBufferCache[index];
- if (frame.status() != RGBA32Buffer::FrameComplete)
+ ImageFrame& frame = m_frameBufferCache[index];
+ if (frame.status() != ImageFrame::FrameComplete)
decode(index + 1, GIFFullQuery);
return &frame;
}
@@ -151,7 +151,7 @@ void GIFImageDecoder::clearFrameBufferCache(size_t clearBeforeFrame)
// always use ImageSource::clear(true, ...) to completely free the memory in
// this case.
clearBeforeFrame = std::min(clearBeforeFrame, m_frameBufferCache.size() - 1);
- const Vector<RGBA32Buffer>::iterator end(m_frameBufferCache.begin() + clearBeforeFrame);
+ const Vector<ImageFrame>::iterator end(m_frameBufferCache.begin() + clearBeforeFrame);
// We need to preserve frames such that:
// * We don't clear |end|
@@ -171,16 +171,16 @@ void GIFImageDecoder::clearFrameBufferCache(size_t clearBeforeFrame)
// * If the frame is partial, we're decoding it, so don't clear it; if it
// has a disposal method other than DisposeOverwritePrevious, stop
// scanning, as we'll only need this frame when decoding the next one.
- Vector<RGBA32Buffer>::iterator i(end);
- for (; (i != m_frameBufferCache.begin()) && ((i->status() == RGBA32Buffer::FrameEmpty) || (i->disposalMethod() == RGBA32Buffer::DisposeOverwritePrevious)); --i) {
- if ((i->status() == RGBA32Buffer::FrameComplete) && (i != end))
+ Vector<ImageFrame>::iterator i(end);
+ for (; (i != m_frameBufferCache.begin()) && ((i->status() == ImageFrame::FrameEmpty) || (i->disposalMethod() == ImageFrame::DisposeOverwritePrevious)); --i) {
+ if ((i->status() == ImageFrame::FrameComplete) && (i != end))
i->clear();
}
// Now |i| holds the last frame we need to preserve; clear prior frames.
- for (Vector<RGBA32Buffer>::iterator j(m_frameBufferCache.begin()); j != i; ++j) {
- ASSERT(j->status() != RGBA32Buffer::FramePartial);
- if (j->status() != RGBA32Buffer::FrameEmpty)
+ for (Vector<ImageFrame>::iterator j(m_frameBufferCache.begin()); j != i; ++j) {
+ ASSERT(j->status() != ImageFrame::FramePartial);
+ if (j->status() != ImageFrame::FrameEmpty)
j->clear();
}
}
@@ -220,8 +220,8 @@ bool GIFImageDecoder::haveDecodedRow(unsigned frameIndex, unsigned char* rowBuff
return true;
// Initialize the frame if necessary.
- RGBA32Buffer& buffer = m_frameBufferCache[frameIndex];
- if ((buffer.status() == RGBA32Buffer::FrameEmpty) && !initFrameBuffer(frameIndex))
+ ImageFrame& buffer = m_frameBufferCache[frameIndex];
+ if ((buffer.status() == ImageFrame::FrameEmpty) && !initFrameBuffer(frameIndex))
return false;
// Write one row's worth of data into the frame.
@@ -251,15 +251,15 @@ bool GIFImageDecoder::haveDecodedRow(unsigned frameIndex, unsigned char* rowBuff
return true;
}
-bool GIFImageDecoder::frameComplete(unsigned frameIndex, unsigned frameDuration, RGBA32Buffer::FrameDisposalMethod disposalMethod)
+bool GIFImageDecoder::frameComplete(unsigned frameIndex, unsigned frameDuration, ImageFrame::FrameDisposalMethod disposalMethod)
{
// Initialize the frame if necessary. Some GIFs insert do-nothing frames,
// in which case we never reach haveDecodedRow() before getting here.
- RGBA32Buffer& buffer = m_frameBufferCache[frameIndex];
- if ((buffer.status() == RGBA32Buffer::FrameEmpty) && !initFrameBuffer(frameIndex))
+ ImageFrame& buffer = m_frameBufferCache[frameIndex];
+ if ((buffer.status() == ImageFrame::FrameEmpty) && !initFrameBuffer(frameIndex))
return false; // initFrameBuffer() has already called setFailed().
- buffer.setStatus(RGBA32Buffer::FrameComplete);
+ buffer.setStatus(ImageFrame::FrameComplete);
buffer.setDuration(frameDuration);
buffer.setDisposalMethod(disposalMethod);
@@ -277,8 +277,8 @@ bool GIFImageDecoder::frameComplete(unsigned frameIndex, unsigned frameDuration,
// First skip over prior DisposeOverwritePrevious frames (since they
// don't affect the start state of this frame) the same way we do in
// initFrameBuffer().
- const RGBA32Buffer* prevBuffer = &m_frameBufferCache[--frameIndex];
- while (frameIndex && (prevBuffer->disposalMethod() == RGBA32Buffer::DisposeOverwritePrevious))
+ const ImageFrame* prevBuffer = &m_frameBufferCache[--frameIndex];
+ while (frameIndex && (prevBuffer->disposalMethod() == ImageFrame::DisposeOverwritePrevious))
prevBuffer = &m_frameBufferCache[--frameIndex];
// Now, if we're at a DisposeNotSpecified or DisposeKeep frame, then
@@ -289,7 +289,7 @@ bool GIFImageDecoder::frameComplete(unsigned frameIndex, unsigned frameDuration,
// The only remaining case is a DisposeOverwriteBgcolor frame. If
// it had no alpha, and its rect is contained in the current frame's
// rect, we know the current frame has no alpha.
- if ((prevBuffer->disposalMethod() == RGBA32Buffer::DisposeOverwriteBgcolor) && !prevBuffer->hasAlpha() && buffer.rect().contains(prevBuffer->rect()))
+ if ((prevBuffer->disposalMethod() == ImageFrame::DisposeOverwriteBgcolor) && !prevBuffer->hasAlpha() && buffer.rect().contains(prevBuffer->rect()))
buffer.setHasAlpha(false);
}
}
@@ -332,7 +332,7 @@ bool GIFImageDecoder::initFrameBuffer(unsigned frameIndex)
if (frameRect.bottom() > size().height())
frameRect.setHeight(size().height() - frameReader->y_offset);
- RGBA32Buffer* const buffer = &m_frameBufferCache[frameIndex];
+ ImageFrame* const buffer = &m_frameBufferCache[frameIndex];
int left = upperBoundScaledX(frameRect.x());
int right = lowerBoundScaledX(frameRect.right(), left);
int top = upperBoundScaledY(frameRect.y());
@@ -352,15 +352,15 @@ bool GIFImageDecoder::initFrameBuffer(unsigned frameIndex)
// the starting state of the previous frame, so skip over them. (If the
// first frame specifies this method, it will get treated like
// DisposeOverwriteBgcolor below and reset to a completely empty image.)
- const RGBA32Buffer* prevBuffer = &m_frameBufferCache[--frameIndex];
- RGBA32Buffer::FrameDisposalMethod prevMethod = prevBuffer->disposalMethod();
- while (frameIndex && (prevMethod == RGBA32Buffer::DisposeOverwritePrevious)) {
+ const ImageFrame* prevBuffer = &m_frameBufferCache[--frameIndex];
+ ImageFrame::FrameDisposalMethod prevMethod = prevBuffer->disposalMethod();
+ while (frameIndex && (prevMethod == ImageFrame::DisposeOverwritePrevious)) {
prevBuffer = &m_frameBufferCache[--frameIndex];
prevMethod = prevBuffer->disposalMethod();
}
- ASSERT(prevBuffer->status() == RGBA32Buffer::FrameComplete);
+ ASSERT(prevBuffer->status() == ImageFrame::FrameComplete);
- if ((prevMethod == RGBA32Buffer::DisposeNotSpecified) || (prevMethod == RGBA32Buffer::DisposeKeep)) {
+ if ((prevMethod == ImageFrame::DisposeNotSpecified) || (prevMethod == ImageFrame::DisposeKeep)) {
// Preserve the last frame as the starting state for this frame.
if (!buffer->copyBitmapData(*prevBuffer))
return setFailed();
@@ -389,7 +389,7 @@ bool GIFImageDecoder::initFrameBuffer(unsigned frameIndex)
}
// Update our status to be partially complete.
- buffer->setStatus(RGBA32Buffer::FramePartial);
+ buffer->setStatus(ImageFrame::FramePartial);
// Reset the alpha pixel tracker for this frame.
m_currentBufferSawAlpha = false;
diff --git a/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.h b/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.h
index 64240d4..dd401b8 100644
--- a/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.h
+++ b/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.h
@@ -48,7 +48,7 @@ namespace WebCore {
virtual bool setSize(int width, int height);
virtual size_t frameCount();
virtual int repetitionCount() const;
- virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
+ virtual ImageFrame* frameBufferAtIndex(size_t index);
// CAUTION: setFailed() deletes |m_reader|. Be careful to avoid
// accessing deleted memory, especially when calling this from inside
// GIFImageReader!
@@ -58,7 +58,7 @@ namespace WebCore {
// Callbacks from the GIF reader.
void decodingHalted(unsigned bytesLeft);
bool haveDecodedRow(unsigned frameIndex, unsigned char* rowBuffer, unsigned char* rowEnd, unsigned rowNumber, unsigned repeatCount, bool writeTransparentPixels);
- bool frameComplete(unsigned frameIndex, unsigned frameDuration, RGBA32Buffer::FrameDisposalMethod disposalMethod);
+ bool frameComplete(unsigned frameIndex, unsigned frameDuration, ImageFrame::FrameDisposalMethod disposalMethod);
void gifComplete();
private:
diff --git a/Source/WebCore/platform/image-decoders/gif/GIFImageReader.cpp b/Source/WebCore/platform/image-decoders/gif/GIFImageReader.cpp
index 1e033a3..420b355 100644
--- a/Source/WebCore/platform/image-decoders/gif/GIFImageReader.cpp
+++ b/Source/WebCore/platform/image-decoders/gif/GIFImageReader.cpp
@@ -638,11 +638,11 @@ bool GIFImageReader::read(const unsigned char *buf, unsigned len,
}
// NOTE: This relies on the values in the FrameDisposalMethod enum
// matching those in the GIF spec!
- frame_reader->disposal_method = (WebCore::RGBA32Buffer::FrameDisposalMethod)(((*q) >> 2) & 0x7);
+ frame_reader->disposal_method = (WebCore::ImageFrame::FrameDisposalMethod)(((*q) >> 2) & 0x7);
// Some specs say 3rd bit (value 4), other specs say value 3
// Let's choose 3 (the more popular)
if (frame_reader->disposal_method == 4)
- frame_reader->disposal_method = WebCore::RGBA32Buffer::DisposeOverwritePrevious;
+ frame_reader->disposal_method = WebCore::ImageFrame::DisposeOverwritePrevious;
frame_reader->delay_time = GETINT16(q + 1) * 10;
}
GETN(1, gif_consume_block);
diff --git a/Source/WebCore/platform/image-decoders/gif/GIFImageReader.h b/Source/WebCore/platform/image-decoders/gif/GIFImageReader.h
index be5be19..b6eb943 100644
--- a/Source/WebCore/platform/image-decoders/gif/GIFImageReader.h
+++ b/Source/WebCore/platform/image-decoders/gif/GIFImageReader.h
@@ -101,7 +101,7 @@ struct GIFFrameReader {
unsigned int x_offset, y_offset; /* With respect to "screen" origin */
unsigned int height, width;
int tpixel; /* Index of transparent pixel */
- WebCore::RGBA32Buffer::FrameDisposalMethod disposal_method; /* Restore to background, leave in place, etc.*/
+ WebCore::ImageFrame::FrameDisposalMethod disposal_method; /* Restore to background, leave in place, etc.*/
unsigned char *local_colormap; /* Per-image colormap */
int local_colormap_size; /* Size of local colormap array. */
@@ -130,7 +130,7 @@ struct GIFFrameReader {
x_offset = y_offset = width = height = 0;
tpixel = 0;
- disposal_method = WebCore::RGBA32Buffer::DisposeNotSpecified;
+ disposal_method = WebCore::ImageFrame::DisposeNotSpecified;
local_colormap = 0;
local_colormap_size = 0;
diff --git a/Source/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp b/Source/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp
index 47302f7..21c0e1f 100644
--- a/Source/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp
+++ b/Source/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp
@@ -31,7 +31,7 @@
namespace WebCore {
-NativeImagePtr RGBA32Buffer::asNewNativeImage() const
+NativeImagePtr ImageFrame::asNewNativeImage() const
{
int bytesPerRow = width() * sizeof(PixelData);
OwnPtr<BBitmap> bitmap(new BBitmap(BRect(0, 0, width() - 1, height() - 1), 0, B_RGBA32, bytesPerRow));
diff --git a/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp b/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp
index 92a7dcf..55e1dcb 100644
--- a/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp
+++ b/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp
@@ -109,14 +109,14 @@ size_t ICOImageDecoder::frameCount()
return m_frameBufferCache.size();
}
-RGBA32Buffer* ICOImageDecoder::frameBufferAtIndex(size_t index)
+ImageFrame* ICOImageDecoder::frameBufferAtIndex(size_t index)
{
// Ensure |index| is valid.
if (index >= frameCount())
return 0;
- RGBA32Buffer* buffer = &m_frameBufferCache[index];
- if (buffer->status() != RGBA32Buffer::FrameComplete)
+ ImageFrame* buffer = &m_frameBufferCache[index];
+ if (buffer->status() != ImageFrame::FrameComplete)
decode(index, false);
return buffer;
}
@@ -162,7 +162,7 @@ void ICOImageDecoder::decode(size_t index, bool onlySize)
// If we're done decoding this frame, we don't need the BMPImageReader or
// PNGImageDecoder anymore. (If we failed, these have already been
// cleared.)
- else if ((m_frameBufferCache.size() > index) && (m_frameBufferCache[index].status() == RGBA32Buffer::FrameComplete)) {
+ else if ((m_frameBufferCache.size() > index) && (m_frameBufferCache[index].status() == ImageFrame::FrameComplete)) {
m_bmpReaders[index].clear();
m_pngDecoders[index].clear();
}
diff --git a/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h b/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h
index c2af6a3..31d91c8 100644
--- a/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h
+++ b/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h
@@ -51,7 +51,7 @@ namespace WebCore {
virtual IntSize frameSizeAtIndex(size_t) const;
virtual bool setSize(unsigned width, unsigned height);
virtual size_t frameCount();
- virtual RGBA32Buffer* frameBufferAtIndex(size_t);
+ virtual ImageFrame* frameBufferAtIndex(size_t);
// CAUTION: setFailed() deletes all readers and decoders. Be careful to
// avoid accessing deleted memory, especially when calling this from
// inside BMPImageReader!
diff --git a/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp b/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
index 632d428..a255c25 100644
--- a/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
+++ b/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
@@ -425,7 +425,7 @@ bool JPEGImageDecoder::setSize(unsigned width, unsigned height)
return true;
}
-RGBA32Buffer* JPEGImageDecoder::frameBufferAtIndex(size_t index)
+ImageFrame* JPEGImageDecoder::frameBufferAtIndex(size_t index)
{
if (index)
return 0;
@@ -435,8 +435,8 @@ RGBA32Buffer* JPEGImageDecoder::frameBufferAtIndex(size_t index)
m_frameBufferCache[0].setPremultiplyAlpha(m_premultiplyAlpha);
}
- RGBA32Buffer& frame = m_frameBufferCache[0];
- if (frame.status() != RGBA32Buffer::FrameComplete)
+ ImageFrame& frame = m_frameBufferCache[0];
+ if (frame.status() != ImageFrame::FrameComplete)
decode(false);
return &frame;
}
@@ -453,11 +453,11 @@ bool JPEGImageDecoder::outputScanlines()
return false;
// Initialize the framebuffer if needed.
- RGBA32Buffer& buffer = m_frameBufferCache[0];
- if (buffer.status() == RGBA32Buffer::FrameEmpty) {
+ ImageFrame& buffer = m_frameBufferCache[0];
+ if (buffer.status() == ImageFrame::FrameEmpty) {
if (!buffer.setSize(scaledSize().width(), scaledSize().height()))
return setFailed();
- buffer.setStatus(RGBA32Buffer::FramePartial);
+ buffer.setStatus(ImageFrame::FramePartial);
buffer.setHasAlpha(false);
buffer.setColorProfile(m_colorProfile);
@@ -513,7 +513,7 @@ void JPEGImageDecoder::jpegComplete()
// Hand back an appropriately sized buffer, even if the image ended up being
// empty.
- m_frameBufferCache[0].setStatus(RGBA32Buffer::FrameComplete);
+ m_frameBufferCache[0].setStatus(ImageFrame::FrameComplete);
}
void JPEGImageDecoder::decode(bool onlySize)
@@ -530,7 +530,7 @@ void JPEGImageDecoder::decode(bool onlySize)
setFailed();
// If we're done decoding the image, we don't need the JPEGImageReader
// anymore. (If we failed, |m_reader| has already been cleared.)
- else if (!m_frameBufferCache.isEmpty() && (m_frameBufferCache[0].status() == RGBA32Buffer::FrameComplete))
+ else if (!m_frameBufferCache.isEmpty() && (m_frameBufferCache[0].status() == ImageFrame::FrameComplete))
m_reader.clear();
}
diff --git a/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h b/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h
index 63f29ab..801f1ab 100644
--- a/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h
+++ b/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h
@@ -44,7 +44,7 @@ namespace WebCore {
virtual String filenameExtension() const { return "jpg"; }
virtual bool isSizeAvailable();
virtual bool setSize(unsigned width, unsigned height);
- virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
+ virtual ImageFrame* frameBufferAtIndex(size_t index);
virtual bool supportsAlpha() const { return false; }
// CAUTION: setFailed() deletes |m_reader|. Be careful to avoid
// accessing deleted memory, especially when calling this from inside
diff --git a/Source/WebCore/platform/image-decoders/openvg/ImageDecoderOpenVG.cpp b/Source/WebCore/platform/image-decoders/openvg/ImageDecoderOpenVG.cpp
index 061c5ab..d29317a 100644
--- a/Source/WebCore/platform/image-decoders/openvg/ImageDecoderOpenVG.cpp
+++ b/Source/WebCore/platform/image-decoders/openvg/ImageDecoderOpenVG.cpp
@@ -34,7 +34,7 @@
namespace WebCore {
-NativeImagePtr RGBA32Buffer::asNewNativeImage() const
+NativeImagePtr ImageFrame::asNewNativeImage() const
{
static const VGImageFormat bufferFormat = VG_sARGB_8888_PRE;
// Save memory by using 16-bit images for fully opaque images.
diff --git a/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp b/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
index 3fe4d3c..755d704 100644
--- a/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
+++ b/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
@@ -197,7 +197,7 @@ bool PNGImageDecoder::setSize(unsigned width, unsigned height)
return true;
}
-RGBA32Buffer* PNGImageDecoder::frameBufferAtIndex(size_t index)
+ImageFrame* PNGImageDecoder::frameBufferAtIndex(size_t index)
{
if (index)
return 0;
@@ -207,8 +207,8 @@ RGBA32Buffer* PNGImageDecoder::frameBufferAtIndex(size_t index)
m_frameBufferCache[0].setPremultiplyAlpha(m_premultiplyAlpha);
}
- RGBA32Buffer& frame = m_frameBufferCache[0];
- if (frame.status() != RGBA32Buffer::FrameComplete)
+ ImageFrame& frame = m_frameBufferCache[0];
+ if (frame.status() != ImageFrame::FrameComplete)
decode(false);
return &frame;
}
@@ -330,13 +330,13 @@ void PNGImageDecoder::rowAvailable(unsigned char* rowBuffer, unsigned rowIndex,
return;
// Initialize the framebuffer if needed.
- RGBA32Buffer& buffer = m_frameBufferCache[0];
- if (buffer.status() == RGBA32Buffer::FrameEmpty) {
+ ImageFrame& buffer = m_frameBufferCache[0];
+ if (buffer.status() == ImageFrame::FrameEmpty) {
if (!buffer.setSize(scaledSize().width(), scaledSize().height())) {
longjmp(JMPBUF(m_reader->pngPtr()), 1);
return;
}
- buffer.setStatus(RGBA32Buffer::FramePartial);
+ buffer.setStatus(ImageFrame::FramePartial);
buffer.setHasAlpha(false);
buffer.setColorProfile(m_colorProfile);
@@ -410,7 +410,7 @@ void PNGImageDecoder::rowAvailable(unsigned char* rowBuffer, unsigned rowIndex,
void PNGImageDecoder::pngComplete()
{
if (!m_frameBufferCache.isEmpty())
- m_frameBufferCache.first().setStatus(RGBA32Buffer::FrameComplete);
+ m_frameBufferCache.first().setStatus(ImageFrame::FrameComplete);
}
void PNGImageDecoder::decode(bool onlySize)
diff --git a/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h b/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h
index 1e8902f..ec2e857 100644
--- a/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h
+++ b/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h
@@ -43,7 +43,7 @@ namespace WebCore {
virtual String filenameExtension() const { return "png"; }
virtual bool isSizeAvailable();
virtual bool setSize(unsigned width, unsigned height);
- virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
+ virtual ImageFrame* frameBufferAtIndex(size_t index);
// CAUTION: setFailed() deletes |m_reader|. Be careful to avoid
// accessing deleted memory, especially when calling this from inside
// PNGImageReader!
@@ -56,7 +56,7 @@ namespace WebCore {
bool isComplete() const
{
- return !m_frameBufferCache.isEmpty() && (m_frameBufferCache.first().status() == RGBA32Buffer::FrameComplete);
+ return !m_frameBufferCache.isEmpty() && (m_frameBufferCache.first().status() == ImageFrame::FrameComplete);
}
private:
diff --git a/Source/WebCore/platform/image-decoders/qt/RGBA32BufferQt.cpp b/Source/WebCore/platform/image-decoders/qt/ImageFrameQt.cpp
index 998234f..81c22cf 100644
--- a/Source/WebCore/platform/image-decoders/qt/RGBA32BufferQt.cpp
+++ b/Source/WebCore/platform/image-decoders/qt/ImageFrameQt.cpp
@@ -35,7 +35,7 @@
namespace WebCore {
-RGBA32Buffer::RGBA32Buffer()
+ImageFrame::ImageFrame()
: m_hasAlpha(false)
, m_size()
, m_status(FrameEmpty)
@@ -44,7 +44,7 @@ RGBA32Buffer::RGBA32Buffer()
{
}
-RGBA32Buffer& RGBA32Buffer::operator=(const RGBA32Buffer& other)
+ImageFrame& ImageFrame::operator=(const ImageFrame& other)
{
if (this == &other)
return *this;
@@ -57,7 +57,7 @@ RGBA32Buffer& RGBA32Buffer::operator=(const RGBA32Buffer& other)
return *this;
}
-void RGBA32Buffer::clear()
+void ImageFrame::clear()
{
m_pixmap = QPixmap();
m_image = QImage();
@@ -68,7 +68,7 @@ void RGBA32Buffer::clear()
// other metadata out of this frame later.
}
-void RGBA32Buffer::zeroFill()
+void ImageFrame::zeroFill()
{
if (m_pixmap.isNull() && !m_image.isNull()) {
m_pixmap = QPixmap(m_image.width(), m_image.height());
@@ -77,7 +77,7 @@ void RGBA32Buffer::zeroFill()
m_pixmap.fill(QColor(0, 0, 0, 0));
}
-bool RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other)
+bool ImageFrame::copyBitmapData(const ImageFrame& other)
{
if (this == &other)
return true;
@@ -89,7 +89,7 @@ bool RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other)
return true;
}
-bool RGBA32Buffer::setSize(int newWidth, int newHeight)
+bool ImageFrame::setSize(int newWidth, int newHeight)
{
// This function should only be called once, it will leak memory
// otherwise.
@@ -107,7 +107,7 @@ bool RGBA32Buffer::setSize(int newWidth, int newHeight)
return true;
}
-QPixmap* RGBA32Buffer::asNewNativeImage() const
+QPixmap* ImageFrame::asNewNativeImage() const
{
if (m_pixmap.isNull() && !m_image.isNull()) {
m_pixmap = QPixmap::fromImage(m_image);
@@ -116,28 +116,28 @@ QPixmap* RGBA32Buffer::asNewNativeImage() const
return new QPixmap(m_pixmap);
}
-bool RGBA32Buffer::hasAlpha() const
+bool ImageFrame::hasAlpha() const
{
return m_hasAlpha;
}
-void RGBA32Buffer::setHasAlpha(bool alpha)
+void ImageFrame::setHasAlpha(bool alpha)
{
m_hasAlpha = alpha;
}
-void RGBA32Buffer::setColorProfile(const ColorProfile& colorProfile)
+void ImageFrame::setColorProfile(const ColorProfile& colorProfile)
{
notImplemented();
}
-void RGBA32Buffer::setStatus(FrameStatus status)
+void ImageFrame::setStatus(FrameStatus status)
{
m_status = status;
}
// The image must not have format 8888 pre multiplied...
-void RGBA32Buffer::setPixmap(const QPixmap& pixmap)
+void ImageFrame::setPixmap(const QPixmap& pixmap)
{
m_pixmap = pixmap;
m_image = QImage();
@@ -145,12 +145,12 @@ void RGBA32Buffer::setPixmap(const QPixmap& pixmap)
m_hasAlpha = pixmap.hasAlphaChannel();
}
-int RGBA32Buffer::width() const
+int ImageFrame::width() const
{
return m_size.width();
}
-int RGBA32Buffer::height() const
+int ImageFrame::height() const
{
return m_size.height();
}
diff --git a/Source/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp b/Source/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp
index 50e2106..a1c8261 100644
--- a/Source/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp
+++ b/Source/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp
@@ -34,7 +34,7 @@
namespace WebCore {
-RGBA32Buffer::RGBA32Buffer()
+ImageFrame::ImageFrame()
: m_status(FrameEmpty)
, m_duration(0)
, m_disposalMethod(DisposeNotSpecified)
@@ -42,7 +42,7 @@ RGBA32Buffer::RGBA32Buffer()
{
}
-RGBA32Buffer& RGBA32Buffer::operator=(const RGBA32Buffer& other)
+ImageFrame& ImageFrame::operator=(const ImageFrame& other)
{
if (this == &other)
return *this;
@@ -59,7 +59,7 @@ RGBA32Buffer& RGBA32Buffer::operator=(const RGBA32Buffer& other)
return *this;
}
-void RGBA32Buffer::clear()
+void ImageFrame::clear()
{
m_bitmap.reset();
m_status = FrameEmpty;
@@ -69,12 +69,12 @@ void RGBA32Buffer::clear()
// other metadata out of this frame later.
}
-void RGBA32Buffer::zeroFill()
+void ImageFrame::zeroFill()
{
m_bitmap.eraseARGB(0, 0, 0, 0);
}
-bool RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other)
+bool ImageFrame::copyBitmapData(const ImageFrame& other)
{
if (this == &other)
return true;
@@ -84,7 +84,7 @@ bool RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other)
return otherBitmap.copyTo(&m_bitmap, otherBitmap.config());
}
-bool RGBA32Buffer::setSize(int newWidth, int newHeight)
+bool ImageFrame::setSize(int newWidth, int newHeight)
{
// This function should only be called once, it will leak memory
// otherwise.
@@ -99,7 +99,7 @@ bool RGBA32Buffer::setSize(int newWidth, int newHeight)
return true;
}
-NativeImagePtr RGBA32Buffer::asNewNativeImage() const
+NativeImagePtr ImageFrame::asNewNativeImage() const
{
#if PLATFORM(ANDROID)
return new SkBitmapRef(m_bitmap);
@@ -108,34 +108,34 @@ NativeImagePtr RGBA32Buffer::asNewNativeImage() const
#endif
}
-bool RGBA32Buffer::hasAlpha() const
+bool ImageFrame::hasAlpha() const
{
return !m_bitmap.isOpaque();
}
-void RGBA32Buffer::setHasAlpha(bool alpha)
+void ImageFrame::setHasAlpha(bool alpha)
{
m_bitmap.setIsOpaque(!alpha);
}
-void RGBA32Buffer::setColorProfile(const ColorProfile& colorProfile)
+void ImageFrame::setColorProfile(const ColorProfile& colorProfile)
{
notImplemented();
}
-void RGBA32Buffer::setStatus(FrameStatus status)
+void ImageFrame::setStatus(FrameStatus status)
{
m_status = status;
if (m_status == FrameComplete)
m_bitmap.setDataComplete(); // Tell the bitmap it's done.
}
-int RGBA32Buffer::width() const
+int ImageFrame::width() const
{
return m_bitmap.width();
}
-int RGBA32Buffer::height() const
+int ImageFrame::height() const
{
return m_bitmap.height();
}
diff --git a/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp b/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp
index a988d9c..8045ada 100644
--- a/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp
+++ b/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp
@@ -53,7 +53,7 @@ bool WEBPImageDecoder::isSizeAvailable()
return ImageDecoder::isSizeAvailable();
}
-RGBA32Buffer* WEBPImageDecoder::frameBufferAtIndex(size_t index)
+ImageFrame* WEBPImageDecoder::frameBufferAtIndex(size_t index)
{
if (index)
return 0;
@@ -63,8 +63,8 @@ RGBA32Buffer* WEBPImageDecoder::frameBufferAtIndex(size_t index)
m_frameBufferCache[0].setPremultiplyAlpha(m_premultiplyAlpha);
}
- RGBA32Buffer& frame = m_frameBufferCache[0];
- if (frame.status() != RGBA32Buffer::FrameComplete)
+ ImageFrame& frame = m_frameBufferCache[0];
+ if (frame.status() != ImageFrame::FrameComplete)
decode(false);
return &frame;
}
@@ -96,8 +96,8 @@ bool WEBPImageDecoder::decode(bool onlySize)
if (!isAllDataReceived())
return true;
ASSERT(!m_frameBufferCache.isEmpty());
- RGBA32Buffer& buffer = m_frameBufferCache[0];
- if (buffer.status() == RGBA32Buffer::FrameEmpty) {
+ ImageFrame& buffer = m_frameBufferCache[0];
+ if (buffer.status() == ImageFrame::FrameEmpty) {
ASSERT(width == size().width());
ASSERT(height == size().height());
if (!buffer.setSize(width, height))
@@ -114,7 +114,7 @@ bool WEBPImageDecoder::decode(bool onlySize)
for (int x = 0; x < width; ++x)
buffer.setRGBA(x, y, src[bytesPerPixel * x + 2], src[bytesPerPixel * x + 1], src[bytesPerPixel * x + 0], 0xff);
}
- buffer.setStatus(RGBA32Buffer::FrameComplete);
+ buffer.setStatus(ImageFrame::FrameComplete);
buffer.setHasAlpha(false);
buffer.setRect(IntRect(IntPoint(), size()));
return true;
diff --git a/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h b/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h
index 6cf8870..cde1bbf 100644
--- a/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h
+++ b/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h
@@ -41,7 +41,7 @@ public:
virtual ~WEBPImageDecoder();
virtual String filenameExtension() const { return "vp8"; }
virtual bool isSizeAvailable();
- virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
+ virtual ImageFrame* frameBufferAtIndex(size_t index);
virtual bool supportsAlpha() const { return false; }
private:
diff --git a/Source/WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp b/Source/WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp
index 966eb90..9314bbe 100644
--- a/Source/WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp
+++ b/Source/WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp
@@ -37,7 +37,7 @@
namespace WebCore {
-NativeImagePtr RGBA32Buffer::asNewNativeImage() const
+NativeImagePtr ImageFrame::asNewNativeImage() const
{
wxBitmap* bmp = new wxBitmap(width(), height(), 32);