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

Unified Diff: src/core/SkPicturePlayback.cpp

Issue 2241473002: Delete quickRejectY() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Inline quickRejectY logic Created 4 years, 4 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 | « include/core/SkCanvas.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPicturePlayback.cpp
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp
index 307e9468717352ca5e2c2bb6c107381805fd7f57..f30cf9f8b13ea4788d3d945cfd5a6edc10a3e659 100644
--- a/src/core/SkPicturePlayback.cpp
+++ b/src/core/SkPicturePlayback.cpp
@@ -419,7 +419,9 @@ void SkPicturePlayback::handleOp(SkReadBuffer* reader,
const SkPoint* pos = (const SkPoint*)reader->skip(points * sizeof(SkPoint));
const SkScalar top = reader->readScalar();
const SkScalar bottom = reader->readScalar();
- if (!canvas->quickRejectY(top, bottom) && paint) {
+ SkRect clip;
+ canvas->getClipBounds(&clip);
+ if (top < clip.fBottom && bottom > clip.fTop && paint) {
canvas->drawPosText(text.text(), text.length(), pos, *paint);
}
} break;
@@ -443,7 +445,9 @@ void SkPicturePlayback::handleOp(SkReadBuffer* reader,
const SkScalar top = *xpos++;
const SkScalar bottom = *xpos++;
const SkScalar constY = *xpos++;
- if (!canvas->quickRejectY(top, bottom) && paint) {
+ SkRect clip;
+ canvas->getClipBounds(&clip);
+ if (top < clip.fBottom && bottom > clip.fTop && paint) {
canvas->drawPosTextH(text.text(), text.length(), xpos, constY, *paint);
}
} break;
@@ -498,7 +502,11 @@ void SkPicturePlayback::handleOp(SkReadBuffer* reader,
// ptr[1] == y
// ptr[2] == top
// ptr[3] == bottom
- if (!canvas->quickRejectY(ptr[2], ptr[3]) && paint) {
+ SkRect clip;
+ canvas->getClipBounds(&clip);
+ float top = ptr[2];
+ float bottom = ptr[3];
+ if (top < clip.fBottom && bottom > clip.fTop && paint) {
canvas->drawText(text.text(), text.length(), ptr[0], ptr[1], *paint);
}
} break;
« no previous file with comments | « include/core/SkCanvas.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698