summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/graphics/cairo/ImageBufferCairo.cpp')
-rw-r--r--WebCore/platform/graphics/cairo/ImageBufferCairo.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp b/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
index db66276..976dcb4 100644
--- a/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
+++ b/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
@@ -38,10 +38,8 @@
#include "NotImplemented.h"
#include "Pattern.h"
#include "PlatformString.h"
-
#include <cairo.h>
#include <wtf/Vector.h>
-#include <math.h>
using namespace std;
@@ -100,7 +98,7 @@ GraphicsContext* ImageBuffer::context() const
bool ImageBuffer::drawsUsingCopy() const
{
- return true;
+ return false;
}
PassRefPtr<Image> ImageBuffer::copyImage() const
@@ -112,20 +110,23 @@ PassRefPtr<Image> ImageBuffer::copyImage() const
void ImageBuffer::clip(GraphicsContext*, const FloatRect&) const
{
notImplemented();
+ // See https://bugs.webkit.org/show_bug.cgi?id=23526 for why this is unimplemented.
}
void ImageBuffer::draw(GraphicsContext* context, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,
CompositeOperator op , bool useLowQualityScale)
{
- RefPtr<Image> imageCopy = copyImage();
- context->drawImage(imageCopy.get(), styleColorSpace, destRect, srcRect, op, useLowQualityScale);
+ // BitmapImage will release the passed in surface on destruction
+ RefPtr<Image> image = BitmapImage::create(cairo_surface_reference(m_data.m_surface));
+ context->drawImage(image.get(), styleColorSpace, destRect, srcRect, op, useLowQualityScale);
}
void ImageBuffer::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform,
const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect)
{
- RefPtr<Image> imageCopy = copyImage();
- imageCopy->drawPattern(context, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
+ // BitmapImage will release the passed in surface on destruction
+ RefPtr<Image> image = BitmapImage::create(cairo_surface_reference(m_data.m_surface));
+ image->drawPattern(context, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
}
void ImageBuffer::platformTransformColorSpace(const Vector<int>& lookUpTable)