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

Unified Diff: src/gpu/GrAADistanceFieldPathRenderer.cpp

Issue 1121463002: Move bounds to GrBatch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 8 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/GrAADistanceFieldPathRenderer.cpp
diff --git a/src/gpu/GrAADistanceFieldPathRenderer.cpp b/src/gpu/GrAADistanceFieldPathRenderer.cpp
index ea338bba29f8be37d3ee4065b86bd7cfea0841a2..10d06af5f643294921bd926f85f755e4c27f0102 100755
--- a/src/gpu/GrAADistanceFieldPathRenderer.cpp
+++ b/src/gpu/GrAADistanceFieldPathRenderer.cpp
@@ -312,6 +312,10 @@ private:
fAtlas = atlas;
fPathCache = pathCache;
fPathList = pathList;
+
+ // Compute bounds
+ *this->getBounds() = geometry.fPath.getBounds();
+ viewMatrix.mapRect(this->getBounds());
}
bool addPathToAtlas(GrBatchTarget* batchTarget,
@@ -548,6 +552,7 @@ private:
}
fGeoData.push_back_n(that->geoData()->count(), that->geoData()->begin());
+ this->joinBounds(that->bounds());
return true;
}
@@ -607,10 +612,7 @@ bool GrAADistanceFieldPathRenderer::onDrawPath(GrDrawTarget* target,
SkAutoTUnref<GrBatch> batch(AADistanceFieldPathBatch::Create(geometry, color, viewMatrix,
fAtlas, &fPathCache, &fPathList));
-
- SkRect bounds = path.getBounds();
- viewMatrix.mapRect(&bounds);
- target->drawBatch(pipelineBuilder, batch, &bounds);
+ target->drawBatch(pipelineBuilder, batch);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698