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

Side by Side Diff: include/effects/SkAlphaThresholdFilter.h

Issue 1893193002: Split AlphaThresholdEffect out into its own file (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix test Created 4 years, 8 months 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
« no previous file with comments | « gyp/effects.gypi ('k') | src/effects/GrAlphaThresholdFragmentProcessor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 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 7
8 #ifndef SkAlphaThresholdFilter_DEFINED 8 #ifndef SkAlphaThresholdFilter_DEFINED
9 #define SkAlphaThresholdFilter_DEFINED 9 #define SkAlphaThresholdFilter_DEFINED
10 10
11 #include "SkImageFilter.h" 11 #include "SkImageFilter.h"
12 #include "SkRegion.h" 12
13 class SkRegion;
13 14
14 class SK_API SkAlphaThresholdFilter { 15 class SK_API SkAlphaThresholdFilter {
15 public: 16 public:
16 /** 17 /**
17 * Creates an image filter that samples a region. If the sample is inside th e 18 * Creates an image filter that samples a region. If the sample is inside th e
18 * region the alpha of the image is boosted up to a threshold value. If it i s 19 * region the alpha of the image is boosted up to a threshold value. If it i s
19 * outside the region then the alpha is decreased to the threshold value. 20 * outside the region then the alpha is decreased to the threshold value.
20 * The 0,0 point of the region corresponds to the upper left corner of the 21 * The 0,0 point of the region corresponds to the upper left corner of the
21 * source image. 22 * source image.
22 */ 23 */
23 static sk_sp<SkImageFilter> Make(const SkRegion& region, SkScalar innerMin, 24 static sk_sp<SkImageFilter> Make(const SkRegion& region, SkScalar innerMin,
24 SkScalar outerMax, sk_sp<SkImageFilter> inp ut, 25 SkScalar outerMax, sk_sp<SkImageFilter> inp ut,
25 const SkImageFilter::CropRect* cropRect = n ullptr); 26 const SkImageFilter::CropRect* cropRect = n ullptr);
26 27
27 28
28 #ifdef SK_SUPPORT_LEGACY_IMAGEFILTER_PTR 29 #ifdef SK_SUPPORT_LEGACY_IMAGEFILTER_PTR
29 static SkImageFilter* Create(const SkRegion& region, SkScalar innerMin, 30 static SkImageFilter* Create(const SkRegion& region, SkScalar innerMin,
30 SkScalar outerMax, SkImageFilter* input = nullp tr) { 31 SkScalar outerMax, SkImageFilter* input = nullp tr) {
31 return Make(region, innerMin, outerMax, sk_ref_sp<SkImageFilter>(input)) .release(); 32 return Make(region, innerMin, outerMax, sk_ref_sp<SkImageFilter>(input)) .release();
32 } 33 }
33 #endif 34 #endif
34 35
35 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP(); 36 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP();
36 }; 37 };
37 38
38 #endif 39 #endif
OLDNEW
« no previous file with comments | « gyp/effects.gypi ('k') | src/effects/GrAlphaThresholdFragmentProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698