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

Unified Diff: src/gpu/effects/GrCustomXfermodePriv.h

Issue 1225923010: Refugee from Dead Machine 4: MDB Monster Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Last update from dead machine 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 | « src/gpu/effects/GrCustomXfermode.cpp ('k') | src/gpu/effects/GrDisableColorXP.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrCustomXfermodePriv.h
diff --git a/src/gpu/effects/GrCustomXfermodePriv.h b/src/gpu/effects/GrCustomXfermodePriv.h
new file mode 100644
index 0000000000000000000000000000000000000000..2c150cdd31be0d026b593c69d8947989e706ef20
--- /dev/null
+++ b/src/gpu/effects/GrCustomXfermodePriv.h
@@ -0,0 +1,95 @@
+/*
+ * 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 GrCustomXfermodePriv_DEFINED
+#define GrCustomXfermodePriv_DEFINED
+
+#include "GrCaps.h"
+#include "GrCoordTransform.h"
+#include "GrFragmentProcessor.h"
+#include "GrTextureAccess.h"
+#include "GrXferProcessor.h"
+#include "SkXfermode.h"
+
+class GrGLCaps;
+class GrGLFragmentProcessor;
+class GrInvariantOutput;
+class GrProcessorKeyBuilder;
+class GrTexture;
+
+///////////////////////////////////////////////////////////////////////////////
+// Fragment Processor
+///////////////////////////////////////////////////////////////////////////////
+
+class GrCustomXferFP : public GrFragmentProcessor {
+public:
+ GrCustomXferFP(GrProcessorDataManager*, SkXfermode::Mode mode, GrTexture* background, GrRenderTarget* dst);
+
+ const char* name() const override { return "Custom Xfermode"; }
+
+ SkXfermode::Mode mode() const { return fMode; }
+ const GrTextureAccess& backgroundAccess() const { return fBackgroundAccess; }
+
+private:
+ GrGLFragmentProcessor* onCreateGLInstance() const override;
+
+ void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override;
+
+ bool onIsEqual(const GrFragmentProcessor& other) const override;
+
+ void onComputeInvariantOutput(GrInvariantOutput* inout) const override;
+
+ GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
+
+ SkXfermode::Mode fMode;
+ GrCoordTransform fBackgroundTransform;
+ GrTextureAccess fBackgroundAccess;
+
+ typedef GrFragmentProcessor INHERITED;
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// Xfer Processor
+///////////////////////////////////////////////////////////////////////////////
+
+class GrCustomXPFactory : public GrXPFactory {
+public:
+ GrCustomXPFactory(SkXfermode::Mode mode);
+
+ bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlags) const override {
+ return true;
+ }
+
+ void getInvariantBlendedColor(const GrProcOptInfo& colorPOI,
+ GrXPFactory::InvariantBlendedColor*) const override;
+
+private:
+ GrXferProcessor* onCreateXferProcessor(const GrCaps& caps,
+ const GrProcOptInfo& colorPOI,
+ const GrProcOptInfo& coveragePOI,
+ bool hasMixedSamples,
+ const DstTexture*, GrRenderTarget* dst) const override;
+
+ bool willReadDstColor(const GrCaps& caps,
+ const GrProcOptInfo& colorPOI,
+ const GrProcOptInfo& coveragePOI,
+ bool hasMixedSamples) const override;
+
+ bool onIsEqual(const GrXPFactory& xpfBase) const override {
+ const GrCustomXPFactory& xpf = xpfBase.cast<GrCustomXPFactory>();
+ return fMode == xpf.fMode;
+ }
+
+ GR_DECLARE_XP_FACTORY_TEST;
+
+ SkXfermode::Mode fMode;
+ GrBlendEquation fHWBlendEquation;
+
+ typedef GrXPFactory INHERITED;
+};
+#endif
+
« no previous file with comments | « src/gpu/effects/GrCustomXfermode.cpp ('k') | src/gpu/effects/GrDisableColorXP.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698