aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@google.com>2017-03-03 20:27:13 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-03 20:27:22 +0000
commitbaf06bc89a0ee2ac4033281e7310f6c727faab79 (patch)
tree13aca9c2e88a457a91f2d0dcf0f3418411ea63fc /include
parent94fc0fe016bbfeb097c829df513673d4fcbb38b3 (diff)
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 <bsalomon@google.com> > Commit-Queue: Mike Reed <reed@google.com> > 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 <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/core/SkCanvas.h23
1 files changed, 13 insertions, 10 deletions
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<SkClipStack> 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: