diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-02-14 19:52:18 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-02-14 19:52:18 +0000 |
commit | 9836bc3fdddd51ed050102d03916cc5c7928dcc6 (patch) | |
tree | ee5877ad42d54b7e867b5ef160dc8eb4b334be02 /include | |
parent | dcfaa73e68f54f19c7900577b71f585fb8a7e1ae (diff) |
When the CTM has perspective the back-project method in quickRejectY goes haywire.
R=reed@google.com
Author: robertphillips@google.com
Review URL: https://codereview.chromium.org/166873004
git-svn-id: http://skia.googlecode.com/svn/trunk@13460 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkCanvas.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index ef2f0b98f4..4cd7adbf04 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -488,6 +488,20 @@ public: */ bool quickRejectY(SkScalar top, SkScalar bottom) const { SkASSERT(top <= bottom); + +#ifndef SK_WILL_NEVER_DRAW_PERSPECTIVE_TEXT + // TODO: add a hasPerspective method similar to getLocalClipBounds. This + // would cache the SkMatrix::hasPerspective result. Alternatively, have + // the MC stack just set a hasPerspective boolean as it is updated. + if (this->getTotalMatrix().hasPerspective()) { + // TODO: consider implementing some half-plane test between the + // two Y planes and the device-bounds (i.e., project the top and + // bottom Y planes and then determine if the clip bounds is completely + // outside either one). + return false; + } +#endif + const SkRect& clipR = this->getLocalClipBounds(); // In the case where the clip is empty and we are provided with a // negative top and positive bottom parameter then this test will return |