Index: include/core/SkCanvas.h |
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h |
index d19830deab4fbbddfa56e9dd1bfce76a9b669e77..c97d14f92539992ea2b478cd5d5c8fe2520a5708 100644 |
--- a/include/core/SkCanvas.h |
+++ b/include/core/SkCanvas.h |
@@ -1605,25 +1605,18 @@ private: |
*/ |
bool canDrawBitmapAsSprite(SkScalar x, SkScalar y, int w, int h, const SkPaint&); |
- /* These maintain a cache of the clip bounds in local coordinates, |
- (converted to 2s-compliment if floats are slow). |
+ |
+ /** |
+ * Keep track of the device clip bounds and if the matrix is scale-translate. This allows |
+ * us to do a fast quick reject in the common case. |
*/ |
- mutable SkRect fCachedLocalClipBounds; |
- mutable bool fCachedLocalClipBoundsDirty; |
+ bool fConservativeIsScaleTranslate; |
+ SkRect fDeviceClipBounds; |
+ |
bool fAllowSoftClip; |
bool fAllowSimplifyClip; |
const bool fConservativeRasterClip; |
- const SkRect& getLocalClipBounds() const { |
- if (fCachedLocalClipBoundsDirty) { |
- if (!this->getClipBounds(&fCachedLocalClipBounds)) { |
- fCachedLocalClipBounds.setEmpty(); |
- } |
- fCachedLocalClipBoundsDirty = false; |
- } |
- return fCachedLocalClipBounds; |
- } |
- |
class AutoValidateClip : ::SkNoncopyable { |
public: |
explicit AutoValidateClip(SkCanvas* canvas) : fCanvas(canvas) { |