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

Unified Diff: include/core/SkCanvas.h

Issue 2231393003: Revert of Optimized implementation of quickReject() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « bench/QuickRejectBench.cpp ('k') | include/core/SkPostConfig.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkCanvas.h
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index c97d14f92539992ea2b478cd5d5c8fe2520a5708..d19830deab4fbbddfa56e9dd1bfce76a9b669e77 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -1605,17 +1605,24 @@
*/
bool canDrawBitmapAsSprite(SkScalar x, SkScalar y, int w, int h, const SkPaint&);
-
- /**
- * 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.
- */
- bool fConservativeIsScaleTranslate;
- SkRect fDeviceClipBounds;
-
+ /* These maintain a cache of the clip bounds in local coordinates,
+ (converted to 2s-compliment if floats are slow).
+ */
+ mutable SkRect fCachedLocalClipBounds;
+ mutable bool fCachedLocalClipBoundsDirty;
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:
« no previous file with comments | « bench/QuickRejectBench.cpp ('k') | include/core/SkPostConfig.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698