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

Unified Diff: include/core/SkComposeShader.h

Issue 1314923002: GLProgramsTest can now randomly create a tree of GrFragmentProcessors instead of a linear pipeline (Closed) Base URL: https://skia.googlesource.com/skia@cs3_testcreate
Patch Set: nits by Josh Created 5 years, 4 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 | « no previous file | src/core/SkComposeShader.cpp » ('j') | tests/GLProgramsTest.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkComposeShader.h
diff --git a/include/core/SkComposeShader.h b/include/core/SkComposeShader.h
index 956ba6e00d2ad003ae27817160bb359003d3d5c0..763a1daa45e21a8c624c48c511bf7525fd1406a8 100644
--- a/include/core/SkComposeShader.h
+++ b/include/core/SkComposeShader.h
@@ -84,4 +84,46 @@ private:
typedef SkShader INHERITED;
};
+#if SK_SUPPORT_GPU
+
+#include "SkString.h"
+#include "../gpu/GrFragmentProcessor.h"
+
+/////////////////////////////////////////////////////////////////////
+
+class GrComposeEffect : public GrFragmentProcessor {
+public:
+
+ static GrFragmentProcessor* Create(const GrFragmentProcessor* fpA,
+ const GrFragmentProcessor* fpB,
+ SkXfermode::Mode mode);
+ const char* name() const override {return fName.c_str(); }
tomhudson 2015/08/25 19:29:24 Teensy-tiny nit: space before return.
wangyix 2015/08/25 21:34:09 Done.
+ void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override;
+
+ SkXfermode::Mode getMode() const { return fMode; }
+ int getShaderAChildIndex() const { return fShaderAChildIndex; }
+ int getShaderBChildIndex() const { return fShaderBChildIndex; }
+
+protected:
+ bool onIsEqual(const GrFragmentProcessor&) const override;
+ void onComputeInvariantOutput(GrInvariantOutput* inout) const override;
+
+private:
+ GrComposeEffect(const GrFragmentProcessor* fpA, const GrFragmentProcessor* fpB,
+ SkXfermode::Mode mode);
+
+ GrGLFragmentProcessor* onCreateGLInstance() const override;
+
+ SkString fName;
+ int fShaderAChildIndex;
+ int fShaderBChildIndex;
+ SkXfermode::Mode fMode;
+
+ GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
+
+ typedef GrFragmentProcessor INHERITED;
+};
+
+#endif
+
#endif
« no previous file with comments | « no previous file | src/core/SkComposeShader.cpp » ('j') | tests/GLProgramsTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698