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

Unified Diff: include/gpu/GrXferProcessor.h

Issue 814933002: Add an InvariantOutput for the XPF. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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/gpu/GrXferProcessor.h
diff --git a/include/gpu/GrXferProcessor.h b/include/gpu/GrXferProcessor.h
index 80e375c03c36279fb1c9f68f07a8b0dc9b6d5492..98585c6a5374b311ef532b352567c158a26977eb 100644
--- a/include/gpu/GrXferProcessor.h
+++ b/include/gpu/GrXferProcessor.h
@@ -180,13 +180,21 @@ public:
virtual bool canApplyCoverage(const GrProcOptInfo& colorPOI, const GrProcOptInfo& coveragePOI,
bool colorWriteDisabled) const = 0;
- /**
- * This function returns true if the destination pixel values will be read for blending during
- * draw.
+
+ struct InvariantOutput {
+ bool fWillBlendWithDst;
+ GrColor fBlendedColor;
+ uint32_t fBlendedColorFlags;
+ };
+
+ /**
+ * This function returns known information about the output of the xfer processor produced by
+ * this xp factory. The invariant color information returned by this function refers to the
+ * final color produced after all blending.
*/
// TODO: remove need for colorWriteDisabled once only XP can read dst.
- virtual bool willBlendWithDst(const GrProcOptInfo& colorPOI, const GrProcOptInfo& coveragePOI,
- bool colorWriteDisabled) const = 0;
+ virtual void getInvariantOutput(const GrProcOptInfo& colorPOI, const GrProcOptInfo& coveragePOI,
+ bool colorWriteDisabled, InvariantOutput*) const = 0;
/**
* Determines whether multiplying the computed per-pixel color by the pixel's fractional
@@ -195,10 +203,6 @@ public:
*/
virtual bool canTweakAlphaForCoverage() const = 0;
- virtual bool getOpaqueAndKnownColor(const GrProcOptInfo& colorPOI,
- const GrProcOptInfo& coveragePOI, GrColor* solidColor,
- uint32_t* solidColorKnownComponents) const = 0;
-
bool isEqual(const GrXPFactory& that) const {
if (this->classID() != that.classID()) {
return false;

Powered by Google App Engine
This is Rietveld 408576698