Changeset 65531 in webkit
- Timestamp:
- Aug 17, 2010 12:51:11 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r65530 r65531 1 2010-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 1 22 2010-08-17 Martin Robinson <mrobinson@igalia.com> 2 23 -
trunk/WebCore/platform/graphics/skia/BitmapImageSingleFrameSkia.h
r65528 r65531 47 47 class BitmapImageSingleFrameSkia : public Image { 48 48 public: 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&); 53 52 54 53 virtual bool isBitmapImage() const { return true; } … … 79 78 NativeImageSkia m_nativeImage; 80 79 81 // Creates a new Image from the given SkBitmap, using a shallow copy.82 explicit BitmapImageSingleFrameSkia(const SkBitmap&);80 // Use create(). 81 BitmapImageSingleFrameSkia() { } 83 82 }; 84 83 -
trunk/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
r65528 r65531 90 90 bool ImageBuffer::drawsUsingCopy() const 91 91 { 92 return false;92 return true; 93 93 } 94 94 95 95 PassRefPtr<Image> ImageBuffer::copyImage() const 96 96 { 97 ASSERT_NOT_REACHED(); 98 return 0; 97 return BitmapImageSingleFrameSkia::create(*m_data.m_platformContext.bitmap()); 99 98 } 100 99 … … 109 108 CompositeOperator op, bool useLowQualityScale) 110 109 { 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); 113 112 } 114 113 … … 116 115 const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect) 117 116 { 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); 120 119 } 121 120 -
trunk/WebCore/platform/graphics/skia/ImageSkia.cpp
r65528 r65531 517 517 } 518 518 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)); 519 PassRefPtr<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(); 532 524 } 533 525 -
trunk/WebCore/platform/graphics/skia/NativeImageSkia.cpp
r65528 r65531 40 40 NativeImageSkia::NativeImageSkia() 41 41 : 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),50 42 m_lastRequestSize(0, 0), 51 43 m_resizeRequests(0) -
trunk/WebCore/platform/graphics/skia/NativeImageSkia.h
r65528 r65531 43 43 public: 44 44 NativeImageSkia(); 45 46 // This constructor does a shallow copy of the passed-in SkBitmap (ie., it47 // references the same pixel data and bumps the refcount). Use only when48 // you want sharing semantics.49 explicit NativeImageSkia(const SkBitmap&);50 45 51 46 // Returns the number of bytes of image data. This includes the cached
Note: See TracChangeset
for help on using the changeset viewer.