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

Side by Side Diff: src/effects/SkAlphaThresholdFilterImpl.h

Issue 1500373003: SkAlphaThresholdFilter allow flattening (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 2015 Google Inc.
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 #ifndef SkAlphaThresholdFilterImpl_DEFINED
8 #define SkAlphaThresholdFilterImpl_DEFINED
7 9
10 #include "SkImageFilter.h"
11 #include "SkRegion.h"
8 12
9 #ifndef SkMagnifierImageFilter_DEFINED 13 class SK_API SkAlphaThresholdFilterImpl : public SkImageFilter {
10 #define SkMagnifierImageFilter_DEFINED
11
12 #include "SkRect.h"
13 #include "SkImageFilter.h"
14
15 class SK_API SkMagnifierImageFilter : public SkImageFilter {
16 public: 14 public:
17 static SkImageFilter* Create(const SkRect& src, SkScalar inset, SkImageFilte r* input = NULL); 15 SkAlphaThresholdFilterImpl(const SkRegion& region, SkScalar innerThreshold,
16 SkScalar outerThreshold, SkImageFilter* input);
18 17
19 SK_TO_STRING_OVERRIDE() 18 SK_TO_STRING_OVERRIDE()
20 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMagnifierImageFilter) 19 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkAlphaThresholdFilterIm pl)
21 20
22 protected: 21 protected:
23 SkMagnifierImageFilter(const SkRect& srcRect, SkScalar inset, SkImageFilter* input);
24 void flatten(SkWriteBuffer&) const override; 22 void flatten(SkWriteBuffer&) const override;
25 23
26 bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, 24 bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
27 SkBitmap* result, SkIPoint* offset) const override; 25 SkBitmap* result, SkIPoint* offset) const override;
28 #if SK_SUPPORT_GPU 26 #if SK_SUPPORT_GPU
29 bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const SkMatrix&, 27 bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const SkMatrix&,
30 const SkIRect& bounds) const override; 28 const SkIRect& bounds) const override;
31 #endif 29 #endif
32 30
33 private: 31 private:
34 SkRect fSrcRect; 32 SkRegion fRegion;
35 SkScalar fInset; 33 SkScalar fInnerThreshold;
34 SkScalar fOuterThreshold;
36 typedef SkImageFilter INHERITED; 35 typedef SkImageFilter INHERITED;
37 }; 36 };
38 37
39 #endif 38 #endif // SkAlphaThresholdFilterImpl_DEFINED
OLDNEW
« src/effects/SkAlphaThresholdFilter.cpp ('K') | « src/effects/SkAlphaThresholdFilter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698