aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-03-02 11:23:46 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-02 18:57:45 +0000
commitc77e33f73d3e86cfabf925d6f2e1166f81022575 (patch)
tree8830c10ea1e9f3295ae9116b90120b3d811290ff /include
parent8e8e817cbf6c6e3df744dbaa070564c453b70a62 (diff)
Remove SkDraw from device-draw methods, and enable device-centric clipping.
BUG=skia:6214 Change-Id: I593900724310d09133ae4791ef68d38c43762fc2 Reviewed-on: https://skia-review.googlesource.com/8806 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/core/SkCanvas.h23
-rw-r--r--include/core/SkTypes.h3
2 files changed, 10 insertions, 16 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 9e9d98a587..3ce4baeb59 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -1359,6 +1359,10 @@ 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:
@@ -1523,7 +1527,7 @@ private:
SkBaseDevice* device() const;
const SkMatrix& matrix() const;
- const SkRasterClip& clip() const;
+ void clip(SkRegion*) const;
const SkPaint& paint() const;
int x() const;
int y() const;
@@ -1545,7 +1549,7 @@ private:
static void DrawDeviceWithFilter(SkBaseDevice* src, const SkImageFilter* filter,
SkBaseDevice* dst, const SkIPoint& dstOrigin,
- const SkMatrix& ctm, const SkClipStack* clipStack);
+ const SkMatrix& ctm);
enum ShaderOverrideOpacity {
kNone_ShaderOverrideOpacity, //!< there is no overriding shader (bitmap or image)
@@ -1567,7 +1571,6 @@ private:
class MCRec;
- sk_sp<SkClipStack> fClipStack;
SkDeque fMCStack;
// points to top of stack
MCRec* fMCRec;
@@ -1595,9 +1598,7 @@ private:
friend class SkSurface_Base;
friend class SkSurface_Gpu;
- bool fDeviceCMDirty; // cleared by updateDeviceCMCache()
SkIRect fClipRestrictionRect = SkIRect::MakeEmpty();
- void updateDeviceCMCache();
void doSave();
void checkForDeferredSave();
@@ -1667,14 +1668,11 @@ private:
*/
bool canDrawBitmapAsSprite(SkScalar x, SkScalar y, int w, int h, const SkPaint&);
- /** 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)
+ /**
+ * Returns true if the clip (for any active layer) contains antialiasing.
+ * If the clip is empty, this will return false.
*/
- const SkClipStack* getClipStack() const {
- return fClipStack.get();
- }
+ bool androidFramework_isClipAA() const;
/**
* Keep track of the device clip bounds and if the matrix is scale-translate. This allows
@@ -1685,7 +1683,6 @@ private:
bool fAllowSoftClip;
bool fAllowSimplifyClip;
- const bool fConservativeRasterClip;
class AutoValidateClip : ::SkNoncopyable {
public:
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h
index 8baf246d34..f9e1a059fb 100644
--- a/include/core/SkTypes.h
+++ b/include/core/SkTypes.h
@@ -35,9 +35,6 @@
#include <string.h>
-// enable to test new device-base clipping
-//#define SK_USE_DEVICE_CLIPPING
-
/**
* sk_careful_memcpy() is just like memcpy(), but guards against undefined behavior.
*