summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/ImageBuffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/graphics/ImageBuffer.h')
-rw-r--r--WebCore/platform/graphics/ImageBuffer.h27
1 files changed, 18 insertions, 9 deletions
diff --git a/WebCore/platform/graphics/ImageBuffer.h b/WebCore/platform/graphics/ImageBuffer.h
index a54c721..3c0508e 100644
--- a/WebCore/platform/graphics/ImageBuffer.h
+++ b/WebCore/platform/graphics/ImageBuffer.h
@@ -29,6 +29,7 @@
#define ImageBuffer_h
#include "AffineTransform.h"
+#include "FloatRect.h"
#include "Image.h"
#include "IntSize.h"
#include "ImageBufferData.h"
@@ -71,16 +72,13 @@ namespace WebCore {
~ImageBuffer();
const IntSize& size() const { return m_size; }
+ int width() const { return m_size.width(); }
+ int height() const { return m_size.height(); }
+
GraphicsContext* context() const;
- Image* image() const;
-#if PLATFORM(QT)
- Image* imageForRendering() const;
-#else
- Image* imageForRendering() const { return image(); }
-#endif
-
- void clearImage() { m_image.clear(); }
+ bool drawsUsingCopy() const; // If the image buffer has to render using a copied image, it will return true.
+ PassRefPtr<Image> copyImage() const; // Return a new image that is a copy of the buffer.
PassRefPtr<ImageData> getUnmultipliedImageData(const IntRect&) const;
PassRefPtr<ImageData> getPremultipliedImageData(const IntRect&) const;
@@ -96,12 +94,23 @@ namespace WebCore {
#else
AffineTransform baseTransform() const { return AffineTransform(1, 0, 0, -1, 0, m_size.height()); }
#endif
+
+ private:
+ void clip(GraphicsContext*, const FloatRect&) const;
+
+ // The draw method draws the contents of the buffer without copying it.
+ void draw(GraphicsContext*, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1),
+ CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false);
+ void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
+ const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect);
+ friend class GraphicsContext;
+ friend class GeneratedImage;
+
private:
ImageBufferData m_data;
IntSize m_size;
OwnPtr<GraphicsContext> m_context;
- mutable RefPtr<Image> m_image;
#if !PLATFORM(CG)
Vector<int> m_linearRgbLUT;