Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Unified Diff: src/gpu/GrGpu.h

Issue 400713003: Add a GrPathRange class (Closed) Base URL: https://skia.googlesource.com/skia.git@clupload-ispath
Patch Set: Fix more windows trivial warningswq Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrGpu.h
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index cd7502e18ac3a0f5a0588d5c9aaafe1ab479d094..17b7b697e225f0095ab6df1a3498ceb83a37e5af 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -16,6 +16,7 @@ class GrContext;
class GrGpuObject;
class GrIndexBufferAllocPool;
class GrPath;
+class GrPathRange;
class GrPathRenderer;
class GrPathRendererChain;
class GrStencilBuffer;
@@ -138,6 +139,13 @@ public:
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().
@@ -432,6 +440,7 @@ private:
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
@@ -444,8 +453,10 @@ private:
// 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,
@@ -488,9 +499,10 @@ private:
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();
« src/gpu/GrDrawTarget.h ('K') | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698