+2012-01-26 Matthew Delaney <mdelaney@apple.com>
+
+ ImageBuffer::draw should deep copy if drawing to an accelerated context
+ https://bugs.webkit.org/show_bug.cgi?id=77185
+
+ Reviewed by Simon Fraser.
+
+ No new tests since any test for this issue would be flaky at best.
+
+ * platform/graphics/cg/ImageBufferCG.cpp: Deep copy when drawing ourself into
+ an accelerated context for both draw and drawPattern.
+ (WebCore::ImageBuffer::draw):
+ (WebCore::ImageBuffer::drawPattern):
+
2012-01-26 Kevin Ollivier <kevino@theolliviers.com>
[wx] Unreviewed. Build fixes.
ColorSpace colorSpace = (destContext == m_context) ? ColorSpaceDeviceRGB : styleColorSpace;
RetainPtr<CGImageRef> image;
- if (destContext == m_context)
+ if (destContext == m_context || destContext->isAcceleratedContext())
image.adoptCF(copyNativeImage(CopyBackingStore)); // Drawing into our own buffer, need to deep copy.
else
image.adoptCF(copyNativeImage(DontCopyBackingStore));
destContext->drawNativeImage(image.get(), m_size, colorSpace, destRect, srcRect, op);
}
-void ImageBuffer::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect)
+void ImageBuffer::drawPattern(GraphicsContext* destContext, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect)
{
if (!m_context->isAcceleratedContext()) {
- if (context == m_context) {
+ if (destContext == m_context || destContext->isAcceleratedContext()) {
RefPtr<Image> copy = copyImage(CopyBackingStore); // Drawing into our own buffer, need to deep copy.
- copy->drawPattern(context, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
+ copy->drawPattern(destContext, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
} else {
RefPtr<Image> imageForRendering = copyImage(DontCopyBackingStore);
- imageForRendering->drawPattern(context, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
+ imageForRendering->drawPattern(destContext, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
}
} else {
RefPtr<Image> copy = copyImage(CopyBackingStore);
- copy->drawPattern(context, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
+ copy->drawPattern(destContext, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
}
}