Index: src/record/SkRecordDraw.cpp |
diff --git a/src/record/SkRecordDraw.cpp b/src/record/SkRecordDraw.cpp |
index f0d3772e9fbbc426d57b100481a09ab39234154b..9cdab3a34cd00d949e55f2a90690c22dcba9a9f1 100644 |
--- a/src/record/SkRecordDraw.cpp |
+++ b/src/record/SkRecordDraw.cpp |
@@ -76,7 +76,7 @@ CAN_SKIP(ClipRegion); |
static bool can_skip_text(const SkCanvas& c, const SkPaint& p, SkScalar minY, SkScalar maxY) { |
// If we're drawing vertical text, none of the checks we're about to do make any sense. |
- // We use canComputeFastBounds as a proxy for "is this text going to be rectangular?". |
+ // We need to call computeFastBounds() to adjust the text bounds for paint effects. |
tomhudson
2014/04/15 13:41:36
This edited comment really belongs below with adju
|
if (p.isVerticalText() || !p.canComputeFastBounds()) { |
return false; |
} |
@@ -88,7 +88,12 @@ static bool can_skip_text(const SkCanvas& c, const SkPaint& p, SkScalar minY, Sk |
SkDEBUGCODE(p.getFontMetrics(&metrics);) |
SkASSERT(-buffer <= metrics.fTop); |
SkASSERT(+buffer >= metrics.fBottom); |
- return c.quickRejectY(minY - buffer, maxY + buffer); |
+ |
+ // Let the paint have its say of any extra efect. 0,1 for left,right makes the rect non-empty. |
tomhudson
2014/04/15 13:41:36
spelling: effect.
Also, meaning of the entire comm
|
+ SkRect bounds; |
+ bounds.set(0, -buffer, SK_Scalar1, buffer); |
+ SkRect adjusted = p.computeFastBounds(bounds, &bounds); |
+ return c.quickRejectY(minY + adjusted.fTop, maxY + adjusted.fBottom); |
} |
template <> bool Draw::canSkip(const SkRecords::DrawPosTextH& r) const { |