Changeset 70394 in webkit


Ignore:
Timestamp:
Oct 23, 2010 10:05:21 AM (14 years ago)
Author:
Dimitri Glazkov
Message:

2010-10-23 Dimitri Glazkov <Dimitri Glazkov>

Unreviewed, rolling out r70369.
http://trac.webkit.org/changeset/70369
https://bugs.webkit.org/show_bug.cgi?id=47974

Caused weird artifacts in expected results.

  • wtf/Platform.h:

2010-10-23 Dimitri Glazkov <Dimitri Glazkov>

Unreviewed, rolling out r70369.
http://trac.webkit.org/changeset/70369
https://bugs.webkit.org/show_bug.cgi?id=47974

Caused weird artifacts in expected results.

  • WebCore.gyp/WebCore.gyp:
  • WebCore.gypi:
  • loader/CachedImage.cpp: (WebCore::CachedImage::createImage):
  • platform/graphics/ImageSource.h:
  • platform/image-decoders/ImageDecoder.cpp: (WebCore::RGBA32Buffer::operator=): (WebCore::RGBA32Buffer::clear): (WebCore::RGBA32Buffer::zeroFill): (WebCore::RGBA32Buffer::copyBitmapData): (WebCore::RGBA32Buffer::setSize):
  • platform/image-decoders/ImageDecoder.h: (WebCore::RGBA32Buffer::getAddr):
  • platform/image-decoders/cairo/ImageDecoderCairo.cpp: (WebCore::RGBA32Buffer::asNewNativeImage):
  • platform/image-decoders/cg/ImageDecoderCG.cpp: Removed.
  • platform/image-decoders/haiku/ImageDecoderHaiku.cpp: (WebCore::RGBA32Buffer::asNewNativeImage):
  • platform/image-decoders/openvg/ImageDecoderOpenVG.cpp: (WebCore::RGBA32Buffer::asNewNativeImage):
  • platform/image-decoders/wx/ImageDecoderWx.cpp: (WebCore::RGBA32Buffer::asNewNativeImage):
Location:
trunk
Files:
1 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r70390 r70394  
     12010-10-23  Dimitri Glazkov  <dglazkov@chromium.org>
     2
     3        Unreviewed, rolling out r70369.
     4        http://trac.webkit.org/changeset/70369
     5        https://bugs.webkit.org/show_bug.cgi?id=47974
     6
     7        Caused weird artifacts in expected results.
     8
     9        * wtf/Platform.h:
     10
    1112010-10-23  Martin Robinson  <mrobinson@igalia.com>
    212
  • trunk/JavaScriptCore/wtf/Platform.h

    r70369 r70394  
    532532#endif
    533533
    534 #if PLATFORM(CHROMIUM)
    535 #define WTF_USE_WEBKIT_IMAGE_DECODERS 1
    536 #endif
    537 
    538534#if PLATFORM(BREWMP)
    539535#define WTF_PLATFORM_SKIA 1
  • trunk/WebCore/ChangeLog

    r70392 r70394  
     12010-10-23  Dimitri Glazkov  <dglazkov@chromium.org>
     2
     3        Unreviewed, rolling out r70369.
     4        http://trac.webkit.org/changeset/70369
     5        https://bugs.webkit.org/show_bug.cgi?id=47974
     6
     7        Caused weird artifacts in expected results.
     8
     9        * WebCore.gyp/WebCore.gyp:
     10        * WebCore.gypi:
     11        * loader/CachedImage.cpp:
     12        (WebCore::CachedImage::createImage):
     13        * platform/graphics/ImageSource.h:
     14        * platform/image-decoders/ImageDecoder.cpp:
     15        (WebCore::RGBA32Buffer::operator=):
     16        (WebCore::RGBA32Buffer::clear):
     17        (WebCore::RGBA32Buffer::zeroFill):
     18        (WebCore::RGBA32Buffer::copyBitmapData):
     19        (WebCore::RGBA32Buffer::setSize):
     20        * platform/image-decoders/ImageDecoder.h:
     21        (WebCore::RGBA32Buffer::getAddr):
     22        * platform/image-decoders/cairo/ImageDecoderCairo.cpp:
     23        (WebCore::RGBA32Buffer::asNewNativeImage):
     24        * platform/image-decoders/cg/ImageDecoderCG.cpp: Removed.
     25        * platform/image-decoders/haiku/ImageDecoderHaiku.cpp:
     26        (WebCore::RGBA32Buffer::asNewNativeImage):
     27        * platform/image-decoders/openvg/ImageDecoderOpenVG.cpp:
     28        (WebCore::RGBA32Buffer::asNewNativeImage):
     29        * platform/image-decoders/wx/ImageDecoderWx.cpp:
     30        (WebCore::RGBA32Buffer::asNewNativeImage):
     31
    1322010-10-23  Adam Barth  <abarth@webkit.org>
    233
  • trunk/WebCore/WebCore.gyp/WebCore.gyp

    r70369 r70394  
    11651165            ['exclude', 'platform/graphics/chromium/ImageChromium\\.cpp$'],
    11661166
    1167             # The Mac does not use ImageSourceCG.cpp from platform/graphics/cg
    1168             # even though it is included by regex above.
    1169             ['exclude', 'platform/graphics/cg/ImageSourceCG\\.cpp$'],
    1170             ['exclude', 'platform/graphics/cg/PDFDocumentImage\\.cpp$'],
    1171 
    1172             # ImageDecoderSkia is not used on mac.  ImageDecoderCG is used instead.
     1167            # The Mac uses ImageSourceCG.cpp from platform/graphics/cg, included
     1168            # by regex above, instead.
     1169            ['exclude', 'platform/graphics/ImageSource\\.cpp$'],
     1170
     1171            # Skia image-decoders are also not used on mac.  CoreGraphics
     1172            # is used directly instead.
     1173            ['exclude', 'platform/image-decoders/ImageDecoder\\.h$'],
     1174            ['exclude', 'platform/image-decoders/bmp/BMPImageDecoder\\.(cpp|h)$'],
     1175            ['exclude', 'platform/image-decoders/bmp/BMPImageReader\\.(cpp|h)$'],
     1176            ['exclude', 'platform/image-decoders/gif/GIFImageDecoder\\.(cpp|h)$'],
     1177            ['exclude', 'platform/image-decoders/gif/GIFImageReader\\.(cpp|h)$'],
     1178            ['exclude', 'platform/image-decoders/ico/ICOImageDecoder\\.(cpp|h)$'],
     1179            ['exclude', 'platform/image-decoders/jpeg/JPEGImageDecoder\\.(cpp|h)$'],
     1180            ['exclude', 'platform/image-decoders/webp/WEBPImageDecoder\\.(cpp|h)$'],
     1181            ['exclude', 'platform/image-decoders/png/PNGImageDecoder\\.(cpp|h)$'],
    11731182            ['exclude', 'platform/image-decoders/skia/ImageDecoderSkia\\.cpp$'],
    1174             ['include', 'platform/image-decoders/cg/ImageDecoderCG\\.cpp$'],
     1183            ['exclude', 'platform/image-decoders/xbm/XBMImageDecoder\\.(cpp|h)$'],
    11751184
    11761185            # Again, Skia is not used on Mac.
  • trunk/WebCore/WebCore.gypi

    r70369 r70394  
    28462846            'platform/image-decoders/bmp/BMPImageReader.h',
    28472847            'platform/image-decoders/cairo/ImageDecoderCairo.cpp',
    2848             'platform/image-decoders/cg/ImageDecoderCG.cpp',
    28492848            'platform/image-decoders/gif/GIFImageDecoder.cpp',
    28502849            'platform/image-decoders/gif/GIFImageDecoder.h',
  • trunk/WebCore/loader/CachedImage.cpp

    r70369 r70394  
    238238    if (m_image)
    239239        return;
    240 #if PLATFORM(CG) && !USE(WEBKIT_IMAGE_DECODERS)
     240#if PLATFORM(CG)
    241241    if (m_response.mimeType() == "application/pdf") {
    242242        m_image = PDFDocumentImage::create();
  • trunk/WebCore/platform/graphics/ImageSource.h

    r70369 r70394  
    6464
    6565#if PLATFORM(CG)
    66 #if USE(WEBKIT_IMAGE_DECODERS)
    67 class ImageDecoder;
    68 typedef ImageDecoder* NativeImageSourcePtr;
    69 #else
    7066typedef CGImageSourceRef NativeImageSourcePtr;
    71 #endif
    7267typedef CGImageRef NativeImagePtr;
    7368#elif PLATFORM(OPENVG)
  • trunk/WebCore/platform/image-decoders/ImageDecoder.cpp

    r70369 r70394  
    118118        return *this;
    119119
    120     copyReferenceToBitmapData(other);
     120    copyBitmapData(other);
    121121    setRect(other.rect());
    122122    setStatus(other.status());
     
    129129void RGBA32Buffer::clear()
    130130{
    131     m_backingStore.clear();
    132     m_bytes = 0;
     131    m_bytes.clear();
    133132    m_status = FrameEmpty;
    134133    // NOTE: Do not reset other members here; clearFrameBufferCache() calls this
     
    140139void RGBA32Buffer::zeroFill()
    141140{
    142     memset(m_bytes, 0, m_size.width() * m_size.height() * sizeof(PixelData));
     141    m_bytes.fill(0);
    143142    m_hasAlpha = true;
    144 }
    145 
    146 #if !PLATFORM(CF)
    147 
    148 void RGBA32Buffer::copyReferenceToBitmapData(const RGBA32Buffer& other)
    149 {
    150     ASSERT(this != &other);
    151     copyBitmapData(other);
    152143}
    153144
     
    157148        return true;
    158149
    159     m_backingStore = other.m_backingStore;
    160     m_bytes = m_backingStore.data();
     150    m_bytes = other.m_bytes;
    161151    m_size = other.m_size;
    162152    setHasAlpha(other.m_hasAlpha);
     
    168158    // NOTE: This has no way to check for allocation failure if the requested
    169159    // size was too big...
    170     m_backingStore.resize(newWidth * newHeight);
    171     m_bytes = m_backingStore.data();
     160    m_bytes.resize(newWidth * newHeight);
    172161    m_size = IntSize(newWidth, newHeight);
    173162
     
    177166    return true;
    178167}
    179 
    180 #endif
    181168
    182169bool RGBA32Buffer::hasAlpha() const
  • trunk/WebCore/platform/image-decoders/ImageDecoder.h

    r70369 r70394  
    8686        // Creates a new copy of the image data in |other|, so the two images
    8787        // can be modified independently.  Returns whether the copy succeeded.
    88         bool copyBitmapData(const RGBA32Buffer&);
    89 
    90         // Creates a new reference to the image data in |other|.  The two images
    91         // share a common backing store.
    92         void copyReferenceToBitmapData(const RGBA32Buffer&);
     88        bool copyBitmapData(const RGBA32Buffer& other);
    9389
    9490        // Copies the pixel data at [(startX, startY), (endX, startY)) to the
     
    142138
    143139    private:
    144 #if PLATFORM(CF)
    145         typedef RetainPtr<CFMutableDataRef> NativeBackingStore;
    146 #else
    147         typedef Vector<PixelData> NativeBackingStore;
    148 #endif
    149 
    150140        int width() const;
    151141        int height() const;
     
    160150            return reinterpret_cast_ptr<QRgb*>(m_image.scanLine(y)) + x;
    161151#else
    162             return m_bytes + (y * width()) + x;
     152            return m_bytes.data() + (y * width()) + x;
    163153#endif
    164154        }
     
    187177        IntSize m_size;
    188178#else
    189         NativeBackingStore m_backingStore;
    190         PixelData* m_bytes; // The memory is backed by m_backingStore.
    191         IntSize m_size; // The size of the buffer.  This should be the
    192                         // same as ImageDecoder::m_size.
    193         bool m_hasAlpha; // Whether or not any of the pixels in the buffer
    194                          // have transparency.
    195 #endif
    196         IntRect m_rect; // The rect of the original specified frame within
    197                         // the overall buffer.  This will always just be
    198                         // the entire buffer except for GIF frames whose
    199                         // original rect was smaller than the overall
    200                         // image size.
     179        Vector<PixelData> m_bytes;
     180        IntSize m_size;       // The size of the buffer.  This should be the
     181                              // same as ImageDecoder::m_size.
     182        bool m_hasAlpha;      // Whether or not any of the pixels in the buffer
     183                              // have transparency.
     184#endif
     185        IntRect m_rect;       // The rect of the original specified frame within
     186                              // the overall buffer.  This will always just be
     187                              // the entire buffer except for GIF frames whose
     188                              // original rect was smaller than the overall
     189                              // image size.
    201190        FrameStatus m_status; // Whether or not this frame is completely
    202191                              // finished decoding.
    203         unsigned m_duration; // The animation delay.
    204         FrameDisposalMethod m_disposalMethod; // What to do with this frame's data when
    205                                               // initializing the next frame.
    206         bool m_premultiplyAlpha; // Whether to premultiply alpha into R, G, B
    207                                  // channels; by default it's true.
     192        unsigned m_duration;  // The animation delay.
     193        FrameDisposalMethod m_disposalMethod;
     194                              // What to do with this frame's data when
     195                              // initializing the next frame.
     196        bool m_premultiplyAlpha;
     197                              // Whether to premultiply alpha into R, G, B
     198                              // channels; by default it's true.
    208199    };
    209200
  • trunk/WebCore/platform/image-decoders/cairo/ImageDecoderCairo.cpp

    r70369 r70394  
    3535    return cairo_image_surface_create_for_data(
    3636        reinterpret_cast<unsigned char*>(const_cast<PixelData*>(
    37             m_bytes)), CAIRO_FORMAT_ARGB32, width(), height(),
     37            m_bytes.data())), CAIRO_FORMAT_ARGB32, width(), height(),
    3838        width() * sizeof(PixelData));
    3939}
  • trunk/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp

    r70369 r70394  
    3737    OwnPtr<BBitmap> bitmap(new BBitmap(BRect(0, 0, width() - 1, height() - 1), 0, B_RGBA32, bytesPerRow));
    3838
    39     const uint8* source = reinterpret_cast<const uint8*>(m_bytes);
     39    const uint8* source = reinterpret_cast<const uint8*>(m_bytes.data());
    4040    uint8* destination = reinterpret_cast<uint8*>(bitmap->Bits());
    4141    int h = height();
  • trunk/WebCore/platform/image-decoders/openvg/ImageDecoderOpenVG.cpp

    r70369 r70394  
    6060            ASSERT_VG_NO_ERROR();
    6161
    62             PixelData* pixelData = const_cast<PixelData*>(m_bytes);
     62            PixelData* pixelData = const_cast<PixelData*>(m_bytes.data());
    6363            pixelData += (tileRect.y() * width()) + tileRect.x();
    6464
  • trunk/WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp

    r70369 r70394  
    4949        // This code works properly on both ppc and intel, meaning the issue is
    5050        // likely not an issue of byte order getting mixed up on different archs.
    51         const unsigned char* bytes = (const unsigned char*)m_bytes;
     51        const unsigned char* bytes = (const unsigned char*)m_bytes.data();
    5252        int rowCounter = 0;
    5353        long pixelCounter = 0;
    5454        WxPixelData::Iterator p(data);
    5555        WxPixelData::Iterator rowStart = p;
    56         for (size_t i = 0; i < m_size.width() * m_size.height() * sizeof(PixelData); i += sizeof(PixelData)) {
     56        for (size_t i = 0; i < m_bytes.size() * sizeof(PixelData); i += sizeof(PixelData)) {
    5757                p.Red() = bytes[i + 2];
    5858                p.Green() = bytes[i + 1];
Note: See TracChangeset for help on using the changeset viewer.