aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Ben Wagner <bungeman@google.com>2018-06-27 14:46:46 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-12 02:36:44 +0000
commit2c312c4f58f9c151acab8ca2dd0d39fb77c5e74a (patch)
tree527d8ef60903f99e54cc83615a051c8b65e046bb /include
parent0859252397e0a771669d21d173a8a20f814b7ca0 (diff)
Remove SkDrawFilter.
Change-Id: I0204a9522e828c87bb7c6c20ae34ce51161442af Reviewed-on: https://skia-review.googlesource.com/137895 Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/core/SkCanvas.h55
-rw-r--r--include/core/SkDrawFilter.h53
-rw-r--r--include/effects/SkPaintFlagsDrawFilter.h24
-rw-r--r--include/utils/SkNWayCanvas.h7
4 files changed, 18 insertions, 121 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index abac335a0c..bd9591117e 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -35,7 +35,6 @@ class SkClipStack;
class SkData;
class SkDraw;
class SkDrawable;
-class SkDrawFilter;
struct SkDrawShadowRec;
class SkGlyphRunBuilder;
class SkImage;
@@ -492,9 +491,9 @@ public:
*/
bool writePixels(const SkBitmap& bitmap, int x, int y);
- /** Saves SkMatrix, clip, and SkDrawFilter (SkDrawFilter deprecated on most platforms).
- Calling restore() discards changes to SkMatrix, clip, and SkDrawFilter,
- restoring the SkMatrix, clip, and SkDrawFilter to their state when save() was called.
+ /** Saves SkMatrix and clip.
+ Calling restore() discards changes to SkMatrix and clip, restoring the SkMatrix and clip to
+ their state when save() was called.
SkMatrix may be changed by translate(), scale(), rotate(), skew(), concat(), setMatrix(),
and resetMatrix(). Clip may be changed by clipRect(), clipRRect(), clipPath(), clipRegion().
@@ -508,10 +507,8 @@ public:
*/
int save();
- /** Saves SkMatrix, clip, and SkDrawFilter (SkDrawFilter deprecated on most platforms),
- and allocates a SkBitmap for subsequent drawing.
- Calling restore() discards changes to SkMatrix, clip, and SkDrawFilter,
- and draws the SkBitmap.
+ /** Saves SkMatrix and clip, and allocates a SkBitmap for subsequent drawing.
+ Calling restore() discards changes to SkMatrix and clip, and draws the SkBitmap.
SkMatrix may be changed by translate(), scale(), rotate(), skew(), concat(),
setMatrix(), and resetMatrix(). Clip may be changed by clipRect(), clipRRect(),
@@ -531,10 +528,8 @@ public:
*/
int saveLayer(const SkRect* bounds, const SkPaint* paint);
- /** Saves SkMatrix, clip, and SkDrawFilter (SkDrawFilter deprecated on most platforms),
- and allocates a SkBitmap for subsequent drawing.
- Calling restore() discards changes to SkMatrix, clip, and SkDrawFilter,
- and draws the SkBitmap.
+ /** Saves SkMatrix and clip, and allocates a SkBitmap for subsequent drawing.
+ Calling restore() discards changes to SkMatrix and clip, and draws the SkBitmap.
SkMatrix may be changed by translate(), scale(), rotate(), skew(), concat(),
setMatrix(), and resetMatrix(). Clip may be changed by clipRect(), clipRRect(),
@@ -556,12 +551,10 @@ public:
return this->saveLayer(&bounds, paint);
}
- /** Saves SkMatrix, clip, and SkDrawFilter (SkDrawFilter deprecated on most platforms),
- and allocates a SkBitmap for subsequent drawing.
+ /** Saves SkMatrix and clip, and allocates a SkBitmap for subsequent drawing.
LCD text is preserved when the layer is drawn to the prior layer.
- Calling restore() discards changes to SkMatrix, clip, and SkDrawFilter,
- and draws layer.
+ Calling restore() discards changes to SkMatrix and clip, and draws layer.
SkMatrix may be changed by translate(), scale(), rotate(), skew(), concat(),
setMatrix(), and resetMatrix(). Clip may be changed by clipRect(), clipRRect(),
@@ -585,11 +578,10 @@ public:
*/
int saveLayerPreserveLCDTextRequests(const SkRect* bounds, const SkPaint* paint);
- /** Saves SkMatrix, clip, and SkDrawFilter (SkDrawFilter deprecated on most platforms),
- and allocates SkBitmap for subsequent drawing.
+ /** Saves SkMatrix and clip, and allocates SkBitmap for subsequent drawing.
- Calling restore() discards changes to SkMatrix, clip, and SkDrawFilter,
- and blends layer with alpha opacity onto prior layer.
+ Calling restore() discards changes to SkMatrix and clip, and blends layer with alpha opacity
+ onto prior layer.
SkMatrix may be changed by translate(), scale(), rotate(), skew(), concat(),
setMatrix(), and resetMatrix(). Clip may be changed by clipRect(), clipRRect(),
@@ -716,10 +708,9 @@ public:
SaveLayerFlags fSaveLayerFlags = 0;
};
- /** Saves SkMatrix, clip, and SkDrawFilter (SkDrawFilter deprecated on most platforms),
- and allocates SkBitmap for subsequent drawing.
+ /** Saves SkMatrix and clip, and allocates SkBitmap for subsequent drawing.
- Calling restore() discards changes to SkMatrix, clip, and SkDrawFilter,
+ Calling restore() discards changes to SkMatrix and clip,
and blends SkBitmap with alpha opacity onto the prior layer.
SkMatrix may be changed by translate(), scale(), rotate(), skew(), concat(),
@@ -735,14 +726,14 @@ public:
*/
int saveLayer(const SaveLayerRec& layerRec);
- /** Removes changes to SkMatrix, clip, and SkDrawFilter since SkCanvas state was
- last saved. The state is removed from the stack.
+ /** Removes changes to SkMatrix and clip since SkCanvas state was last saved.
+ The state is removed from the stack.
Does nothing if the stack is empty.
*/
void restore();
- /** Returns the number of saved states, each containing: SkMatrix, clip, and SkDrawFilter.
+ /** Returns the number of saved states, each containing: SkMatrix and clip.
Equals the number of save() calls less the number of restore() calls plus one.
The save count of a new canvas is one.
@@ -750,7 +741,7 @@ public:
*/
int getSaveCount() const;
- /** Restores state to SkMatrix, clip, and SkDrawFilter values when save(), saveLayer(),
+ /** Restores state to SkMatrix and clip values when save(), saveLayer(),
saveLayerPreserveLCDTextRequests(), or saveLayerAlpha() returned saveCount.
Does nothing if saveCount is greater than state stack count.
@@ -2388,16 +2379,6 @@ public:
//////////////////////////////////////////////////////////////////////////
-#ifdef SK_SUPPORT_LEGACY_DRAWFILTER
- /** To be deprecated soon.
- */
- SkDrawFilter* getDrawFilter() const;
-
- /** To be deprecated soon.
- */
- virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter);
-#endif
-
/** Returns true if clip is empty; that is, nothing will draw.
May do work when called; it should not be called
diff --git a/include/core/SkDrawFilter.h b/include/core/SkDrawFilter.h
deleted file mode 100644
index 7150419108..0000000000
--- a/include/core/SkDrawFilter.h
+++ /dev/null
@@ -1,53 +0,0 @@
-
-/*
- * Copyright 2011 The Android Open Source Project
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-
-#ifndef SkDrawFilter_DEFINED
-#define SkDrawFilter_DEFINED
-
-#include "SkRefCnt.h"
-
-class SkCanvas;
-class SkPaint;
-
-/**
- * DEPRECATED - use SkPaintFilterCanvas instead.
- *
- * Right before something is being draw, filter() is called with the
- * paint. The filter may modify the paint as it wishes, which will then be
- * used for the actual drawing. Note: this modification only lasts for the
- * current draw, as a temporary copy of the paint is used.
- */
-class SK_API SkDrawFilter : public SkRefCnt {
-public:
- enum Type {
- kPaint_Type,
- kPoint_Type,
- kLine_Type,
- kBitmap_Type,
- kRect_Type,
- kRRect_Type,
- kOval_Type,
- kPath_Type,
- kText_Type,
- };
-
- static constexpr int kTypeCount = kText_Type + 1;
-
- /**
- * Called with the paint that will be used to draw the specified type.
- * The implementation may modify the paint as they wish. If filter()
- * returns false, the draw will be skipped.
- */
- virtual bool filter(SkPaint*, Type) = 0;
-
-private:
- typedef SkRefCnt INHERITED;
-};
-
-#endif
diff --git a/include/effects/SkPaintFlagsDrawFilter.h b/include/effects/SkPaintFlagsDrawFilter.h
deleted file mode 100644
index 10dd3c4d69..0000000000
--- a/include/effects/SkPaintFlagsDrawFilter.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2008 The Android Open Source Project
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SkPaintFlagsDrawFilter_DEFINED
-#define SkPaintFlagsDrawFilter_DEFINED
-
-#include "SkDrawFilter.h"
-
-class SK_API SkPaintFlagsDrawFilter : public SkDrawFilter {
-public:
- SkPaintFlagsDrawFilter(uint32_t clearFlags, uint32_t setFlags);
-
- bool filter(SkPaint*, Type) override;
-
-private:
- uint16_t fClearFlags; // user specified
- uint16_t fSetFlags; // user specified
-};
-
-#endif
diff --git a/include/utils/SkNWayCanvas.h b/include/utils/SkNWayCanvas.h
index 188c0a102c..f7307d9649 100644
--- a/include/utils/SkNWayCanvas.h
+++ b/include/utils/SkNWayCanvas.h
@@ -22,13 +22,6 @@ public:
virtual void removeCanvas(SkCanvas*);
virtual void removeAll();
- ///////////////////////////////////////////////////////////////////////////
- // These are forwarded to the N canvases we're referencing
-
-#ifdef SK_SUPPORT_LEGACY_DRAWFILTER
- SkDrawFilter* setDrawFilter(SkDrawFilter*) override;
-#endif
-
protected:
SkTDArray<SkCanvas*> fList;