aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrProcOptInfo.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-02-14 11:33:01 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-14 16:34:59 +0000
commitc6b7146eef808dc7b60a1d5f49eb98f947c0bfe3 (patch)
treee10cc1fffb231ffc75cb62e1e705d695aac831fa /src/gpu/GrProcOptInfo.h
parent9a51498720e234b413e5a3c46d38ab40bda131de (diff)
Remove component flags from GrPipelineInput.
We don't use these anywhere downstream except to check for opaqueness. Change-Id: I897137135d69004ed45c0f4c1e7297183f49fc6d Reviewed-on: https://skia-review.googlesource.com/8402 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/GrProcOptInfo.h')
-rw-r--r--src/gpu/GrProcOptInfo.h50
1 files changed, 19 insertions, 31 deletions
diff --git a/src/gpu/GrProcOptInfo.h b/src/gpu/GrProcOptInfo.h
index 89b4d2ca6c..2c55233f9a 100644
--- a/src/gpu/GrProcOptInfo.h
+++ b/src/gpu/GrProcOptInfo.h
@@ -22,23 +22,24 @@ class GrPrimitiveProcessor;
*/
class GrProcOptInfo {
public:
- GrProcOptInfo() { this->reset(0, kNone_GrColorComponentFlags); }
+ GrProcOptInfo() = default;
- GrProcOptInfo(GrColor color, GrColorComponentFlags colorFlags) {
- this->reset(color, colorFlags);
- }
-
- void resetToLCDCoverage(GrColor color, GrColorComponentFlags colorFlags) {
- this->internalReset(color, colorFlags, true);
+ GrProcOptInfo(const GrPipelineInput& input) : GrProcOptInfo() {
+ fIsLCDCoverage = input.isLCDCoverage();
+ fIsOpaque = input.isOpaque();
+ GrColor color;
+ if (input.isConstant(&color)) {
+ fLastKnownOutputColor = GrColor4f::FromGrColor(color);
+ fProcessorsVisitedWithKnownOutput = 0;
+ }
}
- void reset(GrColor color, GrColorComponentFlags colorFlags) {
- this->internalReset(color, colorFlags, false);
+ void resetToLCDCoverage() {
+ *this = GrProcOptInfo();
+ fIsLCDCoverage = true;
}
- void reset(const GrPipelineInput& input) {
- this->internalReset(input.fColor, input.fValidFlags, input.fIsLCDCoverage);
- }
+ void reset(const GrPipelineInput& input) { *this = GrProcOptInfo(input); }
/**
* Runs through a series of processors and updates calculated values. This can be called
@@ -85,25 +86,12 @@ public:
}
private:
- void internalReset(GrColor color, GrColorComponentFlags colorFlags, bool isLCDCoverage) {
- fTotalProcessorsVisited = 0;
- fIsLCDCoverage = isLCDCoverage;
- fIsOpaque = (kA_GrColorComponentFlag & colorFlags) && GrColorIsOpaque(color);
- fAllProcessorsModulatePremul = true;
- if (kRGBA_GrColorComponentFlags == colorFlags) {
- fProcessorsVisitedWithKnownOutput = 0;
- fLastKnownOutputColor = GrColor4f::FromGrColor(color);
- } else {
- // -1 so that we know that even without adding processors that the color is not known.
- fProcessorsVisitedWithKnownOutput = -1;
- }
- }
-
- int fTotalProcessorsVisited;
- int fProcessorsVisitedWithKnownOutput;
- bool fIsLCDCoverage;
- bool fIsOpaque;
- bool fAllProcessorsModulatePremul;
+ int fTotalProcessorsVisited = 0;
+ // negative one means even the color is unknown before adding the first processor.
+ int fProcessorsVisitedWithKnownOutput = -1;
+ bool fIsLCDCoverage = false;
+ bool fIsOpaque = false;
+ bool fAllProcessorsModulatePremul = true;
GrColor4f fLastKnownOutputColor;
};