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

Unified Diff: include/gpu/GrInvariantOutput.h

Issue 794843002: Revert of Remove GP from drawstate, revision of invariant output for GP (Closed) Base URL: https://skia.googlesource.com/skia.git@color-to-gp
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
« no previous file with comments | « include/gpu/GrFragmentProcessor.h ('k') | include/gpu/GrProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrInvariantOutput.h
diff --git a/include/gpu/GrInvariantOutput.h b/include/gpu/GrInvariantOutput.h
index 269748a026c8f35b5b80cc02895b513f6c98d9de..1d3eda1b2cd7f437dcc0345b2a9533e658871465 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 @@
, 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 @@
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 @@
}
}
- void mulByUnknownSingleComponent() {
+ void mulByUnknownAlpha() {
if (this->hasZeroAlpha()) {
this->internalSetToTransparentBlack();
} else {
@@ -106,7 +55,7 @@
}
}
- void mulByKnownSingleComponent(uint8_t alpha) {
+ void mulByKnownAlpha(uint8_t alpha) {
if (this->hasZeroAlpha() || 0 == alpha) {
this->internalSetToTransparentBlack();
} else {
@@ -173,15 +122,6 @@
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;
« no previous file with comments | « include/gpu/GrFragmentProcessor.h ('k') | include/gpu/GrProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698