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

Unified Diff: include/core/SkCanvas.h

Issue 2225393002: Optimized implementation of quickReject() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix NX_NOSIMD and Chrome assert 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 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) {
« 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