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

Unified Diff: include/gpu/GrProcessor.h

Issue 617853003: Revert of Add isSingleComponent bool to getConstantColorComponent (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | src/core/SkXfermode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrProcessor.h
diff --git a/include/gpu/GrProcessor.h b/include/gpu/GrProcessor.h
index b309d2d67c6a77759bbb8fc6df8c1d56a9e8939f..7053872bbe4a75d6e0039c0c646daf00af8043a9 100644
--- a/include/gpu/GrProcessor.h
+++ b/include/gpu/GrProcessor.h
@@ -37,49 +37,14 @@
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.
- */
- void computeInvariantOutput(InvariantOutput* inout) const {
- this->onComputeInvariantOutput(inout);
-#ifdef SK_DEBUG
- inout->validate();
-#endif
- }
+ * 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.
+ */
+ 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 @@
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;
« no previous file with comments | « no previous file | src/core/SkXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698