Changeset 93441 in webkit
- Timestamp:
- Aug 19, 2011 2:50:10 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r93440 r93441 1 2011-08-19 James Robinson <jamesr@chromium.org> 2 3 REGRESSION(r91628): 3 canvas tests crash on Chromium Linux and one test fail on Chromium Mac 4 https://bugs.webkit.org/show_bug.cgi?id=65063 5 6 Reviewed by Darin Fisher. 7 8 Fixes crashes due to a bad cast from Image to BitmapImage on skia ports 9 that use BitmapImageSingleFrameSkia. In the skia port 10 Image::isBitmapImage() returning true does not necessarily mean that 11 Image is of type BitmapImage. 12 13 Covered by fast/canvas/canvas-as-image.html and many other canvas 14 tests. 15 16 Patch originally by Tom Hudson. 17 18 * platform/graphics/BitmapImage.h: 19 (WebCore::BitmapImage::currentFrameHasAlpha): 20 (WebCore::BitmapImage::notSolidColor): 21 * platform/graphics/Image.cpp: 22 (WebCore::Image::drawTiled): 23 * platform/graphics/Image.h: 24 (WebCore::Image::currentFrameHasAlpha): 25 (WebCore::Image::notSolidColor): 26 * platform/graphics/skia/BitmapImageSingleFrameSkia.h: 27 (WebCore::BitmapImageSingleFrameSkia::currentFrameHasAlpha): 28 (WebCore::BitmapImageSingleFrameSkia::notSolidColor): 29 * rendering/RenderImage.cpp: 30 (WebCore::RenderImage::backgroundIsObscured): 31 1 32 2011-08-19 Emil A Eklund <eae@chromium.org> 2 33 -
trunk/Source/WebCore/platform/graphics/BitmapImage.h
r91628 r93441 160 160 virtual NativeImagePtr nativeImageForCurrentFrame() { return frameAtIndex(currentFrame()); } 161 161 bool frameHasAlphaAtIndex(size_t); 162 bool currentFrameHasAlpha() { return frameHasAlphaAtIndex(currentFrame()); }162 virtual bool currentFrameHasAlpha() { return frameHasAlphaAtIndex(currentFrame()); } 163 163 164 164 #if !ASSERT_DISABLED 165 bool notSolidColor()165 virtual bool notSolidColor() 166 166 { 167 167 return size().width() != 1 || size().height() != 1 || frameCount() > 1; -
trunk/Source/WebCore/platform/graphics/Image.cpp
r92068 r93441 116 116 // See <https://webkit.org/b/59043>. 117 117 #if !PLATFORM(WX) 118 ASSERT(!isBitmapImage() || static_cast<BitmapImage*>(this)->notSolidColor());118 ASSERT(!isBitmapImage() || notSolidColor()); 119 119 #endif 120 120 -
trunk/Source/WebCore/platform/graphics/Image.h
r91496 r93441 89 89 90 90 virtual bool isBitmapImage() const { return false; } 91 virtual bool currentFrameHasAlpha() { return false; } 91 92 92 93 // Derived classes should override this if they can assure that … … 158 159 const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect); 159 160 161 #if !ASSERT_DISABLED 162 virtual bool notSolidColor() { return true; } 163 #endif 164 160 165 protected: 161 166 Image(ImageObserver* = 0); -
trunk/Source/WebCore/platform/graphics/skia/BitmapImageSingleFrameSkia.h
r75469 r93441 54 54 virtual bool isBitmapImage() const { return true; } 55 55 56 virtual bool currentFrameHasAlpha() { return !m_nativeImage.isOpaque(); } 57 56 58 virtual IntSize size() const 57 59 { … … 73 75 } 74 76 77 #if !ASSERT_DISABLED 78 virtual bool notSolidColor() 79 { 80 return m_nativeImage.width() != 1 || m_nativeImage.height() != 1; 81 } 82 #endif 83 75 84 protected: 76 85 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator); -
trunk/Source/WebCore/rendering/RenderImage.cpp
r93279 r93441 409 409 // Check for bitmap image with alpha. 410 410 Image* image = m_imageResource->image().get(); 411 if (!image || !image->isBitmapImage() )411 if (!image || !image->isBitmapImage() || image->currentFrameHasAlpha()) 412 412 return false; 413 413 414 BitmapImage* bitmapImage = static_cast<BitmapImage*>(image);415 if (bitmapImage->currentFrameHasAlpha())416 return false;417 418 414 return true; 419 415 }
Note: See TracChangeset
for help on using the changeset viewer.