diff options
author | 2014-12-10 14:12:22 -0800 | |
---|---|---|
committer | 2014-12-10 14:12:22 -0800 | |
commit | 8c0f615fdd41b8b8048bf398791bb2138c511826 (patch) | |
tree | 99c1df79b95ce740b028382680a9af5359663219 /include/gpu/GrInvariantOutput.h | |
parent | c6bc58eded89b0c0a36b8e20e193c200f297a0da (diff) |
Revert of Remove GP from drawstate, revision of invariant output for GP (patchset #9 id:160001 of https://codereview.chromium.org/791743003/)
Reason for revert:
breaks mac
Original issue's description:
> Remove GP from drawstate, revision of invariant output for GP
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/c6bc58eded89b0c0a36b8e20e193c200f297a0da
TBR=bsalomon@google.com,egdaniel@google.com,joshualitt@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/794843002
Diffstat (limited to 'include/gpu/GrInvariantOutput.h')
-rw-r--r-- | include/gpu/GrInvariantOutput.h | 70 |
1 files changed, 5 insertions, 65 deletions
diff --git a/include/gpu/GrInvariantOutput.h b/include/gpu/GrInvariantOutput.h index 269748a026..1d3eda1b2c 100644 --- a/include/gpu/GrInvariantOutput.h +++ b/include/gpu/GrInvariantOutput.h @@ -10,49 +10,6 @@ #include "GrColor.h" -struct GrInitInvariantOutput { - GrInitInvariantOutput() - : fValidFlags(0) - , fColor(0) - , fIsSingleComponent(false) - , fIsLCDCoverage(false) {} - - void setKnownFourComponents(GrColor color) { - fColor = color; - fValidFlags = kRGBA_GrColorComponentFlags; - fIsSingleComponent = false; - } - - void setUnknownFourComponents() { - fValidFlags = 0; - fIsSingleComponent = false; - } - - void setUnknownOpaqueFourComponents() { - fColor = 0xff << GrColor_SHIFT_A; - fValidFlags = kA_GrColorComponentFlag; - fIsSingleComponent = false; - } - - void setKnownSingleComponent(uint8_t alpha) { - fColor = GrColorPackRGBA(alpha, alpha, alpha, alpha); - fValidFlags = kRGBA_GrColorComponentFlags; - fIsSingleComponent = true; - } - - void setUnknownSingleComponent() { - fValidFlags = 0; - fIsSingleComponent = true; - } - - void setUsingLCDCoverage() { fIsLCDCoverage = true; } - - uint32_t fValidFlags; - GrColor fColor; - bool fIsSingleComponent; - bool fIsLCDCoverage; // Temorary data member until texture pixel configs are updated -}; - class GrInvariantOutput { public: GrInvariantOutput(GrColor color, GrColorComponentFlags flags, bool isSingleComponent) @@ -63,14 +20,6 @@ public: , fWillUseInputColor(true) , fIsLCDCoverage(false) {} - GrInvariantOutput(const GrInitInvariantOutput& io) - : fColor(io.fColor) - , fValidFlags(io.fValidFlags) - , fIsSingleComponent(io.fIsSingleComponent) - , fNonMulStageFound(false) - , fWillUseInputColor(false) - , fIsLCDCoverage(io.fIsLCDCoverage) {} - virtual ~GrInvariantOutput() {} enum ReadInput { @@ -78,18 +27,18 @@ public: kWillNot_ReadInput, }; - void mulByUnknownOpaqueFourComponents() { + void mulByUnknownOpaqueColor() { if (this->isOpaque()) { fValidFlags = kA_GrColorComponentFlag; fIsSingleComponent = false; } else { // Since the current state is not opaque we no longer care if the color being // multiplied is opaque. - this->mulByUnknownFourComponents(); + this->mulByUnknownColor(); } } - void mulByUnknownFourComponents() { + void mulByUnknownColor() { if (this->hasZeroAlpha()) { this->internalSetToTransparentBlack(); } else { @@ -97,7 +46,7 @@ public: } } - void mulByUnknownSingleComponent() { + void mulByUnknownAlpha() { if (this->hasZeroAlpha()) { this->internalSetToTransparentBlack(); } else { @@ -106,7 +55,7 @@ public: } } - void mulByKnownSingleComponent(uint8_t alpha) { + void mulByKnownAlpha(uint8_t alpha) { if (this->hasZeroAlpha() || 0 == alpha) { this->internalSetToTransparentBlack(); } else { @@ -173,15 +122,6 @@ private: fWillUseInputColor = true; } - void reset(const GrInitInvariantOutput& io) { - fColor = io.fColor; - fValidFlags = io.fValidFlags; - fIsSingleComponent = io.fIsSingleComponent; - fNonMulStageFound = false; - fWillUseInputColor = true; - fIsLCDCoverage = io.fIsLCDCoverage; - } - void internalSetToTransparentBlack() { fValidFlags = kRGBA_GrColorComponentFlags; fColor = 0; |