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

Unified Diff: include/gpu/GrProcessor.h

Issue 647863002: Track if all stages modulate inputColor in computeInvariantOutput (Closed) Base URL: https://skia.googlesource.com/skia.git@addSomeFunctions
Patch Set: update 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 | no next file » | 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 5350015d67567dde0f9c29bd5416b0ea514801f1..bbcc919caa525ec545e1b4337a4030df5848bcf9 100644
--- a/include/gpu/GrProcessor.h
+++ b/include/gpu/GrProcessor.h
@@ -38,7 +38,8 @@ public:
virtual ~GrProcessor();
struct InvariantOutput{
- InvariantOutput() : fColor(0), fValidFlags(0), fIsSingleComponent(false) {}
+ InvariantOutput() : fColor(0), fValidFlags(0), fIsSingleComponent(false),
+ fInputIsOnlyModulated(true) {}
bsalomon 2014/10/13 19:52:49 I seems like we should use multiply rather than mo
egdaniel 2014/10/13 20:26:47 Done.
void mulByUnknownOpaqueColor() {
if (this->isOpaque()) {
@@ -53,15 +54,15 @@ public:
void mulByUnknownColor() {
if (this->hasZeroAlpha()) {
- this->setToTransparentBlack();
+ this->setToTransparentBlackPriv();
} else {
- this->setToUnknown();
+ this->setToUnknownPriv();
}
}
void mulByUnknownAlpha() {
if (this->hasZeroAlpha()) {
- this->setToTransparentBlack();
+ this->setToTransparentBlackPriv();
} else {
// We don't need to change fIsSingleComponent in this case
fValidFlags = 0;
@@ -74,20 +75,20 @@ public:
}
void setToTransparentBlack() {
- fValidFlags = kRGBA_GrColorComponentFlags;
- fColor = 0;
- fIsSingleComponent = true;
+ this->setToTransparentBlackPriv();
+ fInputIsOnlyModulated = false;
}
void setToOther(uint8_t validFlags, GrColor color) {
fValidFlags = validFlags;
fColor = color;
fIsSingleComponent = false;
+ fInputIsOnlyModulated = false;
}
void setToUnknown() {
- fValidFlags = 0;
- fIsSingleComponent = false;
+ this->setToUnknownPriv();
+ fInputIsOnlyModulated = false;
}
bool isOpaque() const {
@@ -108,6 +109,17 @@ public:
SkDEBUGCODE(void validate() const;)
private:
+ void setToTransparentBlackPriv() {
+ fValidFlags = kRGBA_GrColorComponentFlags;
+ fColor = 0;
+ fIsSingleComponent = true;
+ }
+
+ void setToUnknownPriv() {
bsalomon 2014/10/13 19:52:49 usually term such things internalSetToUnknown().
egdaniel 2014/10/13 20:26:47 Done.
+ fValidFlags = 0;
+ fIsSingleComponent = false;
+ }
+
bool hasZeroAlpha() const {
return ((fValidFlags & kA_GrColorComponentFlag) && 0 == GrColorUnpackA(fColor));
}
@@ -128,6 +140,7 @@ public:
GrColor fColor;
uint32_t fValidFlags;
bool fIsSingleComponent;
+ bool fInputIsOnlyModulated;
};
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698