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

Unified Diff: src/gpu/GrAAConvexPathRenderer.cpp

Issue 1121463002: Move bounds to GrBatch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweak 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
« no previous file with comments | « gm/convexpolyeffect.cpp ('k') | src/gpu/GrAADistanceFieldPathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAAConvexPathRenderer.cpp
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp
index f031f7f61b93e572783cbcddb9aa0645474e882a..3a548aa60aca8c4fd3575b17063dd3d4edad9621 100644
--- a/src/gpu/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/GrAAConvexPathRenderer.cpp
@@ -847,6 +847,10 @@ private:
AAConvexPathBatch(const Geometry& geometry) {
this->initClassID<AAConvexPathBatch>();
fGeoData.push_back(geometry);
+
+ // compute bounds
+ fBounds = geometry.fPath.getBounds();
+ geometry.fViewMatrix.mapRect(&fBounds);
}
bool onCombineIfPossible(GrBatch* t) override {
@@ -862,6 +866,7 @@ private:
}
fGeoData.push_back_n(that->geoData()->count(), that->geoData()->begin());
+ this->joinBounds(that->bounds());
return true;
}
@@ -891,19 +896,13 @@ bool GrAAConvexPathRenderer::onDrawPath(GrDrawTarget* target,
return true;
}
- // We outset our vertices one pixel and add one more pixel for precision.
- // TODO create tighter bounds when we start reordering.
- SkRect devRect = path.getBounds();
- vm.mapRect(&devRect);
- devRect.outset(2, 2);
-
AAConvexPathBatch::Geometry geometry;
geometry.fColor = color;
geometry.fViewMatrix = vm;
geometry.fPath = path;
SkAutoTUnref<GrBatch> batch(AAConvexPathBatch::Create(geometry));
- target->drawBatch(pipelineBuilder, batch, &devRect);
+ target->drawBatch(pipelineBuilder, batch);
return true;
« no previous file with comments | « gm/convexpolyeffect.cpp ('k') | src/gpu/GrAADistanceFieldPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698