Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(308)

Unified Diff: include/effects/SkAlphaThresholdFilter.h

Issue 115633002: Add AlphaThreshold filter. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: include/effects/SkAlphaThresholdFilter.h
diff --git a/include/effects/SkMagnifierImageFilter.h b/include/effects/SkAlphaThresholdFilter.h
similarity index 53%
copy from include/effects/SkMagnifierImageFilter.h
copy to include/effects/SkAlphaThresholdFilter.h
index b5a79fa14f638c412b9c21373b0be9ac4862a8b3..3995b79bc4a3b363828aaade3f0952689c80d1f4 100644
--- a/include/effects/SkMagnifierImageFilter.h
+++ b/include/effects/SkAlphaThresholdFilter.h
@@ -1,25 +1,25 @@
/*
- * Copyright 2012 The Android Open Source Project
+ * Copyright 2013 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 SkMagnifierImageFilter_DEFINED
-#define SkMagnifierImageFilter_DEFINED
+#ifndef SkAlphaThresholdFilter_DEFINED
+#define SkAlphaThresholdFilter_DEFINED
-#include "SkRect.h"
+#include "SkRegion.h"
#include "SkImageFilter.h"
-class SK_API SkMagnifierImageFilter : public SkImageFilter {
+class SK_API SkAlphaThresholdFilter : public SkImageFilter {
public:
- SkMagnifierImageFilter(SkRect srcRect, SkScalar inset);
+ SkAlphaThresholdFilter(SkRegion region, SkScalar innerThreshold, SkScalar outerThreshold);
bsalomon 2013/12/16 14:20:58 One pattern we like to use if possible in Skia is
Zachary Kuznia 2013/12/18 00:06:27 Done.
- SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMagnifierImageFilter)
+ SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkAlphaThresholdFilter)
protected:
- explicit SkMagnifierImageFilter(SkFlattenableReadBuffer& buffer);
+ explicit SkAlphaThresholdFilter(SkFlattenableReadBuffer& buffer);
virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
@@ -29,8 +29,9 @@ protected:
#endif
private:
- SkRect fSrcRect;
- SkScalar fInset;
+ SkRegion fRegion;
+ SkScalar fInnerThreshold;
+ SkScalar fOuterThreshold;
typedef SkImageFilter INHERITED;
};

Powered by Google App Engine
This is Rietveld 408576698