aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar fmalita <fmalita@chromium.org>2014-08-29 09:46:36 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-29 09:46:36 -0700
commit7ba7aa7e82c749b0b794f85b546f588ccf2ca777 (patch)
tree0753899abaa1b1ccadd5ae09e3bd895f8456d034
parent2269bce9bec89cc808eac5ac4539e0cd0cb48161 (diff)
Quick-reject draw text blob calls.
R=mtklein@google.com, reed@google.com, robertphillips@google.com Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/494763004
-rw-r--r--src/core/SkCanvas.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 2b08a94c85..717878c82a 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -22,6 +22,7 @@
#include "SkSmallAllocator.h"
#include "SkSurface_Base.h"
#include "SkTemplates.h"
+#include "SkTextBlob.h"
#include "SkTextFormatParams.h"
#include "SkTLazy.h"
#include "SkUtils.h"
@@ -2217,6 +2218,17 @@ void SkCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const SkPat
void SkCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint& paint) {
+
+ // FIXME: temporarily disable quickreject for empty bounds,
+ // pending implicit blob bounds implementation.
+ if (!blob->bounds().isEmpty() && paint.canComputeFastBounds()) {
+ SkRect storage;
+
+ if (this->quickReject(paint.computeFastBounds(blob->bounds().makeOffset(x, y), &storage))) {
+ return;
+ }
+ }
+
LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, NULL)
while (iter.next()) {