Changeset 65531 in webkit


Ignore:
Timestamp:
Aug 17, 2010 12:51:11 PM (14 years ago)
Author:
senorblanco@chromium.org
Message:

2010-08-17 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r65528.
http://trac.webkit.org/changeset/65528
https://bugs.webkit.org/show_bug.cgi?id=44123

"Broke a bunch of canvas tests on Chrome win/linux."
(Requested by senorblanco on #webkit).

  • platform/graphics/skia/BitmapImageSingleFrameSkia.h: (WebCore::BitmapImageSingleFrameSkia::BitmapImageSingleFrameSkia):
  • platform/graphics/skia/ImageBufferSkia.cpp: (WebCore::ImageBuffer::drawsUsingCopy): (WebCore::ImageBuffer::copyImage): (WebCore::ImageBuffer::draw): (WebCore::ImageBuffer::drawPattern):
  • platform/graphics/skia/ImageSkia.cpp: (WebCore::BitmapImageSingleFrameSkia::create):
  • platform/graphics/skia/NativeImageSkia.cpp:
  • platform/graphics/skia/NativeImageSkia.h:
Location:
trunk/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r65530 r65531  
     12010-08-17  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r65528.
     4        http://trac.webkit.org/changeset/65528
     5        https://bugs.webkit.org/show_bug.cgi?id=44123
     6
     7        "Broke a bunch of canvas tests on Chrome win/linux."
     8        (Requested by senorblanco on #webkit).
     9
     10        * platform/graphics/skia/BitmapImageSingleFrameSkia.h:
     11        (WebCore::BitmapImageSingleFrameSkia::BitmapImageSingleFrameSkia):
     12        * platform/graphics/skia/ImageBufferSkia.cpp:
     13        (WebCore::ImageBuffer::drawsUsingCopy):
     14        (WebCore::ImageBuffer::copyImage):
     15        (WebCore::ImageBuffer::draw):
     16        (WebCore::ImageBuffer::drawPattern):
     17        * platform/graphics/skia/ImageSkia.cpp:
     18        (WebCore::BitmapImageSingleFrameSkia::create):
     19        * platform/graphics/skia/NativeImageSkia.cpp:
     20        * platform/graphics/skia/NativeImageSkia.h:
     21
    1222010-08-17  Martin Robinson  <mrobinson@igalia.com>
    223
  • trunk/WebCore/platform/graphics/skia/BitmapImageSingleFrameSkia.h

    r65528 r65531  
    4747class BitmapImageSingleFrameSkia : public Image {
    4848public:
    49     // Creates a new Image from the given SkBitmap.  If "copyPixels" is true, a
    50     // deep copy is done.  Otherwise, a shallow copy is done (pixel data is
    51     // ref'ed).
    52     static PassRefPtr<BitmapImageSingleFrameSkia> create(const SkBitmap&, bool copyPixels);
     49    // Creates a new Image, by copying the pixel values out of |bitmap|.
     50    // If creation failed, returns null.
     51    static PassRefPtr<BitmapImageSingleFrameSkia> create(const SkBitmap&);
    5352
    5453    virtual bool isBitmapImage() const { return true; }
     
    7978    NativeImageSkia m_nativeImage;
    8079
    81     // Creates a new Image from the given SkBitmap, using a shallow copy.
    82     explicit BitmapImageSingleFrameSkia(const SkBitmap&);
     80    // Use create().
     81    BitmapImageSingleFrameSkia() { }
    8382};
    8483
  • trunk/WebCore/platform/graphics/skia/ImageBufferSkia.cpp

    r65528 r65531  
    9090bool ImageBuffer::drawsUsingCopy() const
    9191{
    92     return false;
     92    return true;
    9393}
    9494
    9595PassRefPtr<Image> ImageBuffer::copyImage() const
    9696{
    97     ASSERT_NOT_REACHED();
    98     return 0;
     97    return BitmapImageSingleFrameSkia::create(*m_data.m_platformContext.bitmap());
    9998}
    10099
     
    109108                       CompositeOperator op, bool useLowQualityScale)
    110109{
    111     RefPtr<Image> image = BitmapImageSingleFrameSkia::create(*m_data.m_platformContext.bitmap(), context == m_context);
    112     context->drawImage(image.get(), styleColorSpace, destRect, srcRect, op, useLowQualityScale);
     110    RefPtr<Image> imageCopy = copyImage();
     111    context->drawImage(imageCopy.get(), styleColorSpace, destRect, srcRect, op, useLowQualityScale);
    113112}
    114113
     
    116115                              const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect)
    117116{
    118     RefPtr<Image> image = BitmapImageSingleFrameSkia::create(*m_data.m_platformContext.bitmap(), context == m_context);
    119     image->drawPattern(context, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
     117    RefPtr<Image> imageCopy = copyImage();
     118    imageCopy->drawPattern(context, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
    120119}
    121120
  • trunk/WebCore/platform/graphics/skia/ImageSkia.cpp

    r65528 r65531  
    517517}
    518518
    519 BitmapImageSingleFrameSkia::BitmapImageSingleFrameSkia(const SkBitmap& bitmap)
    520     : m_nativeImage(bitmap)
    521 {
    522 }
    523 
    524 PassRefPtr<BitmapImageSingleFrameSkia> BitmapImageSingleFrameSkia::create(const SkBitmap& bitmap, bool copyPixels)
    525 {
    526     if (copyPixels) {
    527         SkBitmap temp;
    528         bitmap.copyTo(&temp, bitmap.config());
    529         return adoptRef(new BitmapImageSingleFrameSkia(temp));
    530     }
    531     return adoptRef(new BitmapImageSingleFrameSkia(bitmap));
     519PassRefPtr<BitmapImageSingleFrameSkia> BitmapImageSingleFrameSkia::create(const SkBitmap& bitmap)
     520{
     521    RefPtr<BitmapImageSingleFrameSkia> image(adoptRef(new BitmapImageSingleFrameSkia()));
     522    bitmap.copyTo(&image->m_nativeImage, bitmap.config());
     523    return image.release();
    532524}
    533525
  • trunk/WebCore/platform/graphics/skia/NativeImageSkia.cpp

    r65528 r65531  
    4040NativeImageSkia::NativeImageSkia()
    4141    : m_isDataComplete(false),
    42       m_lastRequestSize(0, 0),
    43       m_resizeRequests(0)
    44 {
    45 }
    46 
    47 NativeImageSkia::NativeImageSkia(const SkBitmap& other)
    48     : SkBitmap(other),
    49       m_isDataComplete(false),
    5042      m_lastRequestSize(0, 0),
    5143      m_resizeRequests(0)
  • trunk/WebCore/platform/graphics/skia/NativeImageSkia.h

    r65528 r65531  
    4343public:
    4444    NativeImageSkia();
    45 
    46     // This constructor does a shallow copy of the passed-in SkBitmap (ie., it
    47     // references the same pixel data and bumps the refcount).  Use only when
    48     // you want sharing semantics.
    49     explicit NativeImageSkia(const SkBitmap&);
    5045
    5146    // Returns the number of bytes of image data. This includes the cached
Note: See TracChangeset for help on using the changeset viewer.