Modified: trunk/Source/WebCore/ChangeLog (160188 => 160189)
--- trunk/Source/WebCore/ChangeLog 2013-12-05 20:42:13 UTC (rev 160188)
+++ trunk/Source/WebCore/ChangeLog 2013-12-05 20:44:41 UTC (rev 160189)
@@ -1,3 +1,24 @@
+2013-12-05 Myles C. Maxfield <[email protected]>
+
+ Cropping and drawing ImageBuffers results in uninitialized data being shown
+ https://bugs.webkit.org/show_bug.cgi?id=125271
+
+ Reviewed by Simon Fraser.
+
+ createCroppedImageIfNecessary() crops to the bottom left of the ImageBuffer
+ backing store instead of the top left. In addition, ImageBuffer::draw()
+ draws the entire ImageBuffer's backing store instead of just the relevant
+ portion of it.
+
+ No new tests are necessary because the existing tests already test this
+ functionality
+
+ * platform/graphics/cg/ImageBufferCG.cpp:
+ (WebCore::createCroppedImageIfNecessary): Crop to the top left of the
+ backing store
+ (WebCore::ImageBuffer::draw): Draw only the logical portion of the
+ backing store
+
2013-12-05 Joseph Pecoraro <[email protected]>
Remove stale ScriptGlobalObject methods
Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp (160188 => 160189)
--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp 2013-12-05 20:42:13 UTC (rev 160188)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp 2013-12-05 20:44:41 UTC (rev 160189)
@@ -204,7 +204,7 @@
{
if (image && (CGImageGetWidth(image) != static_cast<size_t>(bounds.width())
|| CGImageGetHeight(image) != static_cast<size_t>(bounds.height()))) {
- return adoptCF(CGImageCreateWithImageInRect(image, CGRectMake(0, static_cast<int>(CGImageGetHeight(image)) - bounds.height(), bounds.width(), bounds.height())));
+ return adoptCF(CGImageCreateWithImageInRect(image, CGRectMake(0, 0, bounds.width(), bounds.height())));
}
return image;
}
@@ -278,7 +278,7 @@
FloatRect adjustedSrcRect = srcRect;
adjustedSrcRect.scale(m_resolutionScale, m_resolutionScale);
- destContext->drawNativeImage(image.get(), internalSize(), colorSpace, destRect, adjustedSrcRect, op, blendMode);
+ destContext->drawNativeImage(image.get(), m_data.m_backingStoreSize, colorSpace, destRect, adjustedSrcRect, op, blendMode);
}
void ImageBuffer::drawPattern(GraphicsContext* destContext, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect)