#include "SkPath.h"
class GrContext;
-class GrGpuObject;
class GrIndexBufferAllocPool;
class GrPath;
+class GrPathRange;
class GrPathRenderer;
class GrPathRendererChain;
class GrStencilBuffer;
GrPath* createPath(const SkPath& path, const SkStrokeRec& stroke);
/**
+ * Creates a path range object that can be used to draw multiple paths via
+ * drawPaths(). It is only legal to call this if the caps report support for
+ * path rendering.
+ */
+ GrPathRange* createPathRange(size_t size, const SkStrokeRec&);
+
+ /**
* Returns an index buffer that can be used to render quads.
* Six indices per quad: 0, 1, 2, 0, 2, 3, etc.
* The max number of quads can be queried using GrIndexBuffer::maxQuads().
size_t rowBytes);
/**
- * Called to tell GrGpu that all GrGpuObjects have been lost and should
+ * Called to tell GrGpu that all GrGpuResources have been lost and should
* be abandoned. Overrides must call INHERITED::abandonResources().
*/
virtual void abandonResources();
/**
- * Called to tell GrGpu to release all GrGpuObjects. Overrides must call
+ * Called to tell GrGpu to release all GrGpuResources. Overrides must call
* INHERITED::releaseResources().
*/
void releaseResources();
/**
- * Add object to list of objects. Should only be called by GrGpuObject.
+ * Add object to list of objects. Should only be called by GrGpuResource.
* @param resource the resource to add.
*/
- void insertObject(GrGpuObject* object);
+ void insertObject(GrGpuResource* object);
/**
- * Remove object from list of objects. Should only be called by GrGpuObject.
+ * Remove object from list of objects. Should only be called by GrGpuResource.
* @param resource the resource to remove.
*/
- void removeObject(GrGpuObject* object);
+ void removeObject(GrGpuResource* object);
// GrDrawTarget overrides
virtual void clear(const SkIRect* rect,
virtual GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) = 0;
virtual GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) = 0;
virtual GrPath* onCreatePath(const SkPath& path, const SkStrokeRec&) = 0;
+ virtual GrPathRange* onCreatePathRange(size_t size, const SkStrokeRec&) = 0;
// overridden by backend-specific derived class to perform the clear and
// clearRect. NULL rect means clear whole target. If canIgnoreRect is
// overridden by backend-specific derived class to perform the path stenciling.
virtual void onGpuStencilPath(const GrPath*, SkPath::FillType) = 0;
virtual void onGpuDrawPath(const GrPath*, SkPath::FillType) = 0;
- virtual void onGpuDrawPaths(int, const GrPath**, const SkMatrix*,
- SkPath::FillType, SkStrokeRec::Style) = 0;
+ virtual void onGpuDrawPaths(const GrPathRange*,
+ const uint32_t indices[], int count,
+ const float transforms[], PathTransformType,
+ SkPath::FillType) = 0;
// overridden by backend-specific derived class to perform the read pixels.
virtual bool onReadPixels(GrRenderTarget* target,
virtual void onStencilPath(const GrPath*, SkPath::FillType) SK_OVERRIDE;
virtual void onDrawPath(const GrPath*, SkPath::FillType,
const GrDeviceCoordTexture* dstCopy) SK_OVERRIDE;
- virtual void onDrawPaths(int, const GrPath**, const SkMatrix*,
- SkPath::FillType, SkStrokeRec::Style,
- const GrDeviceCoordTexture* dstCopy) SK_OVERRIDE;
+ virtual void onDrawPaths(const GrPathRange*,
+ const uint32_t indices[], int count,
+ const float transforms[], PathTransformType,
+ SkPath::FillType, const GrDeviceCoordTexture*) SK_OVERRIDE;
// readies the pools to provide vertex/index data.
void prepareVertexPool();
enum {
kPreallocGeomPoolStateStackCnt = 4,
};
- typedef SkTInternalLList<GrGpuObject> ObjectList;
+ typedef SkTInternalLList<GrGpuResource> ObjectList;
SkSTArray<kPreallocGeomPoolStateStackCnt, GeometryPoolState, true> fGeomPoolStateStack;
ResetTimestamp fResetTimestamp;
uint32_t fResetBits;