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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The Android Open Source Project 2 * Copyright 2013 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #ifndef SkMagnifierImageFilter_DEFINED 9 #ifndef SkAlphaThresholdFilter_DEFINED
10 #define SkMagnifierImageFilter_DEFINED 10 #define SkAlphaThresholdFilter_DEFINED
11 11
12 #include "SkRect.h" 12 #include "SkRegion.h"
13 #include "SkImageFilter.h" 13 #include "SkImageFilter.h"
14 14
15 class SK_API SkMagnifierImageFilter : public SkImageFilter { 15 class SK_API SkAlphaThresholdFilter : public SkImageFilter {
16 public: 16 public:
17 SkMagnifierImageFilter(SkRect srcRect, SkScalar inset); 17 SkAlphaThresholdFilter(SkRegion region, SkScalar innerThreshold, SkScalar ou terThreshold);
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.
18 18
19 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMagnifierImageFilter) 19 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkAlphaThresholdFilter)
20 20
21 protected: 21 protected:
22 explicit SkMagnifierImageFilter(SkFlattenableReadBuffer& buffer); 22 explicit SkAlphaThresholdFilter(SkFlattenableReadBuffer& buffer);
23 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; 23 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
24 24
25 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, 25 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
26 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; 26 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE;
27 #if SK_SUPPORT_GPU 27 #if SK_SUPPORT_GPU
28 virtual bool asNewEffect(GrEffectRef** effect, GrTexture* texture, const SkM atrix& matrix, const SkIRect& bounds) const SK_OVERRIDE; 28 virtual bool asNewEffect(GrEffectRef** effect, GrTexture* texture, const SkM atrix& matrix, const SkIRect& bounds) const SK_OVERRIDE;
29 #endif 29 #endif
30 30
31 private: 31 private:
32 SkRect fSrcRect; 32 SkRegion fRegion;
33 SkScalar fInset; 33 SkScalar fInnerThreshold;
34 SkScalar fOuterThreshold;
34 typedef SkImageFilter INHERITED; 35 typedef SkImageFilter INHERITED;
35 }; 36 };
36 37
37 #endif 38 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698