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

Side by Side Diff: src/effects/GrAlphaThresholdFragmentProcessor.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
OLDNEW
(Empty)
1 /*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef GrAlphaThresholdFragmentProcessor_DEFINED
9 #define GrAlphaThresholdFragmentProcessor_DEFINED
10
11 #include "SkTypes.h"
12
13 #if SK_SUPPORT_GPU
14
15 #include "GrCoordTransform.h"
16 #include "GrFragmentProcessor.h"
17 #include "GrProcessorUnitTest.h"
18
19 class GrAlphaThresholdFragmentProcessor : public GrFragmentProcessor {
20
21 public:
22 static sk_sp<GrFragmentProcessor> Make(GrTexture* texture,
23 GrTexture* maskTexture,
24 float innerThreshold,
25 float outerThreshold,
26 const SkIRect& bounds);
27
28 const char* name() const override { return "Alpha Threshold"; }
29
30 float innerThreshold() const { return fInnerThreshold; }
31 float outerThreshold() const { return fOuterThreshold; }
32
33 private:
34 GrAlphaThresholdFragmentProcessor(GrTexture* texture,
35 GrTexture* maskTexture,
36 float innerThreshold,
37 float outerThreshold,
38 const SkIRect& bounds);
39
40 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
41
42 void onGetGLSLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
43
44 bool onIsEqual(const GrFragmentProcessor&) const override;
45
46 void onComputeInvariantOutput(GrInvariantOutput* inout) const override;
47
48 GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
49
50 float fInnerThreshold;
51 float fOuterThreshold;
52 GrCoordTransform fImageCoordTransform;
53 GrTextureAccess fImageTextureAccess;
54 GrCoordTransform fMaskCoordTransform;
55 GrTextureAccess fMaskTextureAccess;
56
57 typedef GrFragmentProcessor INHERITED;
58 };
59
60 #endif
61 #endif
OLDNEW
« no previous file with comments | « include/effects/SkAlphaThresholdFilter.h ('k') | src/effects/GrAlphaThresholdFragmentProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698