summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2013-04-03 09:55:48 -0700
committerChris Craik <ccraik@google.com>2013-04-03 09:55:48 -0700
commite7c69c6fe3eac1fb01126ede550e5dc32979804a (patch)
tree4d471a579f89582c6b67b3016aaf8c0b9cf971e4 /libs
parent0102443c4f52f2e15fd731c452f0c4745312d448 (diff)
downloadframeworks_base-e7c69c6fe3eac1fb01126ede550e5dc32979804a.zip
frameworks_base-e7c69c6fe3eac1fb01126ede550e5dc32979804a.tar.gz
frameworks_base-e7c69c6fe3eac1fb01126ede550e5dc32979804a.tar.bz2
Account for hairlines in quick rejection logic
bug:8531373 Change-Id: I35444014f23fc61da687694fccc0d13bce718793
Diffstat (limited to 'libs')
-rw-r--r--libs/hwui/DisplayListOp.h6
-rw-r--r--libs/hwui/PathTessellator.cpp1
2 files changed, 6 insertions, 1 deletions
diff --git a/libs/hwui/DisplayListOp.h b/libs/hwui/DisplayListOp.h
index 9c3d058..a5dee9f 100644
--- a/libs/hwui/DisplayListOp.h
+++ b/libs/hwui/DisplayListOp.h
@@ -165,7 +165,11 @@ public:
return DeferredDisplayList::kOpBatch_None;
}
- float strokeWidthOutset() { return mPaint->getStrokeWidth() * 0.5f; }
+ float strokeWidthOutset() {
+ float width = mPaint->getStrokeWidth();
+ if (width == 0) return 0.5f; // account for hairline
+ return width * 0.5f;
+ }
protected:
SkPaint* getPaint(OpenGLRenderer& renderer) {
diff --git a/libs/hwui/PathTessellator.cpp b/libs/hwui/PathTessellator.cpp
index 395bbf6..0879b1b 100644
--- a/libs/hwui/PathTessellator.cpp
+++ b/libs/hwui/PathTessellator.cpp
@@ -61,6 +61,7 @@ void PathTessellator::expandBoundsForStroke(SkRect& bounds, const SkPaint* paint
bool forceExpand) {
if (forceExpand || paint->getStyle() != SkPaint::kFill_Style) {
float outset = paint->getStrokeWidth() * 0.5f;
+ if (outset == 0) outset = 0.5f; // account for hairline
bounds.outset(outset, outset);
}
}