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

Unified Diff: src/gpu/GrDrawTarget.cpp

Issue 209413006: Make it possible to draw multiple paths at once to a draw target (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: address review comment Created 6 years, 9 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
« no previous file with comments | « src/gpu/GrDrawTarget.h ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawTarget.cpp
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index fb4c9a1509a4ffffce549d8fe3116c88f373b10e..35025420793c8e96d7449dfae6d6c78175f1680e 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -548,6 +548,36 @@ void GrDrawTarget::drawPath(const GrPath* path, SkPath::FillType fill) {
this->onDrawPath(path, fill, dstCopy.texture() ? &dstCopy : NULL);
}
+void GrDrawTarget::drawPaths(size_t pathCount, const GrPath** paths,
+ const SkMatrix* transforms,
+ SkPath::FillType fill, SkStrokeRec::Style stroke) {
+ SkASSERT(pathCount > 0);
+ SkASSERT(NULL != paths);
+ SkASSERT(NULL != paths[0]);
+ SkASSERT(this->caps()->pathRenderingSupport());
+ SkASSERT(!SkPath::IsInverseFillType(fill));
+
+ const GrDrawState* drawState = &getDrawState();
+
+ SkRect devBounds;
+ for (size_t i = 0; i < pathCount; ++i) {
+ SkRect mappedPathBounds;
+ transforms[i].mapRect(&mappedPathBounds, paths[i]->getBounds());
+ devBounds.join(mappedPathBounds);
+ }
+
+ SkMatrix viewM = drawState->getViewMatrix();
+ viewM.mapRect(&devBounds);
+
+ GrDeviceCoordTexture dstCopy;
+ if (!this->setupDstReadIfNecessary(&dstCopy, &devBounds)) {
+ return;
+ }
+
+ this->onDrawPaths(pathCount, paths, transforms, fill, stroke,
+ dstCopy.texture() ? &dstCopy : NULL);
+}
+
void GrDrawTarget::instantGpuTraceEvent(const char* marker) {
if (this->caps()->gpuTracingSupport()) {
this->onInstantGpuTraceEvent(marker);
« no previous file with comments | « src/gpu/GrDrawTarget.h ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698