diff options
author | 2014-09-09 18:46:22 -0700 | |
---|---|---|
committer | 2014-09-09 18:46:22 -0700 | |
commit | d954498c01ccf0417feacf89e45d0c62a06a813b (patch) | |
tree | bc6676ab7fb5b44b297daf141f1bbf0dafe31f6c /include/core/SkCanvas.h | |
parent | 87a79236f53cb1e1e4be494a14142cea03b93a77 (diff) |
Revert of Revert of allow canvas to force conservative clips (for speed) (patchset #1 id:1 of https://codereview.chromium.org/554033003/)
Reason for revert:
May just rebaseline, plus want to see the results of the chrome tests, so re-trying this CL.
Original issue's description:
> Revert of allow canvas to force conservative clips (for speed) (patchset #7 id:120001 of https://codereview.chromium.org/541593005/)
>
> Reason for revert:
> multipicturedraw failed on nvprmsaa -- don't know why yet
>
> Original issue's description:
> > Allow SkCanvas to be initialized to force conservative rasterclips. This has the following effects:
> >
> > 1. Queries to the current clip will be conservatively large. This can mean the quickReject may return false more often.
> >
> > 2. The conservative clips mean less work is done.
> >
> > 3. Enabled by default for Gpu, Record, and NoSaveLayer canvases.
> >
> > 4. API is private for now.
> >
> > Committed: https://skia.googlesource.com/skia/+/27a5e656c3d6ef22f9cb34de18e1b960da3aa241
>
> TBR=robertphillips@google.com,bsalomon@google.com,mtklein@google.com,junov@google.com
> NOTREECHECKS=true
> NOTRY=true
>
> Committed: https://skia.googlesource.com/skia/+/6f09709519b79a1159f3826645f1c5fbc101ee11
R=robertphillips@google.com, bsalomon@google.com, mtklein@google.com, junov@google.com, reed@google.com
TBR=bsalomon@google.com, junov@google.com, mtklein@google.com, reed@google.com, robertphillips@google.com
NOTREECHECKS=true
NOTRY=true
Author: reed@chromium.org
Review URL: https://codereview.chromium.org/560713002
Diffstat (limited to 'include/core/SkCanvas.h')
-rw-r--r-- | include/core/SkCanvas.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index f514d18b5e..5088d7ded5 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -1265,11 +1265,6 @@ protected: SkIRect* intersection, const SkImageFilter* imageFilter = NULL); - // Called by child classes that override clipPath and clipRRect to only - // track fast conservative clip bounds, rather than exact clips. - void updateClipConservativelyUsingBounds(const SkRect&, SkRegion::Op, - bool inverseFilled); - // notify our surface (if we have one) that we are about to draw, so it // can perform copy-on-write or invalidate any cached images void predrawNotify(); @@ -1309,13 +1304,22 @@ private: friend class SkDebugCanvas; // needs experimental fAllowSimplifyClip friend class SkDeferredDevice; // needs getTopDevice() friend class SkSurface_Raster; // needs getDevice() + friend class SkRecorder; // InitFlags + friend class SkNoSaveLayerCanvas; // InitFlags + enum InitFlags { + kDefault_InitFlags = 0, + kConservativeRasterClip_InitFlag = 1 << 0, + }; + SkCanvas(int width, int height, InitFlags flags); + SkCanvas(SkBaseDevice*, InitFlags flags); + // needs gettotalclip() friend SkCanvasState* SkCanvasStateUtils::CaptureCanvasState(SkCanvas*); SkBaseDevice* createLayerDevice(const SkImageInfo&); - SkBaseDevice* init(SkBaseDevice*); + SkBaseDevice* init(SkBaseDevice*, InitFlags); /** * DEPRECATED @@ -1365,6 +1369,7 @@ private: mutable bool fCachedLocalClipBoundsDirty; bool fAllowSoftClip; bool fAllowSimplifyClip; + bool fConservativeRasterClip; const SkRect& getLocalClipBounds() const { if (fCachedLocalClipBoundsDirty) { |