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

Unified Diff: src/gpu/GrDrawTarget.cpp

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/GrDrawTarget.cpp
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 483a9a5217afc1252ee1eb5d55e44d2801da5fdb..72204fa14bfecbd81bff6619f709120e96ac4d3d 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -548,34 +548,25 @@ void GrDrawTarget::drawPath(const GrPath* path, SkPath::FillType fill) {
this->onDrawPath(path, fill, dstCopy.texture() ? &dstCopy : NULL);
}
-void GrDrawTarget::drawPaths(int pathCount, const GrPath** paths,
- const SkMatrix* transforms,
- SkPath::FillType fill, SkStrokeRec::Style stroke) {
- SkASSERT(pathCount > 0);
- SkASSERT(NULL != paths);
- SkASSERT(NULL != paths[0]);
+void GrDrawTarget::drawPaths(const GrPathRange* pathRange,
+ const uint32_t indices[], int count,
+ const float transforms[], PathTransformType transformsType,
+ SkPath::FillType fill) {
SkASSERT(this->caps()->pathRenderingSupport());
- SkASSERT(!SkPath::IsInverseFillType(fill));
-
- const GrDrawState* drawState = &getDrawState();
-
- SkRect devBounds;
- transforms[0].mapRect(&devBounds, paths[0]->getBounds());
- for (int i = 1; i < pathCount; ++i) {
- SkRect mappedPathBounds;
- transforms[i].mapRect(&mappedPathBounds, paths[i]->getBounds());
- devBounds.join(mappedPathBounds);
- }
-
- SkMatrix viewM = drawState->getViewMatrix();
- viewM.mapRect(&devBounds);
-
+ SkASSERT(NULL != pathRange);
+ SkASSERT(NULL != indices);
+ SkASSERT(NULL != transforms);
+
+ // Don't compute a bounding box for setupDstReadIfNecessary(), we'll opt
+ // instead for it to just copy the entire dst. Realistically this is a moot
+ // point, because any context that supports NV_path_rendering will also
+ // support NV_blend_equation_advanced.
GrDeviceCoordTexture dstCopy;
- if (!this->setupDstReadIfNecessary(&dstCopy, &devBounds)) {
+ if (!this->setupDstReadIfNecessary(&dstCopy, NULL)) {
return;
}
- this->onDrawPaths(pathCount, paths, transforms, fill, stroke,
+ this->onDrawPaths(pathRange, indices, count, transforms, transformsType, fill,
dstCopy.texture() ? &dstCopy : NULL);
}
« src/gpu/GrDrawTarget.h ('K') | « src/gpu/GrDrawTarget.h ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698