diff options
author | 2012-02-24 21:03:42 +0000 | |
---|---|---|
committer | 2012-02-24 21:03:42 +0000 | |
commit | 42bbef71c7ccba831caec84a9ab0e3ab15842de7 (patch) | |
tree | ab5e74e9d2cec2294e4088107b1f1ed2dd37e8f9 /include | |
parent | 0b5b0ce39cea3e0eb83c70278b40fa52b3c5870d (diff) |
Enable quickRejectY in SkCanvas to be inlined.
This CL was tested against the picturePlayback bench and
showed an approx 10-13% improvement on Android when playing
back text.
Review URL: https://codereview.appspot.com/5687083
git-svn-id: http://skia.googlecode.com/svn/trunk@3259 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkCanvas.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index 058979d0f7..aa400d6ad4 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -429,7 +429,13 @@ public: @return true if the horizontal band is completely clipped out (i.e. does not intersect the current clip) */ - bool quickRejectY(SkScalar top, SkScalar bottom, EdgeType et) const; + bool quickRejectY(SkScalar top, SkScalar bottom, EdgeType et) const { + SkASSERT(SkScalarToCompareType(top) >= SkScalarToCompareType(bottom)); + + const SkRectCompareType& clipR = this->getLocalClipBoundsCompareType(et); + return SkScalarToCompareType(top) >= clipR.fBottom || + SkScalarToCompareType(bottom) <= clipR.fTop; + } /** Return the bounds of the current clip (in local coordinates) in the bounds parameter, and return true if it is non-empty. This can be useful |