Remove GP from drawstate, revision of invariant output for GP
BUG=skia:
Committed: https://skia.googlesource.com/skia/+/c6bc58eded89b0c0a36b8e20e193c200f297a0da
Review URL: https://codereview.chromium.org/791743003
diff --git a/include/gpu/GrFragmentProcessor.h b/include/gpu/GrFragmentProcessor.h
index 3f308d7..0c15599 100644
--- a/include/gpu/GrFragmentProcessor.h
+++ b/include/gpu/GrFragmentProcessor.h
@@ -67,6 +67,16 @@
return this->onIsEqual(that);
}
+ /**
+ * This function is used to perform optimizations. When called the invarientOuput param
+ * indicate whether the input components to this processor in the FS will have known values.
+ * In inout the validFlags member is a bitfield of GrColorComponentFlags. The isSingleComponent
+ * member indicates whether the input will be 1 or 4 bytes. The function updates the members of
+ * inout to indicate known values of its output. A component of the color member only has
+ * meaning if the corresponding bit in validFlags is set.
+ */
+ void computeInvariantOutput(GrInvariantOutput* inout) const;
+
protected:
/**
* Fragment Processor subclasses call this from their constructor to register coordinate
@@ -101,6 +111,11 @@
*/
void setWillNotUseInputColor() { fWillUseInputColor = false; }
+ /**
+ * Subclass implements this to support getConstantColorComponents(...).
+ */
+ virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const = 0;
+
private:
/**
* Subclass implements this to support isEqual(). It will only be called if it is known that