Add a GrPathRange class
Adds a GrPathRange object that represents a range of paths on the gpu.
Updates GrDrawTarget::drawPaths and supporting code to use GrPathRange
instead of an array of GrPath objects.
Change-Id: I67845f3893cd4d955db947d699aa3733cbb081e0
BUG=skia:
R=bsalomon@google.com, jvanverth@google.com, kkinnunen@nvidia.com
Author: cdalton@nvidia.com
Review URL: https://codereview.chromium.org/400713003
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index fd249de..840f8ee 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -218,6 +218,12 @@
return this->onCreatePath(path, stroke);
}
+GrPathRange* GrGpu::createPathRange(size_t size, const SkStrokeRec& stroke) {
+ SkASSERT(this->caps()->pathRenderingSupport());
+ this->handleDirtyContext();
+ return this->onCreatePathRange(size, stroke);
+}
+
void GrGpu::clear(const SkIRect* rect,
GrColor color,
bool canIgnoreRect,
@@ -419,10 +425,10 @@
this->onGpuDrawPath(path, fill);
}
-void GrGpu::onDrawPaths(int pathCount, const GrPath** paths,
- const SkMatrix* transforms, SkPath::FillType fill,
- SkStrokeRec::Style style,
- const GrDeviceCoordTexture* dstCopy) {
+void GrGpu::onDrawPaths(const GrPathRange* pathRange,
+ const uint32_t indices[], int count,
+ const float transforms[], PathTransformType transformsType,
+ SkPath::FillType fill, const GrDeviceCoordTexture* dstCopy) {
this->handleDirtyContext();
drawState()->setDefaultVertexAttribs();
@@ -432,7 +438,7 @@
return;
}
- this->onGpuDrawPaths(pathCount, paths, transforms, fill, style);
+ this->onGpuDrawPaths(pathRange, indices, count, transforms, transformsType, fill);
}
void GrGpu::finalizeReservedVertices() {