2011-01-13 Adam Barth <abarth@webkit.org>
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Jan 2011 23:55:26 +0000 (23:55 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Jan 2011 23:55:26 +0000 (23:55 +0000)
        Reviewed by Eric Seidel.

        Rename RGBA32Buffer to ImageFrame
        https://bugs.webkit.org/show_bug.cgi?id=52363

        Update references to the new name.

        * src/WebImageDecoder.cpp:
        (WebKit::WebImageDecoder::isFrameCompleteAtIndex):
        (WebKit::WebImageDecoder::getFrameAtIndex):
2011-01-13  Adam Barth  <abarth@webkit.org>

        Reviewed by Eric Seidel.

        Rename RGBA32Buffer to ImageFrame
        https://bugs.webkit.org/show_bug.cgi?id=52363

        RGBA32Buffer is a terrible misnomer.  ImageFrame is vastly
        more accurate.  More cleanup to come.

        * WebCore.pro:
        * platform/graphics/ImageSource.cpp:
        (WebCore::ImageSource::createFrameAtIndex):
        (WebCore::ImageSource::frameDurationAtIndex):
        (WebCore::ImageSource::frameIsCompleteAtIndex):
        * platform/graphics/qt/ImageDecoderQt.cpp:
        (WebCore::ImageDecoderQt::frameBufferAtIndex):
        (WebCore::ImageDecoderQt::internalReadImage):
        (WebCore::ImageDecoderQt::internalHandleCurrentImage):
        * platform/graphics/qt/ImageDecoderQt.h:
        * platform/graphics/wince/ImageWinCE.cpp:
        (WebCore::ImageFrame::asNewNativeImage):
        * platform/image-decoders/ImageDecoder.cpp:
        (WebCore::ImageFrame::ImageFrame):
        (WebCore::ImageFrame::operator=):
        (WebCore::ImageFrame::clear):
        (WebCore::ImageFrame::zeroFill):
        (WebCore::ImageFrame::copyReferenceToBitmapData):
        (WebCore::ImageFrame::copyBitmapData):
        (WebCore::ImageFrame::setSize):
        (WebCore::ImageFrame::hasAlpha):
        (WebCore::ImageFrame::setHasAlpha):
        (WebCore::ImageFrame::setColorProfile):
        (WebCore::ImageFrame::setStatus):
        (WebCore::ImageFrame::width):
        (WebCore::ImageFrame::height):
        * platform/image-decoders/ImageDecoder.h:
        (WebCore::ImageFrame::ImageFrame):
        * platform/image-decoders/bmp/BMPImageDecoder.cpp:
        (WebCore::BMPImageDecoder::frameBufferAtIndex):
        (WebCore::BMPImageDecoder::decode):
        * platform/image-decoders/bmp/BMPImageDecoder.h:
        * platform/image-decoders/bmp/BMPImageReader.cpp:
        (WebCore::BMPImageReader::decodeBMP):
        * platform/image-decoders/bmp/BMPImageReader.h:
        (WebCore::BMPImageReader::setBuffer):
        * platform/image-decoders/cairo/ImageDecoderCairo.cpp:
        (WebCore::ImageFrame::asNewNativeImage):
        * platform/image-decoders/cg/ImageDecoderCG.cpp:
        (WebCore::getPtrAsPixelData):
        (WebCore::ImageFrame::copyReferenceToBitmapData):
        (WebCore::ImageFrame::copyBitmapData):
        (WebCore::ImageFrame::setSize):
        (WebCore::ImageFrame::asNewNativeImage):
        * platform/image-decoders/gif/GIFImageDecoder.cpp:
        (WebCore::GIFImageDecoder::frameBufferAtIndex):
        (WebCore::GIFImageDecoder::clearFrameBufferCache):
        (WebCore::GIFImageDecoder::haveDecodedRow):
        (WebCore::GIFImageDecoder::frameComplete):
        (WebCore::GIFImageDecoder::initFrameBuffer):
        * platform/image-decoders/gif/GIFImageDecoder.h:
        * platform/image-decoders/gif/GIFImageReader.cpp:
        (GIFImageReader::read):
        * platform/image-decoders/gif/GIFImageReader.h:
        (GIFFrameReader::GIFFrameReader):
        * platform/image-decoders/haiku/ImageDecoderHaiku.cpp:
        (WebCore::ImageFrame::asNewNativeImage):
        * platform/image-decoders/ico/ICOImageDecoder.cpp:
        (WebCore::ICOImageDecoder::frameBufferAtIndex):
        (WebCore::ICOImageDecoder::decode):
        * platform/image-decoders/ico/ICOImageDecoder.h:
        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
        (WebCore::JPEGImageDecoder::frameBufferAtIndex):
        (WebCore::JPEGImageDecoder::outputScanlines):
        (WebCore::JPEGImageDecoder::jpegComplete):
        (WebCore::JPEGImageDecoder::decode):
        * platform/image-decoders/jpeg/JPEGImageDecoder.h:
        * platform/image-decoders/openvg/ImageDecoderOpenVG.cpp:
        (WebCore::ImageFrame::asNewNativeImage):
        * platform/image-decoders/png/PNGImageDecoder.cpp:
        (WebCore::PNGImageDecoder::frameBufferAtIndex):
        (WebCore::PNGImageDecoder::rowAvailable):
        (WebCore::PNGImageDecoder::pngComplete):
        * platform/image-decoders/png/PNGImageDecoder.h:
        (WebCore::PNGImageDecoder::isComplete):
        * platform/image-decoders/qt/ImageFrameQt.cpp: Copied from Source/WebCore/platform/image-decoders/qt/RGBA32BufferQt.cpp.
        (WebCore::ImageFrame::ImageFrame):
        (WebCore::ImageFrame::operator=):
        (WebCore::ImageFrame::clear):
        (WebCore::ImageFrame::zeroFill):
        (WebCore::ImageFrame::copyBitmapData):
        (WebCore::ImageFrame::setSize):
        (WebCore::ImageFrame::asNewNativeImage):
        (WebCore::ImageFrame::hasAlpha):
        (WebCore::ImageFrame::setHasAlpha):
        (WebCore::ImageFrame::setColorProfile):
        (WebCore::ImageFrame::setStatus):
        (WebCore::ImageFrame::setPixmap):
        (WebCore::ImageFrame::width):
        (WebCore::ImageFrame::height):
        * platform/image-decoders/qt/RGBA32BufferQt.cpp: Removed.
        * platform/image-decoders/skia/ImageDecoderSkia.cpp:
        (WebCore::ImageFrame::ImageFrame):
        (WebCore::ImageFrame::operator=):
        (WebCore::ImageFrame::clear):
        (WebCore::ImageFrame::zeroFill):
        (WebCore::ImageFrame::copyBitmapData):
        (WebCore::ImageFrame::setSize):
        (WebCore::ImageFrame::asNewNativeImage):
        (WebCore::ImageFrame::hasAlpha):
        (WebCore::ImageFrame::setHasAlpha):
        (WebCore::ImageFrame::setColorProfile):
        (WebCore::ImageFrame::setStatus):
        (WebCore::ImageFrame::width):
        (WebCore::ImageFrame::height):
        * platform/image-decoders/webp/WEBPImageDecoder.cpp:
        (WebCore::WEBPImageDecoder::frameBufferAtIndex):
        (WebCore::WEBPImageDecoder::decode):
        * platform/image-decoders/webp/WEBPImageDecoder.h:
        * platform/image-decoders/wx/ImageDecoderWx.cpp:
        (WebCore::ImageFrame::asNewNativeImage):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@75748 268f45cc-cd09-0410-ab3c-d52691b4dbfc

33 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.pro
Source/WebCore/platform/graphics/ImageSource.cpp
Source/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
Source/WebCore/platform/graphics/qt/ImageDecoderQt.h
Source/WebCore/platform/graphics/wince/ImageWinCE.cpp
Source/WebCore/platform/image-decoders/ImageDecoder.cpp
Source/WebCore/platform/image-decoders/ImageDecoder.h
Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp
Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.h
Source/WebCore/platform/image-decoders/bmp/BMPImageReader.cpp
Source/WebCore/platform/image-decoders/bmp/BMPImageReader.h
Source/WebCore/platform/image-decoders/cairo/ImageDecoderCairo.cpp
Source/WebCore/platform/image-decoders/cg/ImageDecoderCG.cpp
Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.h
Source/WebCore/platform/image-decoders/gif/GIFImageReader.cpp
Source/WebCore/platform/image-decoders/gif/GIFImageReader.h
Source/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp
Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp
Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h
Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h
Source/WebCore/platform/image-decoders/openvg/ImageDecoderOpenVG.cpp
Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
Source/WebCore/platform/image-decoders/png/PNGImageDecoder.h
Source/WebCore/platform/image-decoders/qt/ImageFrameQt.cpp [moved from Source/WebCore/platform/image-decoders/qt/RGBA32BufferQt.cpp with 84% similarity]
Source/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp
Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp
Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h
Source/WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp
WebKit/chromium/ChangeLog
WebKit/chromium/src/WebImageDecoder.cpp

index f13aed8..b475b92 100644 (file)
@@ -1,3 +1,125 @@
+2011-01-13  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Rename RGBA32Buffer to ImageFrame
+        https://bugs.webkit.org/show_bug.cgi?id=52363
+
+        RGBA32Buffer is a terrible misnomer.  ImageFrame is vastly
+        more accurate.  More cleanup to come.
+
+        * WebCore.pro:
+        * platform/graphics/ImageSource.cpp:
+        (WebCore::ImageSource::createFrameAtIndex):
+        (WebCore::ImageSource::frameDurationAtIndex):
+        (WebCore::ImageSource::frameIsCompleteAtIndex):
+        * platform/graphics/qt/ImageDecoderQt.cpp:
+        (WebCore::ImageDecoderQt::frameBufferAtIndex):
+        (WebCore::ImageDecoderQt::internalReadImage):
+        (WebCore::ImageDecoderQt::internalHandleCurrentImage):
+        * platform/graphics/qt/ImageDecoderQt.h:
+        * platform/graphics/wince/ImageWinCE.cpp:
+        (WebCore::ImageFrame::asNewNativeImage):
+        * platform/image-decoders/ImageDecoder.cpp:
+        (WebCore::ImageFrame::ImageFrame):
+        (WebCore::ImageFrame::operator=):
+        (WebCore::ImageFrame::clear):
+        (WebCore::ImageFrame::zeroFill):
+        (WebCore::ImageFrame::copyReferenceToBitmapData):
+        (WebCore::ImageFrame::copyBitmapData):
+        (WebCore::ImageFrame::setSize):
+        (WebCore::ImageFrame::hasAlpha):
+        (WebCore::ImageFrame::setHasAlpha):
+        (WebCore::ImageFrame::setColorProfile):
+        (WebCore::ImageFrame::setStatus):
+        (WebCore::ImageFrame::width):
+        (WebCore::ImageFrame::height):
+        * platform/image-decoders/ImageDecoder.h:
+        (WebCore::ImageFrame::ImageFrame):
+        * platform/image-decoders/bmp/BMPImageDecoder.cpp:
+        (WebCore::BMPImageDecoder::frameBufferAtIndex):
+        (WebCore::BMPImageDecoder::decode):
+        * platform/image-decoders/bmp/BMPImageDecoder.h:
+        * platform/image-decoders/bmp/BMPImageReader.cpp:
+        (WebCore::BMPImageReader::decodeBMP):
+        * platform/image-decoders/bmp/BMPImageReader.h:
+        (WebCore::BMPImageReader::setBuffer):
+        * platform/image-decoders/cairo/ImageDecoderCairo.cpp:
+        (WebCore::ImageFrame::asNewNativeImage):
+        * platform/image-decoders/cg/ImageDecoderCG.cpp:
+        (WebCore::getPtrAsPixelData):
+        (WebCore::ImageFrame::copyReferenceToBitmapData):
+        (WebCore::ImageFrame::copyBitmapData):
+        (WebCore::ImageFrame::setSize):
+        (WebCore::ImageFrame::asNewNativeImage):
+        * platform/image-decoders/gif/GIFImageDecoder.cpp:
+        (WebCore::GIFImageDecoder::frameBufferAtIndex):
+        (WebCore::GIFImageDecoder::clearFrameBufferCache):
+        (WebCore::GIFImageDecoder::haveDecodedRow):
+        (WebCore::GIFImageDecoder::frameComplete):
+        (WebCore::GIFImageDecoder::initFrameBuffer):
+        * platform/image-decoders/gif/GIFImageDecoder.h:
+        * platform/image-decoders/gif/GIFImageReader.cpp:
+        (GIFImageReader::read):
+        * platform/image-decoders/gif/GIFImageReader.h:
+        (GIFFrameReader::GIFFrameReader):
+        * platform/image-decoders/haiku/ImageDecoderHaiku.cpp:
+        (WebCore::ImageFrame::asNewNativeImage):
+        * platform/image-decoders/ico/ICOImageDecoder.cpp:
+        (WebCore::ICOImageDecoder::frameBufferAtIndex):
+        (WebCore::ICOImageDecoder::decode):
+        * platform/image-decoders/ico/ICOImageDecoder.h:
+        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
+        (WebCore::JPEGImageDecoder::frameBufferAtIndex):
+        (WebCore::JPEGImageDecoder::outputScanlines):
+        (WebCore::JPEGImageDecoder::jpegComplete):
+        (WebCore::JPEGImageDecoder::decode):
+        * platform/image-decoders/jpeg/JPEGImageDecoder.h:
+        * platform/image-decoders/openvg/ImageDecoderOpenVG.cpp:
+        (WebCore::ImageFrame::asNewNativeImage):
+        * platform/image-decoders/png/PNGImageDecoder.cpp:
+        (WebCore::PNGImageDecoder::frameBufferAtIndex):
+        (WebCore::PNGImageDecoder::rowAvailable):
+        (WebCore::PNGImageDecoder::pngComplete):
+        * platform/image-decoders/png/PNGImageDecoder.h:
+        (WebCore::PNGImageDecoder::isComplete):
+        * platform/image-decoders/qt/ImageFrameQt.cpp: Copied from Source/WebCore/platform/image-decoders/qt/RGBA32BufferQt.cpp.
+        (WebCore::ImageFrame::ImageFrame):
+        (WebCore::ImageFrame::operator=):
+        (WebCore::ImageFrame::clear):
+        (WebCore::ImageFrame::zeroFill):
+        (WebCore::ImageFrame::copyBitmapData):
+        (WebCore::ImageFrame::setSize):
+        (WebCore::ImageFrame::asNewNativeImage):
+        (WebCore::ImageFrame::hasAlpha):
+        (WebCore::ImageFrame::setHasAlpha):
+        (WebCore::ImageFrame::setColorProfile):
+        (WebCore::ImageFrame::setStatus):
+        (WebCore::ImageFrame::setPixmap):
+        (WebCore::ImageFrame::width):
+        (WebCore::ImageFrame::height):
+        * platform/image-decoders/qt/RGBA32BufferQt.cpp: Removed.
+        * platform/image-decoders/skia/ImageDecoderSkia.cpp:
+        (WebCore::ImageFrame::ImageFrame):
+        (WebCore::ImageFrame::operator=):
+        (WebCore::ImageFrame::clear):
+        (WebCore::ImageFrame::zeroFill):
+        (WebCore::ImageFrame::copyBitmapData):
+        (WebCore::ImageFrame::setSize):
+        (WebCore::ImageFrame::asNewNativeImage):
+        (WebCore::ImageFrame::hasAlpha):
+        (WebCore::ImageFrame::setHasAlpha):
+        (WebCore::ImageFrame::setColorProfile):
+        (WebCore::ImageFrame::setStatus):
+        (WebCore::ImageFrame::width):
+        (WebCore::ImageFrame::height):
+        * platform/image-decoders/webp/WEBPImageDecoder.cpp:
+        (WebCore::WEBPImageDecoder::frameBufferAtIndex):
+        (WebCore::WEBPImageDecoder::decode):
+        * platform/image-decoders/webp/WEBPImageDecoder.h:
+        * platform/image-decoders/wx/ImageDecoderWx.cpp:
+        (WebCore::ImageFrame::asNewNativeImage):
+
 2011-01-13  Dimitri Glazkov  <dglazkov@chromium.org>
 
         Reviewed by Darin Adler.
index c0f2989..819d569 100644 (file)
@@ -1180,7 +1180,7 @@ SOURCES += \
     platform/FileStream.cpp \
     platform/FileSystem.cpp \
     platform/GeolocationService.cpp \
-    platform/image-decoders/qt/RGBA32BufferQt.cpp \
+    platform/image-decoders/qt/ImageFrameQt.cpp \
     platform/graphics/FontDescription.cpp \
     platform/graphics/FontFallbackList.cpp \
     platform/graphics/FontFamily.cpp \
index 92553c5..984b7d2 100644 (file)
@@ -130,8 +130,8 @@ NativeImagePtr ImageSource::createFrameAtIndex(size_t index)
     if (!m_decoder)
         return 0;
 
-    RGBA32Buffer* buffer = m_decoder->frameBufferAtIndex(index);
-    if (!buffer || buffer->status() == RGBA32Buffer::FrameEmpty)
+    ImageFrame* buffer = m_decoder->frameBufferAtIndex(index);
+    if (!buffer || buffer->status() == ImageFrame::FrameEmpty)
         return 0;
 
     // Zero-height images can cause problems for some ports.  If we have an
@@ -149,8 +149,8 @@ float ImageSource::frameDurationAtIndex(size_t index)
     if (!m_decoder)
         return 0;
 
-    RGBA32Buffer* buffer = m_decoder->frameBufferAtIndex(index);
-    if (!buffer || buffer->status() == RGBA32Buffer::FrameEmpty)
+    ImageFrame* buffer = m_decoder->frameBufferAtIndex(index);
+    if (!buffer || buffer->status() == ImageFrame::FrameEmpty)
         return 0;
 
     // Many annoying ads specify a 0 duration to make an image flash as quickly as possible.
@@ -180,8 +180,8 @@ bool ImageSource::frameIsCompleteAtIndex(size_t index)
     if (!m_decoder)
         return false;
 
-    RGBA32Buffer* buffer = m_decoder->frameBufferAtIndex(index);
-    return buffer && buffer->status() == RGBA32Buffer::FrameComplete;
+    ImageFrame* buffer = m_decoder->frameBufferAtIndex(index);
+    return buffer && buffer->status() == ImageFrame::FrameComplete;
 }
 
 }
index 2bbb9ce..71352e4 100644 (file)
@@ -131,7 +131,7 @@ String ImageDecoderQt::filenameExtension() const
     return String(m_format.constData(), m_format.length());
 };
 
-RGBA32Buffer* ImageDecoderQt::frameBufferAtIndex(size_t index)
+ImageFrame* ImageDecoderQt::frameBufferAtIndex(size_t index)
 {
     // In case the ImageDecoderQt got recreated we don't know
     // yet how many images we are going to have and need to
@@ -145,8 +145,8 @@ RGBA32Buffer* ImageDecoderQt::frameBufferAtIndex(size_t index)
     if (index >= count)
         return 0;
 
-    RGBA32Buffer& frame = m_frameBufferCache[index];
-    if (frame.status() != RGBA32Buffer::FrameComplete && m_reader)
+    ImageFrame& frame = m_frameBufferCache[index];
+    if (frame.status() != ImageFrame::FrameComplete && m_reader)
         internalReadImage(index);
     return &frame;
 }
@@ -185,7 +185,7 @@ void ImageDecoderQt::internalReadImage(size_t frameIndex)
 
     // Attempt to return some memory
     for (int i = 0; i < m_frameBufferCache.size(); ++i) {
-        if (m_frameBufferCache[i].status() != RGBA32Buffer::FrameComplete)
+        if (m_frameBufferCache[i].status() != ImageFrame::FrameComplete)
             return;
     }
 
@@ -211,10 +211,10 @@ bool ImageDecoderQt::internalHandleCurrentImage(size_t frameIndex)
         return false;
     }
 
-    // now into the RGBA32Buffer - even if the image is not
-    RGBA32Buffer* const buffer = &m_frameBufferCache[frameIndex];
+    // now into the ImageFrame - even if the image is not
+    ImageFrame* const buffer = &m_frameBufferCache[frameIndex];
     buffer->setRect(m_reader->currentImageRect());
-    buffer->setStatus(RGBA32Buffer::FrameComplete);
+    buffer->setStatus(ImageFrame::FrameComplete);
     buffer->setDuration(m_reader->nextImageDelay());
     buffer->setPixmap(pixmap);
     return true;
index 23fb79a..bccb5be 100644 (file)
@@ -48,7 +48,7 @@ public:
     virtual bool isSizeAvailable();
     virtual size_t frameCount();
     virtual int repetitionCount() const;
-    virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
+    virtual ImageFrame* frameBufferAtIndex(size_t index);
 
     virtual String filenameExtension() const;
 
index c0b2b53..cfcc487 100644 (file)
@@ -41,7 +41,7 @@
 
 namespace WebCore {
 
-NativeImagePtr RGBA32Buffer::asNewNativeImage() const
+NativeImagePtr ImageFrame::asNewNativeImage() const
 {
     return SharedBitmap::create(m_backingStore, m_size, hasAlpha());
 }
index 58a7981..c458efb 100644 (file)
@@ -103,7 +103,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)
@@ -112,7 +112,7 @@ RGBA32Buffer::RGBA32Buffer()
 {
 } 
 
-RGBA32Buffer& RGBA32Buffer::operator=(const RGBA32Buffer& other)
+ImageFrame& ImageFrame::operator=(const ImageFrame& other)
 {
     if (this == &other)
         return *this;
@@ -126,7 +126,7 @@ RGBA32Buffer& RGBA32Buffer::operator=(const RGBA32Buffer& other)
     return *this;
 }
 
-void RGBA32Buffer::clear()
+void ImageFrame::clear()
 {
     m_backingStore.clear();
     m_bytes = 0;
@@ -137,7 +137,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;
@@ -145,13 +145,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;
@@ -163,7 +163,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...
@@ -179,32 +179,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();
 }
index 6e257c5..39deee2 100644 (file)
@@ -49,10 +49,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 {
@@ -71,13 +71,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.
@@ -88,11 +88,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
@@ -307,10 +307,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.
@@ -354,7 +354,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;
index 220a1ed..0d0e8a7 100644 (file)
@@ -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();
 }
 
index 5f4ed82..f5b9d5e 100644 (file)
@@ -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!
index 93bedf3..1805bc7 100644 (file)
@@ -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;
 }
 
index 0a6dc84..dfaa9ec 100644 (file)
@@ -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;
index d741882..618c1d0 100644 (file)
@@ -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*>(
index 03b4c8f..0b90107 100644 (file)
 
 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()));
index e92f264..e6de597 100644 (file)
@@ -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;
index 64240d4..dd401b8 100644 (file)
@@ -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:
index 1e033a3..420b355 100644 (file)
@@ -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);
index be5be19..b6eb943 100644 (file)
@@ -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;
index 47302f7..21c0e1f 100644 (file)
@@ -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));
index 92a7dcf..55e1dcb 100644 (file)
@@ -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();
     }
index c2af6a3..31d91c8 100644 (file)
@@ -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!
index 632d428..a255c25 100644 (file)
@@ -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();
 }
 
index 63f29ab..801f1ab 100644 (file)
@@ -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
index 061c5ab..d29317a 100644 (file)
@@ -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.
index 3fe4d3c..755d704 100644 (file)
@@ -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)
index 1e8902f..ec2e857 100644 (file)
@@ -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:
@@ -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();
 }
index 94d6e82..876a096 100644 (file)
@@ -31,7 +31,7 @@
 
 namespace WebCore {
 
-RGBA32Buffer::RGBA32Buffer()
+ImageFrame::ImageFrame()
     : m_status(FrameEmpty)
     , m_duration(0)
     , m_disposalMethod(DisposeNotSpecified)
@@ -39,7 +39,7 @@ RGBA32Buffer::RGBA32Buffer()
 {
 }
 
-RGBA32Buffer& RGBA32Buffer::operator=(const RGBA32Buffer& other)
+ImageFrame& ImageFrame::operator=(const ImageFrame& other)
 {
     if (this == &other)
         return *this;
@@ -56,7 +56,7 @@ RGBA32Buffer& RGBA32Buffer::operator=(const RGBA32Buffer& other)
     return *this;
 }
 
-void RGBA32Buffer::clear()
+void ImageFrame::clear()
 {
     m_bitmap.reset();
     m_status = FrameEmpty;
@@ -66,12 +66,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;
@@ -81,7 +81,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.
@@ -96,39 +96,39 @@ bool RGBA32Buffer::setSize(int newWidth, int newHeight)
     return true;
 }
 
-NativeImagePtr RGBA32Buffer::asNewNativeImage() const
+NativeImagePtr ImageFrame::asNewNativeImage() const
 {
     return new NativeImageSkia(m_bitmap);
 }
 
-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();
 }
index a988d9c..8045ada 100644 (file)
@@ -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;
index 6cf8870..cde1bbf 100644 (file)
@@ -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:
index 966eb90..9314bbe 100644 (file)
@@ -37,7 +37,7 @@
 
 namespace WebCore {
 
-NativeImagePtr RGBA32Buffer::asNewNativeImage() const
+NativeImagePtr ImageFrame::asNewNativeImage() const
 {
     wxBitmap* bmp = new wxBitmap(width(), height(), 32);
 
index ba8b800..189b59b 100644 (file)
@@ -1,3 +1,16 @@
+2011-01-13  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Rename RGBA32Buffer to ImageFrame
+        https://bugs.webkit.org/show_bug.cgi?id=52363
+
+        Update references to the new name.
+
+        * src/WebImageDecoder.cpp:
+        (WebKit::WebImageDecoder::isFrameCompleteAtIndex):
+        (WebKit::WebImageDecoder::getFrameAtIndex):
+
 2011-01-13  John Abd-El-Malek  <jam@chromium.org>
 
         Reviewed by Tony Chang.
index a17897c..87cf8e3 100644 (file)
@@ -97,16 +97,16 @@ size_t WebImageDecoder::frameCount() const
 bool WebImageDecoder::isFrameCompleteAtIndex(int index) const
 {
     ASSERT(m_private);
-    RGBA32Buffer* const frameBuffer = m_private->frameBufferAtIndex(index);
+    ImageFrame* const frameBuffer = m_private->frameBufferAtIndex(index);
     if (!frameBuffer)
         return false;
-    return (frameBuffer->status() == RGBA32Buffer::FrameComplete);
+    return (frameBuffer->status() == ImageFrame::FrameComplete);
 }
 
 WebImage WebImageDecoder::getFrameAtIndex(int index = 0) const
 {
     ASSERT(m_private);
-    RGBA32Buffer* const frameBuffer = m_private->frameBufferAtIndex(index);
+    ImageFrame* const frameBuffer = m_private->frameBufferAtIndex(index);
     if (!frameBuffer)
         return WebImage();
 #if WEBKIT_USING_SKIA