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

Unified Diff: include/core/SkComposeShader.h

Issue 1306163005: Added function CreateFrom2Procs() in new namespace GrXfermodeFragmentProcessor (Closed) Base URL: https://skia.googlesource.com/skia@cs3_testcreate
Patch Set: added mode <= kLastCoeffMode checks Created 5 years, 3 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
Index: include/core/SkComposeShader.h
diff --git a/include/core/SkComposeShader.h b/include/core/SkComposeShader.h
index 41be197eb7769f766a77da2ddb866a9b2df43346..13163dcdf2df7aecd8424496de85af353f363264 100644
--- a/include/core/SkComposeShader.h
+++ b/include/core/SkComposeShader.h
@@ -88,4 +88,35 @@ private:
typedef SkShader INHERITED;
};
+#if SK_SUPPORT_GPU
bsalomon 2015/09/08 15:10:57 I don't think we should be exposing this object vi
wangyix 2015/09/09 17:32:35 GrComposeEffect::onCreateGLInstance() needs GrGLCo
bsalomon 2015/09/09 17:34:56 move it there too?
wangyix 2015/09/09 17:41:08 Is it weird to have GL-specific stuff in GrXfermod
+
+#include "SkString.h"
tomhudson 2015/09/02 20:02:36 Move the #includes to the top, please.
egdaniel 2015/09/02 20:12:44 So I'm not sure what our official style is, but it
+#include "../gpu/GrFragmentProcessor.h"
+
+/////////////////////////////////////////////////////////////////////
+
+class GrComposeEffect : public GrFragmentProcessor {
+public:
+ GrComposeEffect(const GrFragmentProcessor* fpA, const GrFragmentProcessor* fpB,
+ SkXfermode::Mode mode);
+ const char* name() const override { return "ComposeShader"; }
+ void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override;
+
+ SkXfermode::Mode getMode() const { return fMode; }
+
+protected:
+ bool onIsEqual(const GrFragmentProcessor&) const override;
+ void onComputeInvariantOutput(GrInvariantOutput* inout) const override;
+
+private:
+ GrGLFragmentProcessor* onCreateGLInstance() const override;
+
+ SkXfermode::Mode fMode;
+
+ GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
+
+ typedef GrFragmentProcessor INHERITED;
+};
+#endif
+
#endif

Powered by Google App Engine
This is Rietveld 408576698