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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/effects/SkAlphaThresholdFilter.h ('k') | src/effects/GrAlphaThresholdFragmentProcessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/GrAlphaThresholdFragmentProcessor.h
diff --git a/src/effects/GrAlphaThresholdFragmentProcessor.h b/src/effects/GrAlphaThresholdFragmentProcessor.h
new file mode 100644
index 0000000000000000000000000000000000000000..be04e22b444ba30da134f4b04cdc9352332df70a
--- /dev/null
+++ b/src/effects/GrAlphaThresholdFragmentProcessor.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrAlphaThresholdFragmentProcessor_DEFINED
+#define GrAlphaThresholdFragmentProcessor_DEFINED
+
+#include "SkTypes.h"
+
+#if SK_SUPPORT_GPU
+
+#include "GrCoordTransform.h"
+#include "GrFragmentProcessor.h"
+#include "GrProcessorUnitTest.h"
+
+class GrAlphaThresholdFragmentProcessor : public GrFragmentProcessor {
+
+public:
+ static sk_sp<GrFragmentProcessor> Make(GrTexture* texture,
+ GrTexture* maskTexture,
+ float innerThreshold,
+ float outerThreshold,
+ const SkIRect& bounds);
+
+ const char* name() const override { return "Alpha Threshold"; }
+
+ float innerThreshold() const { return fInnerThreshold; }
+ float outerThreshold() const { return fOuterThreshold; }
+
+private:
+ GrAlphaThresholdFragmentProcessor(GrTexture* texture,
+ GrTexture* maskTexture,
+ float innerThreshold,
+ float outerThreshold,
+ const SkIRect& bounds);
+
+ GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+
+ void onGetGLSLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
+
+ bool onIsEqual(const GrFragmentProcessor&) const override;
+
+ void onComputeInvariantOutput(GrInvariantOutput* inout) const override;
+
+ GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
+
+ float fInnerThreshold;
+ float fOuterThreshold;
+ GrCoordTransform fImageCoordTransform;
+ GrTextureAccess fImageTextureAccess;
+ GrCoordTransform fMaskCoordTransform;
+ GrTextureAccess fMaskTextureAccess;
+
+ typedef GrFragmentProcessor INHERITED;
+};
+
+#endif
+#endif
« 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