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

Unified Diff: src/effects/SkArithmeticMode_gpu.h

Issue 827163004: Move Gpu ArithmeticMode xfer effect to _gpu files. (Closed) Base URL: https://skia.googlesource.com/skia.git@preCustomXP
Patch Set: Review cleanup Created 5 years, 11 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 | « src/effects/SkArithmeticMode.cpp ('k') | src/effects/SkArithmeticMode_gpu.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkArithmeticMode_gpu.h
diff --git a/src/effects/SkArithmeticMode_gpu.h b/src/effects/SkArithmeticMode_gpu.h
new file mode 100644
index 0000000000000000000000000000000000000000..84b839d2cb8c88745dfe58042a470392385198bc
--- /dev/null
+++ b/src/effects/SkArithmeticMode_gpu.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkArithmeticMode_gpu_DEFINED
+#define SkArithmeticMode_gpu_DEFINED
+
+#if SK_SUPPORT_GPU
+
+#include "GrCoordTransform.h"
+#include "GrFragmentProcessor.h"
+#include "GrTextureAccess.h"
+
+class GrInvariantOutput;
+class GrTexture;
+
+///////////////////////////////////////////////////////////////////////////////
+// Fragment Processor
+///////////////////////////////////////////////////////////////////////////////
+
+class GrGLArtithmeticFP;
+
+class GrArithmeticFP : public GrFragmentProcessor {
+public:
+ static GrFragmentProcessor* Create(float k1, float k2, float k3, float k4, bool enforcePMColor,
+ GrTexture* background) {
+ return SkNEW_ARGS(GrArithmeticFP, (k1, k2, k3, k4, enforcePMColor, background));
+ }
+
+ ~GrArithmeticFP() SK_OVERRIDE {};
+
+ const char* name() const SK_OVERRIDE { return "Arithmetic"; }
+
+ void getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const SK_OVERRIDE;
+
+ GrGLFragmentProcessor* createGLInstance() const SK_OVERRIDE;
+
+ GrTexture* backgroundTexture() const { return fBackgroundAccess.getTexture(); }
+
+ float k1() const { return fK1; }
+ float k2() const { return fK2; }
+ float k3() const { return fK3; }
+ float k4() const { return fK4; }
+ bool enforcePMColor() const { return fEnforcePMColor; }
+
+private:
+ bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE;
+
+ void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVERRIDE;
+
+ GrArithmeticFP(float k1, float k2, float k3, float k4, bool enforcePMColor,
+ GrTexture* background);
+
+ float fK1, fK2, fK3, fK4;
+ bool fEnforcePMColor;
+ GrCoordTransform fBackgroundTransform;
+ GrTextureAccess fBackgroundAccess;
+
+ GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
+ typedef GrFragmentProcessor INHERITED;
+};
+
+#endif
+#endif
« no previous file with comments | « src/effects/SkArithmeticMode.cpp ('k') | src/effects/SkArithmeticMode_gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698