aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@google.com>2014-12-10 14:12:22 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-12-10 14:12:22 -0800
commit8c0f615fdd41b8b8048bf398791bb2138c511826 (patch)
tree99c1df79b95ce740b028382680a9af5359663219 /include/gpu
parentc6bc58eded89b0c0a36b8e20e193c200f297a0da (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')
-rw-r--r--include/gpu/GrFragmentProcessor.h15
-rw-r--r--include/gpu/GrInvariantOutput.h70
-rw-r--r--include/gpu/GrProcessor.h15
-rw-r--r--include/gpu/GrXferProcessor.h5
4 files changed, 20 insertions, 85 deletions
diff --git a/include/gpu/GrFragmentProcessor.h b/include/gpu/GrFragmentProcessor.h
index 0c155996d5..3f308d7e75 100644
--- a/include/gpu/GrFragmentProcessor.h
+++ b/include/gpu/GrFragmentProcessor.h
@@ -67,16 +67,6 @@ public:
return this->onIsEqual(that);
}
- /**
- * This function is used to perform optimizations. When called the invarientOuput param
- * indicate whether the input components to this processor 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(GrInvariantOutput* inout) const;
-
protected:
/**
* Fragment Processor subclasses call this from their constructor to register coordinate
@@ -111,11 +101,6 @@ protected:
*/
void setWillNotUseInputColor() { fWillUseInputColor = false; }
- /**
- * Subclass implements this to support getConstantColorComponents(...).
- */
- virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const = 0;
-
private:
/**
* Subclass implements this to support isEqual(). It will only be called if it is known that
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;
diff --git a/include/gpu/GrProcessor.h b/include/gpu/GrProcessor.h
index 8a8d685e51..6a497e7514 100644
--- a/include/gpu/GrProcessor.h
+++ b/include/gpu/GrProcessor.h
@@ -61,6 +61,16 @@ public:
virtual ~GrProcessor();
+ /**
+ * This function is used to perform optimizations. When called the invarientOuput param
+ * indicate whether the input components to this processor 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(GrInvariantOutput* inout) const;
+
/** Human-meaningful string to identify this prcoessor; may be embedded
in generated shader code. */
virtual const char* name() const = 0;
@@ -122,6 +132,11 @@ protected:
uint32_t fClassID;
private:
+ /**
+ * Subclass implements this to support getConstantColorComponents(...).
+ */
+ virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const = 0;
+
static uint32_t GenClassID() {
// fCurrProcessorClassID has been initialized to kIllegalProcessorClassID. The
// atomic inc returns the old value not the incremented value. So we add
diff --git a/include/gpu/GrXferProcessor.h b/include/gpu/GrXferProcessor.h
index db0d6e8656..696359b8b3 100644
--- a/include/gpu/GrXferProcessor.h
+++ b/include/gpu/GrXferProcessor.h
@@ -134,11 +134,6 @@ protected:
*/
void setWillReadDstColor() { fWillReadDstColor = true; }
- /**
- * Subclass implements this to support getConstantColorComponents(...).
- */
- virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const = 0;
-
private:
virtual bool onIsEqual(const GrXferProcessor&) const = 0;