From baf06bc89a0ee2ac4033281e7310f6c727faab79 Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Fri, 3 Mar 2017 20:27:13 +0000 Subject: Revert "Revert[2] "Remove SkDraw from device-draw methods, and enable device-centric clipping.""" This reverts commit cfaa63237b152ae216f1351207bce3ea9808814c. Reason for revert: speculative revert to fix Google3 Original change's description: > Revert[2] "Remove SkDraw from device-draw methods, and enable device-centric clipping."" > > passes new (augmented) CanvasClipType unittest > fixed rasterclipstack::setnewsize > > This reverts commit ea5e676a7b75600edcde3912886486004ccd7626. > > BUG=skia: > > Change-Id: I004653e0f4d01454662f8516fccab0046486f273 > Reviewed-on: https://skia-review.googlesource.com/9185 > Reviewed-by: Brian Salomon > Commit-Queue: Mike Reed > TBR=bsalomon@google.com,reed@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Change-Id: Ibd7ee6383999f008eb6ee59c1c3f1c06a86044ea Reviewed-on: https://skia-review.googlesource.com/9230 Reviewed-by: Cary Clark Commit-Queue: Cary Clark --- include/core/SkCanvas.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index 3ce4baeb59..9e9d98a587 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -1359,10 +1359,6 @@ public: */ void temporary_internal_describeTopLayer(SkMatrix* matrix, SkIRect* clip_bounds); - /** - * Returns the global clip as a region. If the clip contains AA, then only the bounds - * of the clip may be returned. - */ void temporary_internal_getRgnClip(SkRegion*); protected: @@ -1527,7 +1523,7 @@ private: SkBaseDevice* device() const; const SkMatrix& matrix() const; - void clip(SkRegion*) const; + const SkRasterClip& clip() const; const SkPaint& paint() const; int x() const; int y() const; @@ -1549,7 +1545,7 @@ private: static void DrawDeviceWithFilter(SkBaseDevice* src, const SkImageFilter* filter, SkBaseDevice* dst, const SkIPoint& dstOrigin, - const SkMatrix& ctm); + const SkMatrix& ctm, const SkClipStack* clipStack); enum ShaderOverrideOpacity { kNone_ShaderOverrideOpacity, //!< there is no overriding shader (bitmap or image) @@ -1571,6 +1567,7 @@ private: class MCRec; + sk_sp fClipStack; SkDeque fMCStack; // points to top of stack MCRec* fMCRec; @@ -1598,7 +1595,9 @@ private: friend class SkSurface_Base; friend class SkSurface_Gpu; + bool fDeviceCMDirty; // cleared by updateDeviceCMCache() SkIRect fClipRestrictionRect = SkIRect::MakeEmpty(); + void updateDeviceCMCache(); void doSave(); void checkForDeferredSave(); @@ -1668,11 +1667,14 @@ private: */ bool canDrawBitmapAsSprite(SkScalar x, SkScalar y, int w, int h, const SkPaint&); - /** - * Returns true if the clip (for any active layer) contains antialiasing. - * If the clip is empty, this will return false. + /** Return the clip stack. The clip stack stores all the individual + * clips organized by the save/restore frame in which they were + * added. + * @return the current clip stack ("list" of individual clip elements) */ - bool androidFramework_isClipAA() const; + const SkClipStack* getClipStack() const { + return fClipStack.get(); + } /** * Keep track of the device clip bounds and if the matrix is scale-translate. This allows @@ -1683,6 +1685,7 @@ private: bool fAllowSoftClip; bool fAllowSimplifyClip; + const bool fConservativeRasterClip; class AutoValidateClip : ::SkNoncopyable { public: -- cgit v1.2.3