aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2015-09-30 06:22:22 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-09-30 06:22:22 -0700
commite2bcec38486f2e1a897973c953e5610eaef4221e (patch)
tree15a780a13ec9770331afb737d577cedbb86099f1
parentf0c986503b982cfbd4d859573c11bc2a154b42f5 (diff)
fix for default path renderer draws harlines without bloating
-rw-r--r--src/gpu/GrDrawTarget.cpp2
-rw-r--r--src/gpu/batches/GrDefaultPathRenderer.cpp6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 3d5f4288f4..e7c1c8b5c1 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -395,7 +395,7 @@ void GrDrawTarget::recordBatch(GrBatch* batch) {
static const int kMaxLookback = 10;
GrBATCH_INFO("Re-Recording (%s, B%u)\n"
- "\tBounds (%f, %f, %f, %f)\n",
+ "\tBounds LRTB (%f, %f, %f, %f)\n",
batch->name(),
batch->uniqueID(),
batch->bounds().fLeft, batch->bounds().fRight,
diff --git a/src/gpu/batches/GrDefaultPathRenderer.cpp b/src/gpu/batches/GrDefaultPathRenderer.cpp
index 67bccb63b4..d0777e253f 100644
--- a/src/gpu/batches/GrDefaultPathRenderer.cpp
+++ b/src/gpu/batches/GrDefaultPathRenderer.cpp
@@ -386,6 +386,12 @@ private:
fGeoData.push_back(geometry);
this->setBounds(devBounds);
+
+ // This is b.c. hairlines are notionally infinitely thin so without expansion
+ // two overlapping lines could be reordered even though they hit the same pixels.
+ if (isHairline) {
+ fBounds.outset(0.5f, 0.5f);
+ }
}
bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override {