Changeset 44051 in webkit


Ignore:
Timestamp:
May 22, 2009 11:39:04 AM (15 years ago)
Author:
pkasting@chromium.org
Message:

2009-05-22 Peter Kasting <pkasting@google.com>

Reviewed by Darin Fisher.

https://bugs.webkit.org/show_bug.cgi?id=25709 part one
Indent contents of namespaces in header files, to comply with the
style guide. No functional change.

  • platform/image-decoders/ImageDecoder.h: (WebCore::RGBA32Buffer::): (WebCore::RGBA32Buffer::RGBA32Buffer): (WebCore::RGBA32Buffer::clear): (WebCore::RGBA32Buffer::bytes): (WebCore::RGBA32Buffer::rect): (WebCore::RGBA32Buffer::height): (WebCore::RGBA32Buffer::status): (WebCore::RGBA32Buffer::duration): (WebCore::RGBA32Buffer::disposalMethod): (WebCore::RGBA32Buffer::hasAlpha): (WebCore::RGBA32Buffer::setRect): (WebCore::RGBA32Buffer::ensureHeight): (WebCore::RGBA32Buffer::setStatus): (WebCore::RGBA32Buffer::setDuration): (WebCore::RGBA32Buffer::setDisposalMethod): (WebCore::RGBA32Buffer::setHasAlpha): (WebCore::RGBA32Buffer::setRGBA): (WebCore::ImageDecoder::m_failed): (WebCore::ImageDecoder::~ImageDecoder): (WebCore::ImageDecoder::setData): (WebCore::ImageDecoder::size): (WebCore::ImageDecoder::frameCount): (WebCore::ImageDecoder::repetitionCount): (WebCore::ImageDecoder::supportsAlpha): (WebCore::ImageDecoder::failed): (WebCore::ImageDecoder::setFailed): (WebCore::ImageDecoder::clearFrameBufferCache):
  • platform/image-decoders/bmp/BMPImageDecoder.h: (WebCore::BMPImageDecoder::filenameExtension):
  • platform/image-decoders/gif/GIFImageDecoder.h: (WebCore::GIFImageDecoder::filenameExtension): (WebCore::GIFImageDecoder::frameDurationAtIndex): (WebCore::GIFImageDecoder::):
  • platform/image-decoders/ico/ICOImageDecoder.h: (WebCore::ICOImageDecoder::filenameExtension):
  • platform/image-decoders/jpeg/JPEGImageDecoder.h: (WebCore::JPEGImageDecoder::filenameExtension): (WebCore::JPEGImageDecoder::supportsAlpha): (WebCore::JPEGImageDecoder::reader): (WebCore::JPEGImageDecoder::setSize):
  • platform/image-decoders/png/PNGImageDecoder.h: (WebCore::PNGImageDecoder::filenameExtension): (WebCore::PNGImageDecoder::reader): (WebCore::PNGImageDecoder::decodingFailed):
  • platform/image-decoders/xbm/XBMImageDecoder.h: (WebCore::XBMImageDecoder::filenameExtension):
Location:
trunk/WebCore
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r44050 r44051  
     12009-05-22  Peter Kasting  <pkasting@google.com>
     2
     3        Reviewed by Darin Fisher.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=25709 part one
     6        Indent contents of namespaces in header files, to comply with the
     7        style guide.  No functional change.
     8
     9        * platform/image-decoders/ImageDecoder.h:
     10        (WebCore::RGBA32Buffer::):
     11        (WebCore::RGBA32Buffer::RGBA32Buffer):
     12        (WebCore::RGBA32Buffer::clear):
     13        (WebCore::RGBA32Buffer::bytes):
     14        (WebCore::RGBA32Buffer::rect):
     15        (WebCore::RGBA32Buffer::height):
     16        (WebCore::RGBA32Buffer::status):
     17        (WebCore::RGBA32Buffer::duration):
     18        (WebCore::RGBA32Buffer::disposalMethod):
     19        (WebCore::RGBA32Buffer::hasAlpha):
     20        (WebCore::RGBA32Buffer::setRect):
     21        (WebCore::RGBA32Buffer::ensureHeight):
     22        (WebCore::RGBA32Buffer::setStatus):
     23        (WebCore::RGBA32Buffer::setDuration):
     24        (WebCore::RGBA32Buffer::setDisposalMethod):
     25        (WebCore::RGBA32Buffer::setHasAlpha):
     26        (WebCore::RGBA32Buffer::setRGBA):
     27        (WebCore::ImageDecoder::m_failed):
     28        (WebCore::ImageDecoder::~ImageDecoder):
     29        (WebCore::ImageDecoder::setData):
     30        (WebCore::ImageDecoder::size):
     31        (WebCore::ImageDecoder::frameCount):
     32        (WebCore::ImageDecoder::repetitionCount):
     33        (WebCore::ImageDecoder::supportsAlpha):
     34        (WebCore::ImageDecoder::failed):
     35        (WebCore::ImageDecoder::setFailed):
     36        (WebCore::ImageDecoder::clearFrameBufferCache):
     37        * platform/image-decoders/bmp/BMPImageDecoder.h:
     38        (WebCore::BMPImageDecoder::filenameExtension):
     39        * platform/image-decoders/gif/GIFImageDecoder.h:
     40        (WebCore::GIFImageDecoder::filenameExtension):
     41        (WebCore::GIFImageDecoder::frameDurationAtIndex):
     42        (WebCore::GIFImageDecoder::):
     43        * platform/image-decoders/ico/ICOImageDecoder.h:
     44        (WebCore::ICOImageDecoder::filenameExtension):
     45        * platform/image-decoders/jpeg/JPEGImageDecoder.h:
     46        (WebCore::JPEGImageDecoder::filenameExtension):
     47        (WebCore::JPEGImageDecoder::supportsAlpha):
     48        (WebCore::JPEGImageDecoder::reader):
     49        (WebCore::JPEGImageDecoder::setSize):
     50        * platform/image-decoders/png/PNGImageDecoder.h:
     51        (WebCore::PNGImageDecoder::filenameExtension):
     52        (WebCore::PNGImageDecoder::reader):
     53        (WebCore::PNGImageDecoder::decodingFailed):
     54        * platform/image-decoders/xbm/XBMImageDecoder.h:
     55        (WebCore::XBMImageDecoder::filenameExtension):
     56
    1572009-05-22  Dominik Röttsches  <dominik.roettsches@access-company.com>
    258
  • trunk/WebCore/platform/image-decoders/ImageDecoder.h

    r40641 r44051  
    3535namespace WebCore {
    3636
    37 typedef Vector<unsigned> RGBA32Array;
     37    typedef Vector<unsigned> RGBA32Array;
    3838
    39 // The RGBA32Buffer object represents the decoded image data in RGBA32 format.  This buffer is what all
    40 // decoders write a single frame into.  Frames are then instantiated for drawing by being handed this buffer.
    41 class RGBA32Buffer
    42 {
    43 public:
    44     enum FrameStatus { FrameEmpty, FramePartial, FrameComplete };
    45     enum FrameDisposalMethod {
    46         // If you change the numeric values of these, make sure you audit all
    47         // users, as some users may cast raw values to/from these constants.
    48         DisposeNotSpecified = 0,       // Leave frame in framebuffer
    49         DisposeKeep = 1,               // Leave frame in framebuffer
    50         DisposeOverwriteBgcolor = 2,   // Clear frame to transparent
    51         DisposeOverwritePrevious = 3,  // Clear frame to previous framebuffer contents
     39    // The RGBA32Buffer object represents the decoded image data in RGBA32 format.  This buffer is what all
     40    // decoders write a single frame into.  Frames are then instantiated for drawing by being handed this buffer.
     41    class RGBA32Buffer
     42    {
     43    public:
     44        enum FrameStatus { FrameEmpty, FramePartial, FrameComplete };
     45        enum FrameDisposalMethod {
     46            // If you change the numeric values of these, make sure you audit all
     47            // users, as some users may cast raw values to/from these constants.
     48            DisposeNotSpecified = 0,       // Leave frame in framebuffer
     49            DisposeKeep = 1,               // Leave frame in framebuffer
     50            DisposeOverwriteBgcolor = 2,   // Clear frame to transparent
     51            DisposeOverwritePrevious = 3,  // Clear frame to previous framebuffer contents
     52        };
     53
     54        RGBA32Buffer() : m_height(0), m_status(FrameEmpty), m_duration(0),
     55                         m_disposalMethod(DisposeNotSpecified), m_hasAlpha(false)
     56        {}
     57
     58        void clear() {
     59          m_bytes.clear();
     60          m_status = FrameEmpty;
     61          // NOTE: Do not reset other members here; clearFrameBufferCache() calls
     62          // this to free the bitmap data, but other functions like
     63          // initFrameBuffer() and frameComplete() may still need to read other
     64          // metadata out of this frame later.
     65        }
     66
     67        const RGBA32Array& bytes() const { return m_bytes; }
     68        RGBA32Array& bytes() { return m_bytes; }
     69        const IntRect& rect() const { return m_rect; }
     70        unsigned height() const { return m_height; }
     71        FrameStatus status() const { return m_status; }
     72        unsigned duration() const { return m_duration; }
     73        FrameDisposalMethod disposalMethod() const { return m_disposalMethod; }
     74        bool hasAlpha() const { return m_hasAlpha; }
     75
     76        void setRect(const IntRect& r) { m_rect = r; }
     77        void ensureHeight(unsigned rowIndex) { if (rowIndex > m_height) m_height = rowIndex; }
     78        void setStatus(FrameStatus s) { m_status = s; }
     79        void setDuration(unsigned duration) { m_duration = duration; }
     80        void setDisposalMethod(FrameDisposalMethod method) { m_disposalMethod = method; }
     81        void setHasAlpha(bool alpha) { m_hasAlpha = alpha; }
     82
     83        static void setRGBA(unsigned& pos, unsigned r, unsigned g, unsigned b, unsigned a)
     84        {
     85            // We store this data pre-multiplied.
     86            if (a == 0)
     87                pos = 0;
     88            else {
     89                if (a < 255) {
     90                    float alphaPercent = a / 255.0f;
     91                    r = static_cast<unsigned>(r * alphaPercent);
     92                    g = static_cast<unsigned>(g * alphaPercent);
     93                    b = static_cast<unsigned>(b * alphaPercent);
     94                }
     95                pos = (a << 24 | r << 16 | g << 8 | b);
     96            }
     97        }
     98
     99    private:
     100        RGBA32Array m_bytes;
     101        IntRect m_rect;    // The rect of the original specified frame within the overall buffer.
     102                           // This will always just be the entire buffer except for GIF frames
     103                           // whose original rect was smaller than the overall image size.
     104        unsigned m_height; // The height (the number of rows we've fully decoded).
     105        FrameStatus m_status; // Whether or not this frame is completely finished decoding.
     106        unsigned m_duration; // The animation delay.
     107        FrameDisposalMethod m_disposalMethod; // What to do with this frame's data when initializing the next frame.
     108        bool m_hasAlpha; // Whether or not any of the pixels in the buffer have transparency.
    52109    };
    53110
    54     RGBA32Buffer() : m_height(0), m_status(FrameEmpty), m_duration(0),
    55                      m_disposalMethod(DisposeNotSpecified), m_hasAlpha(false)
    56     {}
     111    // The ImageDecoder class represents a base class for specific image format decoders
     112    // (e.g., GIF, JPG, PNG, ICO) to derive from.  All decoders decode into RGBA32 format
     113    // and the base class manages the RGBA32 frame cache.
     114    class ImageDecoder
     115    {
     116    public:
     117        ImageDecoder() :m_sizeAvailable(false), m_failed(false) {}
     118        virtual ~ImageDecoder() {}
    57119
    58     void clear() {
    59       m_bytes.clear();
    60       m_status = FrameEmpty;
    61       // NOTE: Do not reset other members here; clearFrameBufferCache() calls
    62       // this to free the bitmap data, but other functions like
    63       // initFrameBuffer() and frameComplete() may still need to read other
    64       // metadata out of this frame later.
    65     }
     120        // The the filename extension usually associated with an undecoded image of this type.
     121        virtual String filenameExtension() const = 0;
    66122
    67     const RGBA32Array& bytes() const { return m_bytes; }
    68     RGBA32Array& bytes() { return m_bytes; }
    69     const IntRect& rect() const { return m_rect; }
    70     unsigned height() const { return m_height; }
    71     FrameStatus status() const { return m_status; }
    72     unsigned duration() const { return m_duration; }
    73     FrameDisposalMethod disposalMethod() const { return m_disposalMethod; }
    74     bool hasAlpha() const { return m_hasAlpha; }
     123        // All specific decoder plugins must do something with the data they are given.
     124        virtual void setData(SharedBuffer* data, bool allDataReceived) { m_data = data; }
    75125
    76     void setRect(const IntRect& r) { m_rect = r; }
    77     void ensureHeight(unsigned rowIndex) { if (rowIndex > m_height) m_height = rowIndex; }
    78     void setStatus(FrameStatus s) { m_status = s; }
    79     void setDuration(unsigned duration) { m_duration = duration; }
    80     void setDisposalMethod(FrameDisposalMethod method) { m_disposalMethod = method; }
    81     void setHasAlpha(bool alpha) { m_hasAlpha = alpha; }
     126        // Whether or not the size information has been decoded yet.
     127        virtual bool isSizeAvailable() const = 0;
    82128
    83     static void setRGBA(unsigned& pos, unsigned r, unsigned g, unsigned b, unsigned a)
    84     {
    85         // We store this data pre-multiplied.
    86         if (a == 0)
    87             pos = 0;
    88         else {
    89             if (a < 255) {
    90                 float alphaPercent = a / 255.0f;
    91                 r = static_cast<unsigned>(r * alphaPercent);
    92                 g = static_cast<unsigned>(g * alphaPercent);
    93                 b = static_cast<unsigned>(b * alphaPercent);
    94             }
    95             pos = (a << 24 | r << 16 | g << 8 | b);
    96         }
    97     }
     129        // Requests the size.
     130        virtual IntSize size() const { return m_size; }
    98131
    99 private:
    100     RGBA32Array m_bytes;
    101     IntRect m_rect;    // The rect of the original specified frame within the overall buffer.
    102                        // This will always just be the entire buffer except for GIF frames
    103                        // whose original rect was smaller than the overall image size.
    104     unsigned m_height; // The height (the number of rows we've fully decoded).
    105     FrameStatus m_status; // Whether or not this frame is completely finished decoding.
    106     unsigned m_duration; // The animation delay.
    107     FrameDisposalMethod m_disposalMethod; // What to do with this frame's data when initializing the next frame.
    108     bool m_hasAlpha; // Whether or not any of the pixels in the buffer have transparency.
    109 };
     132        // The total number of frames for the image.  Classes that support multiple frames
     133        // will scan the image data for the answer if they need to (without necessarily
     134        // decoding all of the individual frames).
     135        virtual int frameCount() { return 1; }
    110136
    111 // The ImageDecoder class represents a base class for specific image format decoders
    112 // (e.g., GIF, JPG, PNG, ICO) to derive from.  All decoders decode into RGBA32 format
    113 // and the base class manages the RGBA32 frame cache.
    114 class ImageDecoder
    115 {
    116 public:
    117     ImageDecoder() :m_sizeAvailable(false), m_failed(false) {}
    118     virtual ~ImageDecoder() {}
     137        // The number of repetitions to perform for an animation loop.
     138        virtual int repetitionCount() const { return cAnimationNone; }
    119139
    120     // The the filename extension usually associated with an undecoded image of this type.
    121     virtual String filenameExtension() const = 0;
     140        // Called to obtain the RGBA32Buffer full of decoded data for rendering.  The
     141        // decoder plugin will decode as much of the frame as it can before handing
     142        // back the buffer.
     143        virtual RGBA32Buffer* frameBufferAtIndex(size_t index) = 0;
    122144
    123     // All specific decoder plugins must do something with the data they are given.
    124     virtual void setData(SharedBuffer* data, bool allDataReceived) { m_data = data; }
     145        // Whether or not the underlying image format even supports alpha transparency.
     146        virtual bool supportsAlpha() const { return true; }
    125147
    126     // Whether or not the size information has been decoded yet.
    127     virtual bool isSizeAvailable() const = 0;
     148        bool failed() const { return m_failed; }
     149        void setFailed() { m_failed = true; }
    128150
    129     // Requests the size.
    130     virtual IntSize size() const { return m_size; }
     151        // Wipe out frames in the frame buffer cache before |clearBeforeFrame|,
     152        // assuming this can be done without breaking decoding.  Different decoders
     153        // place different restrictions on what frames are safe to destroy, so this
     154        // is left to them to implement.
     155        // For convenience's sake, we provide a default (empty) implementation,
     156        // since in practice only GIFs will ever use this.
     157        virtual void clearFrameBufferCache(size_t clearBeforeFrame) { }
    131158
    132     // The total number of frames for the image.  Classes that support multiple frames
    133     // will scan the image data for the answer if they need to (without necessarily
    134     // decoding all of the individual frames).
    135     virtual int frameCount() { return 1; }
    136 
    137     // The number of repetitions to perform for an animation loop.
    138     virtual int repetitionCount() const { return cAnimationNone; }
    139 
    140     // Called to obtain the RGBA32Buffer full of decoded data for rendering.  The
    141     // decoder plugin will decode as much of the frame as it can before handing
    142     // back the buffer.
    143     virtual RGBA32Buffer* frameBufferAtIndex(size_t index) = 0;
    144 
    145     // Whether or not the underlying image format even supports alpha transparency.
    146     virtual bool supportsAlpha() const { return true; }
    147 
    148     bool failed() const { return m_failed; }
    149     void setFailed() { m_failed = true; }
    150 
    151     // Wipe out frames in the frame buffer cache before |clearBeforeFrame|,
    152     // assuming this can be done without breaking decoding.  Different decoders
    153     // place different restrictions on what frames are safe to destroy, so this
    154     // is left to them to implement.
    155     // For convenience's sake, we provide a default (empty) implementation,
    156     // since in practice only GIFs will ever use this.
    157     virtual void clearFrameBufferCache(size_t clearBeforeFrame) { }
    158 
    159 protected:
    160     RefPtr<SharedBuffer> m_data; // The encoded data.
    161     Vector<RGBA32Buffer> m_frameBufferCache;
    162     bool m_sizeAvailable;
    163     mutable bool m_failed;
    164     IntSize m_size;
    165 };
     159    protected:
     160        RefPtr<SharedBuffer> m_data; // The encoded data.
     161        Vector<RGBA32Buffer> m_frameBufferCache;
     162        bool m_sizeAvailable;
     163        mutable bool m_failed;
     164        IntSize m_size;
     165    };
    166166
    167167}
  • trunk/WebCore/platform/image-decoders/bmp/BMPImageDecoder.h

    r39396 r44051  
    3131namespace WebCore {
    3232
    33 class BMPImageReader;
     33    class BMPImageReader;
    3434
    35 // This class decodes the BMP image format.
    36 class BMPImageDecoder : public ImageDecoder
    37 {
    38 public:
    39     virtual String filenameExtension() const { return "bmp"; }
     35    // This class decodes the BMP image format.
     36    class BMPImageDecoder : public ImageDecoder
     37    {
     38    public:
     39        virtual String filenameExtension() const { return "bmp"; }
    4040
    41     // Whether or not the size information has been decoded yet.
    42     virtual bool isSizeAvailable() const;
     41        // Whether or not the size information has been decoded yet.
     42        virtual bool isSizeAvailable() const;
    4343
    44     virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
    45 };
     44        virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
     45    };
    4646
    4747}
  • trunk/WebCore/platform/image-decoders/gif/GIFImageDecoder.h

    r39396 r44051  
    3131namespace WebCore {
    3232
    33 class GIFImageDecoderPrivate;
     33    class GIFImageDecoderPrivate;
    3434
    35 // This class decodes the GIF image format.
    36 class GIFImageDecoder : public ImageDecoder
    37 {
    38 public:
    39     GIFImageDecoder();
    40     ~GIFImageDecoder();
     35    // This class decodes the GIF image format.
     36    class GIFImageDecoder : public ImageDecoder
     37    {
     38    public:
     39        GIFImageDecoder();
     40        ~GIFImageDecoder();
    4141
    42     virtual String filenameExtension() const { return "gif"; }
     42        virtual String filenameExtension() const { return "gif"; }
    4343
    44     // Take the data and store it.
    45     virtual void setData(SharedBuffer* data, bool allDataReceived);
     44        // Take the data and store it.
     45        virtual void setData(SharedBuffer* data, bool allDataReceived);
    4646
    47     // Whether or not the size information has been decoded yet.
    48     virtual bool isSizeAvailable() const;
     47        // Whether or not the size information has been decoded yet.
     48        virtual bool isSizeAvailable() const;
    4949
    50     // The total number of frames for the image.  Will scan the image data for the answer
    51     // (without necessarily decoding all of the individual frames).
    52     virtual int frameCount();
     50        // The total number of frames for the image.  Will scan the image data for the answer
     51        // (without necessarily decoding all of the individual frames).
     52        virtual int frameCount();
    5353
    54     // The number of repetitions to perform for an animation loop.
    55     virtual int repetitionCount() const;
     54        // The number of repetitions to perform for an animation loop.
     55        virtual int repetitionCount() const;
    5656
    57     virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
     57        virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
    5858
    59     virtual void clearFrameBufferCache(size_t clearBeforeFrame);
     59        virtual void clearFrameBufferCache(size_t clearBeforeFrame);
    6060
    61     virtual unsigned frameDurationAtIndex(size_t index) { return 0; }
     61        virtual unsigned frameDurationAtIndex(size_t index) { return 0; }
    6262
    63     enum GIFQuery { GIFFullQuery, GIFSizeQuery, GIFFrameCountQuery };
     63        enum GIFQuery { GIFFullQuery, GIFSizeQuery, GIFFrameCountQuery };
    6464
    65     void decode(GIFQuery query, unsigned haltAtFrame) const;
     65        void decode(GIFQuery query, unsigned haltAtFrame) const;
    6666
    67     // Callbacks from the GIF reader.
    68     void sizeNowAvailable(unsigned width, unsigned height);
    69     void decodingHalted(unsigned bytesLeft);
    70     void haveDecodedRow(unsigned frameIndex, unsigned char* rowBuffer, unsigned char* rowEnd, unsigned rowNumber,
    71                         unsigned repeatCount, bool writeTransparentPixels);
    72     void frameComplete(unsigned frameIndex, unsigned frameDuration, RGBA32Buffer::FrameDisposalMethod disposalMethod);
    73     void gifComplete();
     67        // Callbacks from the GIF reader.
     68        void sizeNowAvailable(unsigned width, unsigned height);
     69        void decodingHalted(unsigned bytesLeft);
     70        void haveDecodedRow(unsigned frameIndex, unsigned char* rowBuffer, unsigned char* rowEnd, unsigned rowNumber,
     71                            unsigned repeatCount, bool writeTransparentPixels);
     72        void frameComplete(unsigned frameIndex, unsigned frameDuration, RGBA32Buffer::FrameDisposalMethod disposalMethod);
     73        void gifComplete();
    7474
    75 private:
    76     // Called to initialize the frame buffer with the given index, based on the
    77     // previous frame's disposal method.
    78     void initFrameBuffer(unsigned frameIndex);
     75    private:
     76        // Called to initialize the frame buffer with the given index, based on the
     77        // previous frame's disposal method.
     78        void initFrameBuffer(unsigned frameIndex);
    7979
    80     // A helper for initFrameBuffer(), this sets the size of the buffer, and
    81     // fills it with transparent pixels.
    82     void prepEmptyFrameBuffer(RGBA32Buffer* buffer) const;
     80        // A helper for initFrameBuffer(), this sets the size of the buffer, and
     81        // fills it with transparent pixels.
     82        void prepEmptyFrameBuffer(RGBA32Buffer* buffer) const;
    8383
    84     bool m_frameCountValid;
    85     bool m_currentBufferSawAlpha;
    86     mutable int m_repetitionCount;
    87     mutable GIFImageDecoderPrivate* m_reader;
    88 };
     84        bool m_frameCountValid;
     85        bool m_currentBufferSawAlpha;
     86        mutable int m_repetitionCount;
     87        mutable GIFImageDecoderPrivate* m_reader;
     88    };
    8989
    9090}
  • trunk/WebCore/platform/image-decoders/ico/ICOImageDecoder.h

    r39396 r44051  
    3131namespace WebCore {
    3232
    33 class ICOImageReader;
     33    class ICOImageReader;
    3434
    35 // This class decodes the ICO and CUR image formats.
    36 class ICOImageDecoder : public ImageDecoder
    37 {
    38 public:
    39     virtual String filenameExtension() const { return "ico"; }
     35    // This class decodes the ICO and CUR image formats.
     36    class ICOImageDecoder : public ImageDecoder
     37    {
     38    public:
     39        virtual String filenameExtension() const { return "ico"; }
    4040
    41     // Whether or not the size information has been decoded yet.
    42     virtual bool isSizeAvailable() const;
     41        // Whether or not the size information has been decoded yet.
     42        virtual bool isSizeAvailable() const;
    4343
    44     virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
    45 };
     44        virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
     45    };
    4646
    4747}
  • trunk/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h

    r39396 r44051  
    3131namespace WebCore {
    3232
    33 class JPEGImageReader;
     33    class JPEGImageReader;
    3434
    35 // This class decodes the JPEG image format.
    36 class JPEGImageDecoder : public ImageDecoder
    37 {
    38 public:
    39     JPEGImageDecoder();
    40     ~JPEGImageDecoder();
     35    // This class decodes the JPEG image format.
     36    class JPEGImageDecoder : public ImageDecoder
     37    {
     38    public:
     39        JPEGImageDecoder();
     40        ~JPEGImageDecoder();
    4141
    42     virtual String filenameExtension() const { return "jpg"; }
     42        virtual String filenameExtension() const { return "jpg"; }
    4343
    44     // Take the data and store it.
    45     virtual void setData(SharedBuffer* data, bool allDataReceived);
     44        // Take the data and store it.
     45        virtual void setData(SharedBuffer* data, bool allDataReceived);
    4646
    47     // Whether or not the size information has been decoded yet.
    48     virtual bool isSizeAvailable() const;
     47        // Whether or not the size information has been decoded yet.
     48        virtual bool isSizeAvailable() const;
    4949
    50     virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
    51    
    52     virtual bool supportsAlpha() const { return false; }
     50        virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
     51       
     52        virtual bool supportsAlpha() const { return false; }
    5353
    54     void decode(bool sizeOnly = false) const;
     54        void decode(bool sizeOnly = false) const;
    5555
    56     JPEGImageReader* reader() { return m_reader; }
     56        JPEGImageReader* reader() { return m_reader; }
    5757
    58     void setSize(int width, int height) {
    59         if (!m_sizeAvailable) {
    60             m_sizeAvailable = true;
    61             m_size = IntSize(width, height);
     58        void setSize(int width, int height) {
     59            if (!m_sizeAvailable) {
     60                m_sizeAvailable = true;
     61                m_size = IntSize(width, height);
     62            }
    6263        }
    63     }
    6464
    65     bool outputScanlines();
    66     void jpegComplete();
     65        bool outputScanlines();
     66        void jpegComplete();
    6767
    68 private:
    69     mutable JPEGImageReader* m_reader;
    70 };
     68    private:
     69        mutable JPEGImageReader* m_reader;
     70    };
    7171
    7272}
  • trunk/WebCore/platform/image-decoders/png/PNGImageDecoder.h

    r39396 r44051  
    3131namespace WebCore {
    3232
    33 class PNGImageReader;
     33    class PNGImageReader;
    3434
    35 // This class decodes the PNG image format.
    36 class PNGImageDecoder : public ImageDecoder
    37 {
    38 public:
    39     PNGImageDecoder();
    40     ~PNGImageDecoder();
     35    // This class decodes the PNG image format.
     36    class PNGImageDecoder : public ImageDecoder
     37    {
     38    public:
     39        PNGImageDecoder();
     40        ~PNGImageDecoder();
    4141
    42     virtual String filenameExtension() const { return "png"; }
     42        virtual String filenameExtension() const { return "png"; }
    4343
    44     // Take the data and store it.
    45     virtual void setData(SharedBuffer* data, bool allDataReceived);
     44        // Take the data and store it.
     45        virtual void setData(SharedBuffer* data, bool allDataReceived);
    4646
    47     // Whether or not the size information has been decoded yet.
    48     virtual bool isSizeAvailable() const;
     47        // Whether or not the size information has been decoded yet.
     48        virtual bool isSizeAvailable() const;
    4949
    50     virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
     50        virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
    5151
    52     void decode(bool sizeOnly = false) const;
     52        void decode(bool sizeOnly = false) const;
    5353
    54     PNGImageReader* reader() { return m_reader; }
     54        PNGImageReader* reader() { return m_reader; }
    5555
    56     // Callbacks from libpng
    57     void decodingFailed() { m_failed = true; }
    58     void headerAvailable();
    59     void rowAvailable(unsigned char* rowBuffer, unsigned rowIndex, int interlacePass);
    60     void pngComplete();
     56        // Callbacks from libpng
     57        void decodingFailed() { m_failed = true; }
     58        void headerAvailable();
     59        void rowAvailable(unsigned char* rowBuffer, unsigned rowIndex, int interlacePass);
     60        void pngComplete();
    6161
    62 private:
    63     mutable PNGImageReader* m_reader;
    64 };
     62    private:
     63        mutable PNGImageReader* m_reader;
     64    };
    6565
    6666}
  • trunk/WebCore/platform/image-decoders/xbm/XBMImageDecoder.h

    r39396 r44051  
    3131namespace WebCore {
    3232
    33 class XBMImageReader;
     33    class XBMImageReader;
    3434
    35 // This class decodes the XBM image format.
    36 class XBMImageDecoder : public ImageDecoder
    37 {
    38 public:
    39     virtual String filenameExtension() const { return "xbm"; }
     35    // This class decodes the XBM image format.
     36    class XBMImageDecoder : public ImageDecoder
     37    {
     38    public:
     39        virtual String filenameExtension() const { return "xbm"; }
    4040
    41     // Whether or not the size information has been decoded yet.
    42     virtual bool isSizeAvailable() const;
     41        // Whether or not the size information has been decoded yet.
     42        virtual bool isSizeAvailable() const;
    4343
    44     virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
    45 };
     44        virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
     45    };
    4646
    4747}
Note: See TracChangeset for help on using the changeset viewer.