Pass blob bounds to the looper, if available
R=robertphillips@google.com,reed@google.com
Review URL: https://codereview.chromium.org/979943002
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 8b88a03..a47bd89 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -2153,10 +2153,13 @@
void SkCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint& paint) {
+ SkRect storage;
+ const SkRect* bounds = NULL;
if (paint.canComputeFastBounds()) {
- SkRect storage;
+ storage = blob->bounds().makeOffset(x, y);
+ bounds = &paint.computeFastBounds(storage, &storage);
- if (this->quickReject(paint.computeFastBounds(blob->bounds().makeOffset(x, y), &storage))) {
+ if (this->quickReject(*bounds)) {
return;
}
}
@@ -2166,7 +2169,7 @@
SkDrawFilter* drawFilter = fMCRec->fFilter;
fMCRec->fFilter = NULL;
- LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, NULL)
+ LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, bounds)
while (iter.next()) {
SkDeviceFilteredPaint dfp(iter.fDevice, looper.paint());