aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-12-18 19:18:39 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-12-18 19:18:39 +0000
commit30711b764be6bbb58caa30a0ac5d1474c894efe7 (patch)
tree4014cf3c3bb63cab21359dbc126999d26db43f1e /include
parentee8a8e3931c1d3f39755ee8beaf0c7cb1ba91888 (diff)
change SkMaskFilter methods to const, in preparation for making the class as
immutable and re-entrant safe. Review URL: https://codereview.appspot.com/6944069 git-svn-id: http://skia.googlecode.com/svn/trunk@6881 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r--include/core/SkDraw.h2
-rw-r--r--include/core/SkMaskFilter.h10
-rw-r--r--include/effects/SkEmbossMaskFilter.h4
-rw-r--r--include/effects/SkKernel33MaskFilter.h10
-rw-r--r--include/effects/SkStippleMaskFilter.h4
-rw-r--r--include/effects/SkTableMaskFilter.h8
6 files changed, 18 insertions, 20 deletions
diff --git a/include/core/SkDraw.h b/include/core/SkDraw.h
index 5db4bf0eb1..4ac7cf9fa0 100644
--- a/include/core/SkDraw.h
+++ b/include/core/SkDraw.h
@@ -76,7 +76,7 @@ public:
solely to assist in computing the mask's bounds (if the mode requests that).
*/
static bool DrawToMask(const SkPath& devPath, const SkIRect* clipBounds,
- SkMaskFilter* filter, const SkMatrix* filterMatrix,
+ const SkMaskFilter*, const SkMatrix* filterMatrix,
SkMask* mask, SkMask::CreateMode mode,
SkPaint::Style style);
diff --git a/include/core/SkMaskFilter.h b/include/core/SkMaskFilter.h
index 02f58551b4..245de29b8e 100644
--- a/include/core/SkMaskFilter.h
+++ b/include/core/SkMaskFilter.h
@@ -40,7 +40,7 @@ public:
/** Returns the format of the resulting mask that this subclass will return
when its filterMask() method is called.
*/
- virtual SkMask::Format getFormat() = 0;
+ virtual SkMask::Format getFormat() const = 0;
/** Create a new mask by filter the src mask.
If src.fImage == null, then do not allocate or create the dst image
@@ -56,7 +56,7 @@ public:
@return true if the dst mask was correctly created.
*/
virtual bool filterMask(SkMask* dst, const SkMask& src, const SkMatrix&,
- SkIPoint* margin);
+ SkIPoint* margin) const;
enum BlurType {
kNone_BlurType, //!< this maskfilter is not a blur
@@ -91,7 +91,7 @@ public:
* The default impl calls filterMask with the src mask having no image,
* but subclasses may override this if they can compute the rect faster.
*/
- virtual void computeFastBounds(const SkRect& src, SkRect* dest);
+ virtual void computeFastBounds(const SkRect& src, SkRect* dest) const;
protected:
// empty for now, but lets get our subclass to remember to init us for the future
@@ -127,7 +127,7 @@ protected:
virtual FilterReturn filterRectsToNine(const SkRect[], int count,
const SkMatrix&,
const SkIRect& clipBounds,
- NinePatch*);
+ NinePatch*) const;
private:
friend class SkDraw;
@@ -139,7 +139,7 @@ private:
*/
bool filterPath(const SkPath& devPath, const SkMatrix& devMatrix,
const SkRasterClip&, SkBounder*, SkBlitter* blitter,
- SkPaint::Style style);
+ SkPaint::Style style) const;
typedef SkFlattenable INHERITED;
};
diff --git a/include/effects/SkEmbossMaskFilter.h b/include/effects/SkEmbossMaskFilter.h
index 96c25b247d..ce6447371f 100644
--- a/include/effects/SkEmbossMaskFilter.h
+++ b/include/effects/SkEmbossMaskFilter.h
@@ -27,10 +27,10 @@ public:
// overrides from SkMaskFilter
// This method is not exported to java.
- virtual SkMask::Format getFormat();
+ virtual SkMask::Format getFormat() const SK_OVERRIDE;
// This method is not exported to java.
virtual bool filterMask(SkMask* dst, const SkMask& src, const SkMatrix&,
- SkIPoint* margin);
+ SkIPoint* margin) const SK_OVERRIDE;
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkEmbossMaskFilter)
diff --git a/include/effects/SkKernel33MaskFilter.h b/include/effects/SkKernel33MaskFilter.h
index 41e73c91ec..9fcbb6afa7 100644
--- a/include/effects/SkKernel33MaskFilter.h
+++ b/include/effects/SkKernel33MaskFilter.h
@@ -15,11 +15,11 @@ public:
SkKernel33ProcMaskFilter(unsigned percent256 = 256)
: fPercent256(percent256) {}
- virtual uint8_t computeValue(uint8_t* const* srcRows) = 0;
+ virtual uint8_t computeValue(uint8_t* const* srcRows) const = 0;
- // overrides from SkMaskFilter
- virtual SkMask::Format getFormat();
- virtual bool filterMask(SkMask*, const SkMask&, const SkMatrix&, SkIPoint*);
+ virtual SkMask::Format getFormat() const SK_OVERRIDE;
+ virtual bool filterMask(SkMask*, const SkMask&, const SkMatrix&,
+ SkIPoint*) const SK_OVERRIDE;
protected:
SkKernel33ProcMaskFilter(SkFlattenableReadBuffer& rb);
@@ -42,7 +42,7 @@ public:
}
// override from SkKernel33ProcMaskFilter
- virtual uint8_t computeValue(uint8_t* const* srcRows);
+ virtual uint8_t computeValue(uint8_t* const* srcRows) const SK_OVERRIDE;
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkKernel33MaskFilter)
diff --git a/include/effects/SkStippleMaskFilter.h b/include/effects/SkStippleMaskFilter.h
index b5d162e005..be03c4590e 100644
--- a/include/effects/SkStippleMaskFilter.h
+++ b/include/effects/SkStippleMaskFilter.h
@@ -20,10 +20,10 @@ public:
virtual bool filterMask(SkMask* dst, const SkMask& src,
const SkMatrix& matrix,
- SkIPoint* margin) SK_OVERRIDE;
+ SkIPoint* margin) const SK_OVERRIDE;
// getFormat is from SkMaskFilter
- virtual SkMask::Format getFormat() SK_OVERRIDE {
+ virtual SkMask::Format getFormat() const SK_OVERRIDE {
return SkMask::kA8_Format;
}
diff --git a/include/effects/SkTableMaskFilter.h b/include/effects/SkTableMaskFilter.h
index c407b40b94..feb3b13847 100644
--- a/include/effects/SkTableMaskFilter.h
+++ b/include/effects/SkTableMaskFilter.h
@@ -22,8 +22,6 @@ public:
SkTableMaskFilter(const uint8_t table[256]);
virtual ~SkTableMaskFilter();
- void setTable(const uint8_t table[256]);
-
/** Utility that sets the gamma table
*/
static void MakeGammaTable(uint8_t table[256], SkScalar gamma);
@@ -45,9 +43,9 @@ public:
return SkNEW_ARGS(SkTableMaskFilter, (table));
}
- // overrides from SkMaskFilter
- virtual SkMask::Format getFormat();
- virtual bool filterMask(SkMask*, const SkMask&, const SkMatrix&, SkIPoint*);
+ virtual SkMask::Format getFormat() const SK_OVERRIDE;
+ virtual bool filterMask(SkMask*, const SkMask&, const SkMatrix&,
+ SkIPoint*) const SK_OVERRIDE;
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTableMaskFilter)