Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Unified Diff: src/core/SkCanvas.cpp

Issue 979943002: Pass blob bounds to the looper, if available (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 8b88a038146c17b3c691ccbcf80c5ffa62422bfb..a47bd89c0507acad23ca7512279813ddd4a8697f 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -2153,10 +2153,13 @@ void SkCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const SkPat
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 @@ void SkCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
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());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698