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

Unified Diff: src/gpu/GrAAConvexPathRenderer.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/GrAAConvexPathRenderer.cpp
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp
index f031f7f61b93e572783cbcddb9aa0645474e882a..9873e4297ef07295ec4474165207ef0572da0514 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
+ this->setBounds(geometry.fPath.getBounds());
+ geometry.fViewMatrix.mapRect(this->getBounds());
}
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;

Powered by Google App Engine
This is Rietveld 408576698