summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/chromium/GLES2Canvas.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/graphics/chromium/GLES2Canvas.h')
-rw-r--r--Source/WebCore/platform/graphics/chromium/GLES2Canvas.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/Source/WebCore/platform/graphics/chromium/GLES2Canvas.h b/Source/WebCore/platform/graphics/chromium/GLES2Canvas.h
index 6fc1a0e..605f86f 100644
--- a/Source/WebCore/platform/graphics/chromium/GLES2Canvas.h
+++ b/Source/WebCore/platform/graphics/chromium/GLES2Canvas.h
@@ -48,13 +48,16 @@ class Color;
class DrawingBuffer;
class FloatRect;
class GraphicsContext3D;
+class Path;
class SharedGraphicsContext3D;
-class GLES2Canvas : public Noncopyable {
+class GLES2Canvas {
+ WTF_MAKE_NONCOPYABLE(GLES2Canvas);
public:
GLES2Canvas(SharedGraphicsContext3D*, DrawingBuffer*, const IntSize&);
~GLES2Canvas();
+ void fillPath(const Path&);
void fillRect(const FloatRect&, const Color&, ColorSpace);
void fillRect(const FloatRect&);
void clearRect(const FloatRect&);
@@ -65,6 +68,8 @@ public:
void rotate(float angleInRadians);
void scale(const FloatSize&);
void concatCTM(const AffineTransform&);
+ void clipPath(const Path&);
+ void clipOut(const Path&);
void save();
void restore();
@@ -72,9 +77,13 @@ public:
// non-standard functions
// These are not standard GraphicsContext functions, and should be pushed
// down into a PlatformContextGLES2 at some point.
+
+ // This version is called by the canvas->canvas draws.
void drawTexturedRect(unsigned texture, const IntSize& textureSize, const FloatRect& srcRect, const FloatRect& dstRect, ColorSpace, CompositeOperator);
- void drawTexturedRect(Texture*, const FloatRect& srcRect, const FloatRect& dstRect, const AffineTransform&, float alpha, ColorSpace, CompositeOperator);
+ // This version is called by BitmapImage::draw().
void drawTexturedRect(Texture*, const FloatRect& srcRect, const FloatRect& dstRect, ColorSpace, CompositeOperator);
+ // This version is called by the above, and by the software->hardware uploads.
+ void drawTexturedRect(Texture*, const FloatRect& srcRect, const FloatRect& dstRect, const AffineTransform&, float alpha, ColorSpace, CompositeOperator, bool clip);
Texture* createTexture(NativeImagePtr, Texture::Format, int width, int height);
Texture* getTexture(NativeImagePtr);
@@ -88,6 +97,10 @@ private:
void drawTexturedRectTile(Texture* texture, int tile, const FloatRect& srcRect, const FloatRect& dstRect, const AffineTransform&, float alpha);
void drawQuad(const IntSize& textureSize, const FloatRect& srcRect, const FloatRect& dstRect, const AffineTransform&, float alpha);
void applyCompositeOperator(CompositeOperator);
+ void createVertexBufferFromPath(const Path&, int* count, unsigned* vertexBuffer, unsigned* indexBuffer);
+ void fillPath(const Path&, const Color&);
+ void beginStencilDraw();
+ void applyClipping(bool enable);
void checkGLError(const char* header);
IntSize m_size;
@@ -96,7 +109,8 @@ private:
DrawingBuffer* m_drawingBuffer;
struct State;
- WTF::Vector<State> m_stateStack;
+ typedef WTF::Vector<State> StateVector;
+ StateVector m_stateStack;
State* m_state;
AffineTransform m_flipMatrix;
};