Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp (106094 => 106095)
--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp 2012-01-27 07:19:13 UTC (rev 106094)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp 2012-01-27 07:23:22 UTC (rev 106095)
@@ -241,7 +241,7 @@
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));
@@ -249,19 +249,19 @@
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);
}
}