summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/texmap/TextureMapper.h
diff options
context:
space:
mode:
authorTeng-Hui Zhu <ztenghui@google.com>2010-11-10 15:31:59 -0800
committerTeng-Hui Zhu <ztenghui@google.com>2010-11-17 13:35:59 -0800
commit28040489d744e0c5d475a88663056c9040ed5320 (patch)
treec463676791e4a63e452a95f0a12b2a8519730693 /WebCore/platform/graphics/texmap/TextureMapper.h
parenteff9be92c41913c92fb1d3b7983c071f3e718678 (diff)
downloadexternal_webkit-28040489d744e0c5d475a88663056c9040ed5320.zip
external_webkit-28040489d744e0c5d475a88663056c9040ed5320.tar.gz
external_webkit-28040489d744e0c5d475a88663056c9040ed5320.tar.bz2
Merge WebKit at r71558: Initial merge by git.
Change-Id: Ib345578fa29df7e4bc72b4f00e4a6fddcb754c4c
Diffstat (limited to 'WebCore/platform/graphics/texmap/TextureMapper.h')
-rw-r--r--WebCore/platform/graphics/texmap/TextureMapper.h35
1 files changed, 25 insertions, 10 deletions
diff --git a/WebCore/platform/graphics/texmap/TextureMapper.h b/WebCore/platform/graphics/texmap/TextureMapper.h
index 03c1c6d..250125b 100644
--- a/WebCore/platform/graphics/texmap/TextureMapper.h
+++ b/WebCore/platform/graphics/texmap/TextureMapper.h
@@ -57,6 +57,10 @@ public:
m_contentSize = size;
}
+ virtual void pack() { }
+ virtual void unpack() { }
+ virtual bool isPacked() const { return false; }
+
virtual PlatformGraphicsContext* beginPaint(const IntRect& dirtyRect) = 0;
virtual void endPaint() = 0;
virtual PlatformGraphicsContext* beginPaintMedia()
@@ -72,6 +76,9 @@ public:
inline IntSize contentSize() const { return m_contentSize; }
inline void setOffset(const IntPoint& o) { m_offset = o; }
inline IntPoint offset() const { return m_offset; }
+
+protected:
+
private:
int m_lockCount;
IntSize m_contentSize;
@@ -81,11 +88,11 @@ private:
// A "context" class used to encapsulate accelerated texture mapping functions: i.e. drawing a texture
// onto the screen or into another texture with a specified transform, opacity and mask.
-class TextureMapper : public RefCounted<TextureMapper> {
+class TextureMapper {
friend class BitmapTexture;
public:
- static PassRefPtr<TextureMapper> create(GraphicsContext*);
+ static PassOwnPtr<TextureMapper> create(GraphicsContext* graphicsContext = 0);
virtual ~TextureMapper() { }
virtual void drawTexture(const BitmapTexture& texture, const IntRect& target, const TransformationMatrix& matrix = TransformationMatrix(), float opacity = 1.0f, const BitmapTexture* maskTexture = 0) = 0;
@@ -97,20 +104,28 @@ public:
drawTexture(texture, IntRect(0, 0, texture.contentSize().width(), texture.contentSize().height()), matrix, opacity, 0);
}
+ virtual void setGraphicsContext(GraphicsContext*) { }
virtual void setClip(const IntRect&) = 0;
virtual bool allowSurfaceForRoot() const = 0;
virtual PassRefPtr<BitmapTexture> createTexture() = 0;
- virtual const char* type() const = 0;
- virtual void cleanup() {}
- GraphicsContext* graphicsContext() const
- {
- return m_gc;
- }
+ void setImageInterpolationQuality(InterpolationQuality quality) { m_interpolationQuality = quality; }
+ void setTextDrawingMode(int mode) { m_textDrawingMode = mode; }
+
+ InterpolationQuality imageInterpolationQuality() const { return m_interpolationQuality; }
+ int textDrawingMode() const { return m_textDrawingMode; }
+
+ void setViewportSize(const IntSize&);
protected:
- TextureMapper(GraphicsContext* gc) : m_gc(gc) {}
- GraphicsContext* m_gc;
+ TextureMapper()
+ : m_interpolationQuality(InterpolationDefault)
+ , m_textDrawingMode(cTextFill)
+ {}
+
+private:
+ InterpolationQuality m_interpolationQuality;
+ int m_textDrawingMode;
};
};