Changeset 84213 in webkit


Ignore:
Timestamp:
Apr 18, 2011 6:35:15 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-04-18 John Bauman <jbauman@chromium.org>

Reviewed by Kenneth Russell.

Don't cast BitmapImageSingleFrameSkia to BitmapImage
https://bugs.webkit.org/show_bug.cgi?id=58821

BitmapImageSingleFrameSkia has isBitmap return true, but
can't be cast to a BitmapImage. Instead of using BitmapImage,
use isOpaque from SkBitmap to determine if the image has alpha.

No new tests.

  • platform/graphics/skia/GraphicsContext3DSkia.cpp: (WebCore::GraphicsContext3D::getImageData):
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r84208 r84213  
     12011-04-18  John Bauman  <jbauman@chromium.org>
     2
     3        Reviewed by Kenneth Russell.
     4
     5        Don't cast BitmapImageSingleFrameSkia to BitmapImage
     6        https://bugs.webkit.org/show_bug.cgi?id=58821
     7
     8        BitmapImageSingleFrameSkia has isBitmap return true, but
     9        can't be cast to a BitmapImage. Instead of using BitmapImage,
     10        use isOpaque from SkBitmap to determine if the image has alpha.
     11
     12        No new tests.
     13
     14        * platform/graphics/skia/GraphicsContext3DSkia.cpp:
     15        (WebCore::GraphicsContext3D::getImageData):
     16
    1172011-04-18  Jessie Berlin  <jberlin@apple.com>
    218
  • trunk/Source/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp

    r82728 r84213  
    5252        return false;
    5353    OwnPtr<NativeImageSkia> pixels;
    54     NativeImageSkia* skiaImage = 0;
     54    NativeImageSkia* skiaImage = image->nativeImageForCurrentFrame();
    5555    AlphaOp neededAlphaOp = AlphaDoNothing;
    56     bool hasAlpha = image->isBitmapImage() ? static_cast<BitmapImage*>(image)->frameHasAlphaAtIndex(0) : true;
    57     if ((ignoreGammaAndColorProfile || (hasAlpha && !premultiplyAlpha)) && image->data()) {
     56    bool hasAlpha = skiaImage ? !skiaImage->isOpaque() : true;
     57    if ((!skiaImage || ignoreGammaAndColorProfile || (hasAlpha && !premultiplyAlpha)) && image->data()) {
    5858        ImageSource decoder(ImageSource::AlphaNotPremultiplied,
    5959                            ignoreGammaAndColorProfile ? ImageSource::GammaAndColorProfileIgnored : ImageSource::GammaAndColorProfileApplied);
     
    7272        if (hasAlpha && premultiplyAlpha)
    7373            neededAlphaOp = AlphaDoPremultiply;
    74     } else {
    75         skiaImage = image->nativeImageForCurrentFrame();
    76         if (!premultiplyAlpha && hasAlpha)
    77             neededAlphaOp = AlphaDoUnmultiply;
    78     }
     74    } else if (!premultiplyAlpha && hasAlpha)
     75        neededAlphaOp = AlphaDoUnmultiply;
    7976    if (!skiaImage)
    8077        return false;
Note: See TracChangeset for help on using the changeset viewer.