aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2014-10-02 12:12:48 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-02 12:12:48 -0700
commitb4b7a4c9ea2e399db550f93e3754c351e5b2079a (patch)
treef67932963699b8dac498d3e67f70cc2c505c70a3 /include
parent85d3427d4932c6cfaf02f8a7454f0c6f213b0c2e (diff)
Revert of Add isSingleComponent bool to getConstantColorComponent (patchset #6 id:100001 of https://codereview.chromium.org/608253002/)
Reason for revert: Changing some GMs Original issue's description: > Add isSingleComponent bool to getConstantColorComponent > > Initial step to allowing effects to use/output 1 or 4 color/coverage components. This cl doesn't change any current logic and all effects still assume they are working with 4 components. > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/3b8af078281a5a20f951b9fd84f38d92b8f6217b TBR=joshualitt@chromium.org,bsalomon@google.com,reed@google.com,egdaniel@google.com NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/617853003
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrProcessor.h49
1 files changed, 5 insertions, 44 deletions
diff --git a/include/gpu/GrProcessor.h b/include/gpu/GrProcessor.h
index b309d2d67c..7053872bbe 100644
--- a/include/gpu/GrProcessor.h
+++ b/include/gpu/GrProcessor.h
@@ -37,49 +37,14 @@ public:
virtual ~GrProcessor();
- struct InvariantOutput{
- GrColor fColor;
- uint32_t fValidFlags;
- bool fIsSingleComponent;
-
- bool isOpaque() const {
- return ((fValidFlags & kA_GrColorComponentFlag) && 0xFF == GrColorUnpackA(fColor));
- }
-
- bool isSolidWhite() const {
- return (fValidFlags == kRGBA_GrColorComponentFlags &&
- 0xFFFFFFFF == GrColorUnpackA(fColor));
- }
-
- /**
- * If isSingleComponent is true, then the flag values for r, g, b, and a must all be the
- * same. If the flags are all set then all color components must be equal.
- */
- SkDEBUGCODE(void validate() const;)
-
- private:
- SkDEBUGCODE(bool colorComponentsAllEqual() const;)
-
- /**
- * If alpha is valid, check that any valid R,G,B values are <= A
- */
- SkDEBUGCODE(bool validPreMulColor() const;)
- };
-
/**
- * This function is used to perform optimizations. When called the invarientOuput param
+ * This function is used to perform optimizations. When called the color and validFlags params
* indicate whether the input components to this effect 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.
+ * validFlags is a bitfield of GrColorComponentFlags. The function updates both params to
+ * indicate known values of its output. A component of the color param only has meaning if the
+ * corresponding bit in validFlags is set.
*/
- void computeInvariantOutput(InvariantOutput* inout) const {
- this->onComputeInvariantOutput(inout);
-#ifdef SK_DEBUG
- inout->validate();
-#endif
- }
+ virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags) const = 0;
/** This object, besides creating back-end-specific helper objects, is used for run-time-type-
identification. The factory should be an instance of templated class,
@@ -193,10 +158,6 @@ private:
getFactory()).*/
virtual bool onIsEqual(const GrProcessor& other) const = 0;
- /**
- * Subclass implements this to support getConstantColorComponents(...).
- */
- virtual void onComputeInvariantOutput(InvariantOutput* inout) const = 0;
friend class GrGeometryProcessor; // to set fRequiresVertexShader and build fVertexAttribTypes.
SkSTArray<4, const GrCoordTransform*, true> fCoordTransforms;