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

Unified Diff: include/core/SkCanvas.h

Issue 166873004: Add check for perspective matrix in quickRejectY (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Address code review issues Created 6 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: include/core/SkCanvas.h
===================================================================
--- include/core/SkCanvas.h (revision 13449)
+++ include/core/SkCanvas.h (working copy)
@@ -488,6 +488,20 @@
*/
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
« 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