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

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: 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 353d36a905aa643b19fc9e2cb56a73135a8ade4f..c444509474e11926c90b8153634c71f60554dcec 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -548,34 +548,24 @@ 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[], GrTransformFormat transformsFormat,
+ 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 != 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.
bsalomon 2014/07/17 17:27:28 Where's that CL? :)
Chris Dalton 2014/07/17 18:15:19 That's what I keep wondering :-\
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, transformsFormat, fill,
dstCopy.texture() ? &dstCopy : NULL);
}

Powered by Google App Engine
This is Rietveld 408576698