diff options
author | Brian Salomon <bsalomon@google.com> | 2017-02-14 11:33:01 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-02-14 16:34:59 +0000 |
commit | c6b7146eef808dc7b60a1d5f49eb98f947c0bfe3 (patch) | |
tree | e10cc1fffb231ffc75cb62e1e705d695aac831fa /src | |
parent | 9a51498720e234b413e5a3c46d38ab40bda131de (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')
29 files changed, 129 insertions, 115 deletions
diff --git a/src/gpu/GrFragmentProcessor.cpp b/src/gpu/GrFragmentProcessor.cpp index 9ff426fa2f..30b3061144 100644 --- a/src/gpu/GrFragmentProcessor.cpp +++ b/src/gpu/GrFragmentProcessor.cpp @@ -351,7 +351,7 @@ sk_sp<GrFragmentProcessor> GrFragmentProcessor::RunInSeries(sk_sp<GrFragmentProc return series[0]; } // Run the through the series, do the invariant output processing, and look for eliminations. - GrProcOptInfo info(0x0, kNone_GrColorComponentFlags); + GrProcOptInfo info; info.analyzeProcessors(sk_sp_address_as_pointer_address(series), cnt); SkTArray<sk_sp<GrFragmentProcessor>> replacementSeries; GrColor4f knownColor; diff --git a/src/gpu/GrPaint.cpp b/src/gpu/GrPaint.cpp index 26dbf3d2df..d17b9abec0 100644 --- a/src/gpu/GrPaint.cpp +++ b/src/gpu/GrPaint.cpp @@ -76,7 +76,7 @@ void GrPaint::addCoverageTextureProcessor(GrContext* ctx, sk_sp<GrTextureProxy> } bool GrPaint::internalIsConstantBlendedColor(GrColor paintColor, GrColor* color) const { - GrProcOptInfo colorProcInfo(paintColor, kRGBA_GrColorComponentFlags); + GrProcOptInfo colorProcInfo((GrPipelineInput(paintColor))); colorProcInfo.analyzeProcessors( sk_sp_address_as_pointer_address(fColorFragmentProcessors.begin()), this->numColorFragmentProcessors()); diff --git a/src/gpu/GrPipelineInput.h b/src/gpu/GrPipelineInput.h index 43d88d0288..17ec5f6d83 100644 --- a/src/gpu/GrPipelineInput.h +++ b/src/gpu/GrPipelineInput.h @@ -15,33 +15,60 @@ * of a GrPipeline. This is also the GrPrimitiveProcessor color or coverage *output*. */ struct GrPipelineInput { - GrPipelineInput() - : fValidFlags(kNone_GrColorComponentFlags), fColor(0), fIsLCDCoverage(false) {} + enum class Opaque { + kNo, + kYes, + }; - void setKnownFourComponents(GrColor color) { + explicit GrPipelineInput(Opaque opaque = Opaque::kNo) + : fFlags(opaque == Opaque::kYes ? kIsOpaque_Flag : 0) {} + + explicit GrPipelineInput(GrColor color) : fFlags(kColorIsKnown_Flag), fColor(color) {} + + void setToConstant(GrColor color) { fColor = color; - fValidFlags = kRGBA_GrColorComponentFlags; + if (GrColorIsOpaque(color)) { + fFlags = kColorIsKnown_Flag | kIsOpaque_Flag; + } else { + fFlags = kColorIsKnown_Flag; + } } - void setUnknownFourComponents() { fValidFlags = kNone_GrColorComponentFlags; } + void setToUnknown() { fFlags = 0; } + + void setToUnknownOpaque() { fFlags = kIsOpaque_Flag; } - void setUnknownOpaqueFourComponents() { - fColor = 0xffU << GrColor_SHIFT_A; - fValidFlags = kA_GrColorComponentFlag; + void setToSolidCoverage() { + fColor = GrColor_WHITE; + fFlags = kColorIsKnown_Flag | kColorIsKnown_Flag; } - void setKnownSingleComponent(uint8_t alpha) { - fColor = GrColorPackRGBA(alpha, alpha, alpha, alpha); - fValidFlags = kRGBA_GrColorComponentFlags; + void setToScalar(uint8_t alpha) { + this->setToConstant(GrColorPackRGBA(alpha, alpha, alpha, alpha)); } - void setUnknownSingleComponent() { fValidFlags = kNone_GrColorComponentFlags; } + void setToLCDCoverage() { fFlags = kIsLCDCoverage_Flag; } - void setUsingLCDCoverage() { fIsLCDCoverage = true; } + bool isLCDCoverage() const { return SkToBool(kIsLCDCoverage_Flag & fFlags); } + + bool isOpaque() const { return SkToBool(kIsOpaque_Flag & fFlags); } + + bool isConstant(GrColor* color) const { + if (kColorIsKnown_Flag & fFlags) { + *color = fColor; + return true; + } + return false; + } - GrColorComponentFlags fValidFlags; +private: + enum Flags { + kColorIsKnown_Flag = 0x1, + kIsOpaque_Flag = 0x2, + kIsLCDCoverage_Flag = 0x4, + }; + uint32_t fFlags; GrColor fColor; - bool fIsLCDCoverage; }; #endif 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; }; diff --git a/src/gpu/instanced/InstancedRendering.cpp b/src/gpu/instanced/InstancedRendering.cpp index 52a48cb01a..66d454e1bd 100644 --- a/src/gpu/instanced/InstancedRendering.cpp +++ b/src/gpu/instanced/InstancedRendering.cpp @@ -341,14 +341,14 @@ void InstancedRendering::Op::appendParamsTexel(SkScalar x, SkScalar y, SkScalar } void InstancedRendering::Op::getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const { - input->pipelineColorInput()->setKnownFourComponents(this->getSingleInstance().fColor); + input->pipelineColorInput()->setToConstant(this->getSingleInstance().fColor); if (AntialiasMode::kCoverage == fInfo.fAntialiasMode || (AntialiasMode::kNone == fInfo.fAntialiasMode && !fInfo.isSimpleRects() && fInfo.fCannotDiscard)) { - input->pipelineCoverageInput()->setUnknownSingleComponent(); + input->pipelineCoverageInput()->setToUnknown(); } else { - input->pipelineCoverageInput()->setKnownSingleComponent(255); + input->pipelineCoverageInput()->setToSolidCoverage(); } } diff --git a/src/gpu/ops/GrAAConvexPathRenderer.cpp b/src/gpu/ops/GrAAConvexPathRenderer.cpp index 5d0970648a..d13dd6a5a9 100644 --- a/src/gpu/ops/GrAAConvexPathRenderer.cpp +++ b/src/gpu/ops/GrAAConvexPathRenderer.cpp @@ -748,8 +748,8 @@ private: } void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(fColor); - input->pipelineCoverageInput()->setUnknownSingleComponent(); + input->pipelineColorInput()->setToConstant(fColor); + input->pipelineCoverageInput()->setToUnknown(); } void applyPipelineOptimizations(const GrPipelineOptimizations& optimizations) override { diff --git a/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp b/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp index f817f86357..a72f7dc40f 100644 --- a/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp +++ b/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp @@ -169,8 +169,8 @@ private: } void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(fShapes[0].fColor); - input->pipelineCoverageInput()->setUnknownSingleComponent(); + input->pipelineColorInput()->setToConstant(fShapes[0].fColor); + input->pipelineCoverageInput()->setToUnknown(); } void applyPipelineOptimizations(const GrPipelineOptimizations& optimizations) override { diff --git a/src/gpu/ops/GrAAFillRectOp.cpp b/src/gpu/ops/GrAAFillRectOp.cpp index 13aaae44de..2d47ec007f 100644 --- a/src/gpu/ops/GrAAFillRectOp.cpp +++ b/src/gpu/ops/GrAAFillRectOp.cpp @@ -204,8 +204,8 @@ public: private: void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(this->first()->color()); - input->pipelineCoverageInput()->setUnknownSingleComponent(); + input->pipelineColorInput()->setToConstant(this->first()->color()); + input->pipelineCoverageInput()->setToUnknown(); } void onPrepareDraws(Target* target) const override { diff --git a/src/gpu/ops/GrAAHairLinePathRenderer.cpp b/src/gpu/ops/GrAAHairLinePathRenderer.cpp index 09f6c04308..820cf3db5f 100644 --- a/src/gpu/ops/GrAAHairLinePathRenderer.cpp +++ b/src/gpu/ops/GrAAHairLinePathRenderer.cpp @@ -717,8 +717,8 @@ private: } void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(fColor); - input->pipelineCoverageInput()->setUnknownSingleComponent(); + input->pipelineColorInput()->setToConstant(fColor); + input->pipelineCoverageInput()->setToUnknown(); } void applyPipelineOptimizations(const GrPipelineOptimizations& optimizations) override { diff --git a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp index 0cf08d78ad..af193256e0 100644 --- a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp +++ b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp @@ -173,8 +173,8 @@ private: } void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(fPaths[0].fColor); - input->pipelineCoverageInput()->setUnknownSingleComponent(); + input->pipelineColorInput()->setToConstant(fPaths[0].fColor); + input->pipelineCoverageInput()->setToUnknown(); } void applyPipelineOptimizations(const GrPipelineOptimizations& optimizations) override { diff --git a/src/gpu/ops/GrAAStrokeRectOp.cpp b/src/gpu/ops/GrAAStrokeRectOp.cpp index 25f507110d..2b18fe85da 100644 --- a/src/gpu/ops/GrAAStrokeRectOp.cpp +++ b/src/gpu/ops/GrAAStrokeRectOp.cpp @@ -167,8 +167,8 @@ private: AAStrokeRectOp() : INHERITED(ClassID()) {} void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(fRects[0].fColor); - input->pipelineCoverageInput()->setUnknownSingleComponent(); + input->pipelineColorInput()->setToConstant(fRects[0].fColor); + input->pipelineCoverageInput()->setToUnknown(); } void applyPipelineOptimizations(const GrPipelineOptimizations&) override; void onPrepareDraws(Target*) const override; diff --git a/src/gpu/ops/GrAnalyticRectOp.cpp b/src/gpu/ops/GrAnalyticRectOp.cpp index 23a024bb9f..ca19f9a6de 100644 --- a/src/gpu/ops/GrAnalyticRectOp.cpp +++ b/src/gpu/ops/GrAnalyticRectOp.cpp @@ -270,8 +270,8 @@ public: private: void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(fGeoData[0].fColor); - input->pipelineCoverageInput()->setUnknownSingleComponent(); + input->pipelineColorInput()->setToConstant(fGeoData[0].fColor); + input->pipelineCoverageInput()->setToUnknown(); } void applyPipelineOptimizations(const GrPipelineOptimizations& optimizations) override { diff --git a/src/gpu/ops/GrAtlasTextOp.cpp b/src/gpu/ops/GrAtlasTextOp.cpp index dd17ad6736..6b498af0db 100644 --- a/src/gpu/ops/GrAtlasTextOp.cpp +++ b/src/gpu/ops/GrAtlasTextOp.cpp @@ -47,22 +47,21 @@ SkString GrAtlasTextOp::dumpInfo() const { void GrAtlasTextOp::getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const { if (kColorBitmapMask_MaskType == fMaskType) { - input->pipelineColorInput()->setUnknownFourComponents(); + input->pipelineColorInput()->setToUnknown(); } else { - input->pipelineColorInput()->setKnownFourComponents(fColor); + input->pipelineColorInput()->setToConstant(fColor); } switch (fMaskType) { case kGrayscaleDistanceField_MaskType: case kGrayscaleCoverageMask_MaskType: - input->pipelineCoverageInput()->setUnknownSingleComponent(); + input->pipelineCoverageInput()->setToUnknown(); break; case kLCDCoverageMask_MaskType: case kLCDDistanceField_MaskType: - input->pipelineCoverageInput()->setUnknownOpaqueFourComponents(); - input->pipelineCoverageInput()->setUsingLCDCoverage(); + input->pipelineCoverageInput()->setToLCDCoverage(); break; case kColorBitmapMask_MaskType: - input->pipelineCoverageInput()->setKnownSingleComponent(0xff); + input->pipelineCoverageInput()->setToSolidCoverage(); } } diff --git a/src/gpu/ops/GrDashOp.cpp b/src/gpu/ops/GrDashOp.cpp index dbd319abcb..6efdfb7851 100644 --- a/src/gpu/ops/GrDashOp.cpp +++ b/src/gpu/ops/GrDashOp.cpp @@ -297,8 +297,8 @@ private: } void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(fColor); - input->pipelineCoverageInput()->setUnknownSingleComponent(); + input->pipelineColorInput()->setToConstant(fColor); + input->pipelineCoverageInput()->setToUnknown(); } void applyPipelineOptimizations(const GrPipelineOptimizations& optimizations) override { diff --git a/src/gpu/ops/GrDefaultPathRenderer.cpp b/src/gpu/ops/GrDefaultPathRenderer.cpp index b4d381273f..12513bd5b5 100644 --- a/src/gpu/ops/GrDefaultPathRenderer.cpp +++ b/src/gpu/ops/GrDefaultPathRenderer.cpp @@ -133,8 +133,8 @@ private: } void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(fColor); - input->pipelineCoverageInput()->setKnownSingleComponent(this->coverage()); + input->pipelineColorInput()->setToConstant(fColor); + input->pipelineCoverageInput()->setToScalar(this->coverage()); } void applyPipelineOptimizations(const GrPipelineOptimizations& optimizations) override { diff --git a/src/gpu/ops/GrDrawAtlasOp.h b/src/gpu/ops/GrDrawAtlasOp.h index 8184ecb81b..90fe07fda2 100644 --- a/src/gpu/ops/GrDrawAtlasOp.h +++ b/src/gpu/ops/GrDrawAtlasOp.h @@ -41,11 +41,11 @@ private: void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { if (this->hasColors()) { - input->pipelineColorInput()->setUnknownFourComponents(); + input->pipelineColorInput()->setToUnknown(); } else { - input->pipelineColorInput()->setKnownFourComponents(fGeoData[0].fColor); + input->pipelineColorInput()->setToConstant(fGeoData[0].fColor); } - input->pipelineCoverageInput()->setKnownSingleComponent(0xff); + input->pipelineCoverageInput()->setToSolidCoverage(); } void onPrepareDraws(Target*) const override; diff --git a/src/gpu/ops/GrDrawPathOp.h b/src/gpu/ops/GrDrawPathOp.h index e82ff22845..4c213a25b8 100644 --- a/src/gpu/ops/GrDrawPathOp.h +++ b/src/gpu/ops/GrDrawPathOp.h @@ -37,8 +37,8 @@ protected: private: void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(fColor); - input->pipelineCoverageInput()->setKnownSingleComponent(0xFF); + input->pipelineColorInput()->setToConstant(fColor); + input->pipelineCoverageInput()->setToSolidCoverage(); } void applyPipelineOptimizations(const GrPipelineOptimizations& optimizations) override { diff --git a/src/gpu/ops/GrDrawVerticesOp.cpp b/src/gpu/ops/GrDrawVerticesOp.cpp index 4c41bbf410..3eca0c5eeb 100644 --- a/src/gpu/ops/GrDrawVerticesOp.cpp +++ b/src/gpu/ops/GrDrawVerticesOp.cpp @@ -107,11 +107,11 @@ GrDrawVerticesOp::GrDrawVerticesOp(sk_sp<SkVertices> vertices, GrPrimitiveType p void GrDrawVerticesOp::getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const { if (this->requiresPerVertexColors()) { - input->pipelineColorInput()->setUnknownFourComponents(); + input->pipelineColorInput()->setToUnknown(); } else { - input->pipelineColorInput()->setKnownFourComponents(fMeshes[0].fColor); + input->pipelineColorInput()->setToConstant(fMeshes[0].fColor); } - input->pipelineCoverageInput()->setKnownSingleComponent(0xff); + input->pipelineCoverageInput()->setToSolidCoverage(); } void GrDrawVerticesOp::applyPipelineOptimizations(const GrPipelineOptimizations& optimizations) { diff --git a/src/gpu/ops/GrLatticeOp.cpp b/src/gpu/ops/GrLatticeOp.cpp index 319e505745..8e7049cc93 100644 --- a/src/gpu/ops/GrLatticeOp.cpp +++ b/src/gpu/ops/GrLatticeOp.cpp @@ -62,8 +62,8 @@ public: private: void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setUnknownFourComponents(); - input->pipelineCoverageInput()->setKnownSingleComponent(0xff); + input->pipelineColorInput()->setToUnknown(); + input->pipelineCoverageInput()->setToSolidCoverage(); } void applyPipelineOptimizations(const GrPipelineOptimizations& analysioptimizations) override { diff --git a/src/gpu/ops/GrMSAAPathRenderer.cpp b/src/gpu/ops/GrMSAAPathRenderer.cpp index 62dc49be0f..e8fb4987a1 100644 --- a/src/gpu/ops/GrMSAAPathRenderer.cpp +++ b/src/gpu/ops/GrMSAAPathRenderer.cpp @@ -260,8 +260,8 @@ private: } void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(fPaths[0].fColor); - input->pipelineCoverageInput()->setKnownSingleComponent(0xff); + input->pipelineColorInput()->setToConstant(fPaths[0].fColor); + input->pipelineCoverageInput()->setToSolidCoverage(); } void applyPipelineOptimizations(const GrPipelineOptimizations& optimizations) override { diff --git a/src/gpu/ops/GrNonAAFillRectOp.cpp b/src/gpu/ops/GrNonAAFillRectOp.cpp index 5688c9bb11..9fa6342882 100644 --- a/src/gpu/ops/GrNonAAFillRectOp.cpp +++ b/src/gpu/ops/GrNonAAFillRectOp.cpp @@ -111,8 +111,8 @@ private: NonAAFillRectOp() : INHERITED(ClassID()) {} void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(fRects[0].fColor); - input->pipelineCoverageInput()->setKnownSingleComponent(0xff); + input->pipelineColorInput()->setToConstant(fRects[0].fColor); + input->pipelineCoverageInput()->setToSolidCoverage(); } void applyPipelineOptimizations(const GrPipelineOptimizations& optimizations) override { diff --git a/src/gpu/ops/GrNonAAFillRectPerspectiveOp.cpp b/src/gpu/ops/GrNonAAFillRectPerspectiveOp.cpp index cf657f0006..f4d5bcb473 100644 --- a/src/gpu/ops/GrNonAAFillRectPerspectiveOp.cpp +++ b/src/gpu/ops/GrNonAAFillRectPerspectiveOp.cpp @@ -131,8 +131,8 @@ private: NonAAFillRectPerspectiveOp() : INHERITED(ClassID()) {} void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(fRects[0].fColor); - input->pipelineCoverageInput()->setKnownSingleComponent(0xff); + input->pipelineColorInput()->setToConstant(fRects[0].fColor); + input->pipelineCoverageInput()->setToSolidCoverage(); } void applyPipelineOptimizations(const GrPipelineOptimizations& optimizations) override { diff --git a/src/gpu/ops/GrNonAAStrokeRectOp.cpp b/src/gpu/ops/GrNonAAStrokeRectOp.cpp index 53b359e5e0..2743ffc188 100644 --- a/src/gpu/ops/GrNonAAStrokeRectOp.cpp +++ b/src/gpu/ops/GrNonAAStrokeRectOp.cpp @@ -103,8 +103,8 @@ private: NonAAStrokeRectOp() : INHERITED(ClassID()) {} void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(fColor); - input->pipelineCoverageInput()->setKnownSingleComponent(0xFF); + input->pipelineColorInput()->setToConstant(fColor); + input->pipelineCoverageInput()->setToSolidCoverage(); } void onPrepareDraws(Target* target) const override { diff --git a/src/gpu/ops/GrOvalOpFactory.cpp b/src/gpu/ops/GrOvalOpFactory.cpp index a8f0c92792..72991c0801 100644 --- a/src/gpu/ops/GrOvalOpFactory.cpp +++ b/src/gpu/ops/GrOvalOpFactory.cpp @@ -806,8 +806,8 @@ private: CircleOp() : INHERITED(ClassID()) {} void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(fGeoData[0].fColor); - input->pipelineCoverageInput()->setUnknownSingleComponent(); + input->pipelineColorInput()->setToConstant(fGeoData[0].fColor); + input->pipelineCoverageInput()->setToUnknown(); } void applyPipelineOptimizations(const GrPipelineOptimizations& optimizations) override { @@ -1257,8 +1257,8 @@ private: EllipseOp() : INHERITED(ClassID()) {} void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(fGeoData[0].fColor); - input->pipelineCoverageInput()->setUnknownSingleComponent(); + input->pipelineColorInput()->setToConstant(fGeoData[0].fColor); + input->pipelineCoverageInput()->setToUnknown(); } void applyPipelineOptimizations(const GrPipelineOptimizations& optimizations) override { @@ -1471,8 +1471,8 @@ private: DIEllipseOp() : INHERITED(ClassID()) {} void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(fGeoData[0].fColor); - input->pipelineCoverageInput()->setUnknownSingleComponent(); + input->pipelineColorInput()->setToConstant(fGeoData[0].fColor); + input->pipelineCoverageInput()->setToUnknown(); } void applyPipelineOptimizations(const GrPipelineOptimizations& optimizations) override { @@ -1786,8 +1786,8 @@ public: private: void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(fGeoData[0].fColor); - input->pipelineCoverageInput()->setUnknownSingleComponent(); + input->pipelineColorInput()->setToConstant(fGeoData[0].fColor); + input->pipelineCoverageInput()->setToUnknown(); } void applyPipelineOptimizations(const GrPipelineOptimizations& optimizations) override { @@ -2148,8 +2148,8 @@ private: EllipticalRRectOp() : INHERITED(ClassID()) {} void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(fGeoData[0].fColor); - input->pipelineCoverageInput()->setUnknownSingleComponent(); + input->pipelineColorInput()->setToConstant(fGeoData[0].fColor); + input->pipelineCoverageInput()->setToUnknown(); } void applyPipelineOptimizations(const GrPipelineOptimizations& optimizations) override { diff --git a/src/gpu/ops/GrPLSPathRenderer.cpp b/src/gpu/ops/GrPLSPathRenderer.cpp index 3df31fb28d..e6022d306d 100644 --- a/src/gpu/ops/GrPLSPathRenderer.cpp +++ b/src/gpu/ops/GrPLSPathRenderer.cpp @@ -782,8 +782,8 @@ private: } void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(fColor); - input->pipelineCoverageInput()->setUnknownSingleComponent(); + input->pipelineColorInput()->setToConstant(fColor); + input->pipelineCoverageInput()->setToUnknown(); input->setUsesPLSDstRead(); } diff --git a/src/gpu/ops/GrRegionOp.cpp b/src/gpu/ops/GrRegionOp.cpp index fae79d04fd..c5d56338d8 100644 --- a/src/gpu/ops/GrRegionOp.cpp +++ b/src/gpu/ops/GrRegionOp.cpp @@ -78,8 +78,8 @@ public: private: void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(fRegions[0].fColor); - input->pipelineCoverageInput()->setKnownSingleComponent(0xff); + input->pipelineColorInput()->setToConstant(fRegions[0].fColor); + input->pipelineCoverageInput()->setToSolidCoverage(); } void applyPipelineOptimizations(const GrPipelineOptimizations& optimizations) override { diff --git a/src/gpu/ops/GrShadowRRectOp.cpp b/src/gpu/ops/GrShadowRRectOp.cpp index e0eadd85c7..0431622484 100644 --- a/src/gpu/ops/GrShadowRRectOp.cpp +++ b/src/gpu/ops/GrShadowRRectOp.cpp @@ -150,8 +150,8 @@ private: ShadowCircleOp() : INHERITED(ClassID()) {} void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(fCircles[0].fColor); - input->pipelineCoverageInput()->setUnknownSingleComponent(); + input->pipelineColorInput()->setToConstant(fCircles[0].fColor); + input->pipelineCoverageInput()->setToUnknown(); } void applyPipelineOptimizations(const GrPipelineOptimizations& optimizations) override { @@ -584,8 +584,8 @@ public: private: void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(fGeoData[0].fColor); - input->pipelineCoverageInput()->setUnknownSingleComponent(); + input->pipelineColorInput()->setToConstant(fGeoData[0].fColor); + input->pipelineCoverageInput()->setToUnknown(); } void applyPipelineOptimizations(const GrPipelineOptimizations& optimizations) override { diff --git a/src/gpu/ops/GrTessellatingPathRenderer.cpp b/src/gpu/ops/GrTessellatingPathRenderer.cpp index dd0d3a0fd5..6ebffcae1b 100644 --- a/src/gpu/ops/GrTessellatingPathRenderer.cpp +++ b/src/gpu/ops/GrTessellatingPathRenderer.cpp @@ -181,8 +181,8 @@ public: private: void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(fColor); - input->pipelineCoverageInput()->setUnknownSingleComponent(); + input->pipelineColorInput()->setToConstant(fColor); + input->pipelineCoverageInput()->setToUnknown(); } void applyPipelineOptimizations(const GrPipelineOptimizations& optimizations) override { diff --git a/src/gpu/ops/GrTestMeshDrawOp.h b/src/gpu/ops/GrTestMeshDrawOp.h index b8143a5aa7..99eee3938c 100644 --- a/src/gpu/ops/GrTestMeshDrawOp.h +++ b/src/gpu/ops/GrTestMeshDrawOp.h @@ -34,8 +34,8 @@ protected: private: void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override { - input->pipelineColorInput()->setKnownFourComponents(fColor); - input->pipelineCoverageInput()->setUnknownSingleComponent(); + input->pipelineColorInput()->setToConstant(fColor); + input->pipelineCoverageInput()->setToUnknown(); } void applyPipelineOptimizations(const GrPipelineOptimizations& optimizations) override { |