Changeset 44661 in webkit


Ignore:
Timestamp:
Jun 13, 2009 6:00:20 PM (15 years ago)
Author:
pkasting@chromium.org
Message:

2009-06-13 Peter Kasting <pkasting@google.com>

Reviewed by Eric Seidel.

https://bugs.webkit.org/show_bug.cgi?id=25709 part ten
Make Skia use the root directory ImageDecoder.h and factor out most
Skia-specific bits into skia/ImageDecoderSkia.cpp. Also fix a pair of
style violations in ImageDecoderCairo.cpp. This is the last patch for
this bug, everything beyond this is an enhancement rather than
unforking.

  • platform/image-decoders/ImageDecoder.h: (WebCore::RGBA32Buffer::getAddr):
  • platform/image-decoders/cairo/ImageDecoderCairo.cpp: (WebCore::RGBA32Buffer::hasAlpha): (WebCore::RGBA32Buffer::setHasAlpha): (WebCore::setStatus):
  • platform/image-decoders/skia/ImageDecoder.h: Removed.
  • platform/image-decoders/skia/ImageDecoderSkia.cpp: Added. (WebCore::RGBA32Buffer::RGBA32Buffer): (WebCore::RGBA32Buffer::clear): (WebCore::RGBA32Buffer::zeroFill): (WebCore::RGBA32Buffer::copyBitmapData): (WebCore::RGBA32Buffer::setSize): (WebCore::RGBA32Buffer::asNewNativeImage): (WebCore::RGBA32Buffer::hasAlpha): (WebCore::RGBA32Buffer::setHasAlpha): (WebCore::RGBA32Buffer::setStatus): (WebCore::RGBA32Buffer::operator=): (WebCore::RGBA32Buffer::width): (WebCore::RGBA32Buffer::height):
Location:
trunk/WebCore
Files:
1 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r44659 r44661  
     12009-06-13  Peter Kasting  <pkasting@google.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=25709 part ten
     6        Make Skia use the root directory ImageDecoder.h and factor out most
     7        Skia-specific bits into skia/ImageDecoderSkia.cpp.  Also fix a pair of
     8        style violations in ImageDecoderCairo.cpp.  This is the last patch for
     9        this bug, everything beyond this is an enhancement rather than
     10        unforking.
     11
     12        * platform/image-decoders/ImageDecoder.h:
     13        (WebCore::RGBA32Buffer::getAddr):
     14        * platform/image-decoders/cairo/ImageDecoderCairo.cpp:
     15        (WebCore::RGBA32Buffer::hasAlpha):
     16        (WebCore::RGBA32Buffer::setHasAlpha):
     17        (WebCore::setStatus):
     18        * platform/image-decoders/skia/ImageDecoder.h: Removed.
     19        * platform/image-decoders/skia/ImageDecoderSkia.cpp: Added.
     20        (WebCore::RGBA32Buffer::RGBA32Buffer):
     21        (WebCore::RGBA32Buffer::clear):
     22        (WebCore::RGBA32Buffer::zeroFill):
     23        (WebCore::RGBA32Buffer::copyBitmapData):
     24        (WebCore::RGBA32Buffer::setSize):
     25        (WebCore::RGBA32Buffer::asNewNativeImage):
     26        (WebCore::RGBA32Buffer::hasAlpha):
     27        (WebCore::RGBA32Buffer::setHasAlpha):
     28        (WebCore::RGBA32Buffer::setStatus):
     29        (WebCore::RGBA32Buffer::operator=):
     30        (WebCore::RGBA32Buffer::width):
     31        (WebCore::RGBA32Buffer::height):
     32
    1332009-06-13  Victor Wang <victorw@chromium.org>
    234
  • trunk/WebCore/platform/image-decoders/ImageDecoder.h

    r44654 r44661  
    3535#include <wtf/Vector.h>
    3636
     37#if PLATFORM(SKIA)
     38#include "NativeImageSkia.h"
     39#include "SkBitmap.h"
     40#endif
     41
    3742namespace WebCore {
    3843
     
    5055            DisposeOverwritePrevious,  // Clear frame to previous framebuffer contents
    5156        };
     57#if PLATFORM(SKIA)
     58        typedef uint32_t PixelData;
     59#else
    5260        typedef unsigned PixelData;
     61#endif
    5362
    5463        RGBA32Buffer();
     
    94103        // allocation fails.  Calling this multiple times is undefined and may
    95104        // leak memory.
    96         bool setSize(int width, int height);
     105        bool setSize(int newWidth, int newHeight);
    97106
    98107        // To be used by ImageSource::createFrameAtIndex().  Returns a pointer
     
    109118        void setHasAlpha(bool alpha);
    110119        void setRect(const IntRect& r) { m_rect = r; }
    111         void setStatus(FrameStatus s) { m_status = s; }
     120        void setStatus(FrameStatus status);
    112121        void setDuration(unsigned duration) { m_duration = duration; }
    113122        void setDisposalMethod(FrameDisposalMethod method) { m_disposalMethod = method; }
     
    128137#if PLATFORM(CAIRO)
    129138            return m_bytes.data() + (y * width()) + x;
     139#elif PLATFORM(SKIA)
     140            return m_bitmap.getAddr32(x, y);
    130141#endif
    131142        }
     
    152163                              // same as ImageDecoder::m_size.
    153164        bool m_hasAlpha;      // Whether or not any of the pixels in the buffer have transparency.
     165#elif PLATFORM(SKIA)
     166        NativeImageSkia m_bitmap;
    154167#endif
    155168        IntRect m_rect;       // The rect of the original specified frame within the overall buffer.
  • trunk/WebCore/platform/image-decoders/cairo/ImageDecoderCairo.cpp

    r44653 r44661  
    6464}
    6565
    66 bool RGBA32Buffer::setSize(int width, int height)
     66bool RGBA32Buffer::setSize(int newWidth, int newHeight)
    6767{
    6868    // NOTE: This has no way to check for allocation failure if the
    6969    // requested size was too big...
    70     m_bytes.resize(width * height);
    71     m_size = IntSize(width, height);
     70    m_bytes.resize(newWidth * newHeight);
     71    m_size = IntSize(newWidth, newHeight);
    7272
    7373    // Zero the image.
     
    8585}
    8686
    87 bool RGBA32Buffer::hasAlpha() const {
     87bool RGBA32Buffer::hasAlpha() const
     88{
    8889    return m_hasAlpha;
    8990}
    9091
    91 void RGBA32Buffer::setHasAlpha(bool alpha) {
     92void RGBA32Buffer::setHasAlpha(bool alpha)
     93{
    9294    m_hasAlpha = alpha;
     95}
     96
     97void setStatus(FrameStatus status)
     98{
     99    m_status = status;
    93100}
    94101
Note: See TracChangeset for help on using the changeset viewer.