Index: src/core/SkCanvas.cpp |
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp |
index af25b46f3f808f386a04387a14eb78a36fe418bd..e4a5caf067124f664b3daa0ead7b8a00d59869f6 100644 |
--- a/src/core/SkCanvas.cpp |
+++ b/src/core/SkCanvas.cpp |
@@ -2220,9 +2220,29 @@ void SkCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, |
const SkPaint& paint) { |
SkASSERT(blob); |
+ bool hasOffset = x || y; |
+ |
+ // FIXME: temporarily disable quickreject for empty bounds, |
+ // pending implicit blob bounds implementation. |
+ if (!blob->bounds().isEmpty() && paint.canComputeFastBounds()) { |
+ SkRect storage; |
reed1
2014/08/29 15:34:28
I wonder if we should send the translated rect to
f(malita)
2014/08/29 16:01:26
Done.
|
+ const SkRect* bounds = &paint.computeFastBounds(blob->bounds(), &storage); |
+ if (hasOffset) { |
+ if (bounds != &storage) { |
+ storage = *bounds; |
+ bounds = &storage; |
+ } |
+ storage.offset(x, y); |
+ } |
+ |
+ if (this->quickReject(*bounds)) { |
+ return; |
+ } |
+ } |
+ |
// FIXME: dispatch to the device instead |
- if (x || y) { |
+ if (hasOffset) { |
this->translate(x, y); |
reed1
2014/08/29 15:34:28
Eeeek! translate is virtual. I thought all of this
f(malita)
2014/08/29 15:36:39
It is now, just haven't rebased this yet :)
|
} |
@@ -2252,7 +2272,7 @@ void SkCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, |
it.next(); |
} |
- if (x || y) { |
+ if (hasOffset) { |
this->translate(-x, -y); |
} |
} |