diff options
author | bsalomon <bsalomon@google.com> | 2015-07-08 10:20:21 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-08 10:20:21 -0700 |
commit | d07a2793baea42956d27b3ad47ed562f08e4570a (patch) | |
tree | 43f0a8ac998e1fc05b7063e65c3f69317f209e68 | |
parent | 60c047557559e5410063452e59d65377e813e5f2 (diff) |
Revert of Rework GrPipelineInfo (patchset #7 id:120001 of https://codereview.chromium.org/1213383005/)
Reason for revert:
breaking stuff!
Original issue's description:
> Makes GrPipelineInfo a class with query functions used by GrBatch subclasses.
>
> Committed: https://skia.googlesource.com/skia/+/f5179a4c490bc787190321bd8ffdb0e6a4efa9ac
TBR=joshualitt@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/1213013003
26 files changed, 189 insertions, 238 deletions
diff --git a/include/gpu/GrXferProcessor.h b/include/gpu/GrXferProcessor.h index 41f8abb740..332d9d2e23 100644 --- a/include/gpu/GrXferProcessor.h +++ b/include/gpu/GrXferProcessor.h @@ -104,6 +104,10 @@ public: */ enum OptFlags { /** + * No optimizations needed + */ + kNone_Opt = 0, + /** * The draw can be skipped completely. */ kSkipDraw_OptFlag = 0x1, @@ -125,8 +129,6 @@ public: kCanTweakAlphaForCoverage_OptFlag = 0x20, }; - static const OptFlags kNone_OptFlags = (OptFlags)0; - GR_DECL_BITFIELD_OPS_FRIENDS(OptFlags); /** diff --git a/src/effects/SkArithmeticMode_gpu.cpp b/src/effects/SkArithmeticMode_gpu.cpp index 302e8b6405..e537c4185e 100644 --- a/src/effects/SkArithmeticMode_gpu.cpp +++ b/src/effects/SkArithmeticMode_gpu.cpp @@ -271,7 +271,7 @@ GrXferProcessor::OptFlags ArithmeticXP::onGetOptimizations(const GrProcOptInfo& bool doesStencilWrite, GrColor* overrideColor, const GrCaps& caps) { - return GrXferProcessor::kNone_OptFlags; + return GrXferProcessor::kNone_Opt; } /////////////////////////////////////////////////////////////////////////////// diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp index 58a393140a..52994758c0 100644 --- a/src/gpu/GrAAConvexPathRenderer.cpp +++ b/src/gpu/GrAAConvexPathRenderer.cpp @@ -761,18 +761,19 @@ public: void initBatchTracker(const GrPipelineInfo& init) override { // Handle any color overrides - if (!init.readsColor()) { + if (init.fColorIgnored) { fGeoData[0].fColor = GrColor_ILLEGAL; + } else if (GrColor_ILLEGAL != init.fOverrideColor) { + fGeoData[0].fColor = init.fOverrideColor; } - init.getOverrideColorIfSet(&fGeoData[0].fColor); // setup batch properties - fBatch.fColorIgnored = !init.readsColor(); + fBatch.fColorIgnored = init.fColorIgnored; fBatch.fColor = fGeoData[0].fColor; - fBatch.fUsesLocalCoords = init.readsLocalCoords(); - fBatch.fCoverageIgnored = !init.readsCoverage(); + fBatch.fUsesLocalCoords = init.fUsesLocalCoords; + fBatch.fCoverageIgnored = init.fCoverageIgnored; fBatch.fLinesOnly = SkPath::kLine_SegmentMask == fGeoData[0].fPath.getSegmentMasks(); - fBatch.fCanTweakAlphaForCoverage = init.canTweakAlphaForCoverage(); + fBatch.fCanTweakAlphaForCoverage = init.fCanTweakAlphaForCoverage; } void generateGeometryLinesOnly(GrBatchTarget* batchTarget, const GrPipeline* pipeline) { diff --git a/src/gpu/GrAADistanceFieldPathRenderer.cpp b/src/gpu/GrAADistanceFieldPathRenderer.cpp index c11c641f57..3c7648aae3 100755 --- a/src/gpu/GrAADistanceFieldPathRenderer.cpp +++ b/src/gpu/GrAADistanceFieldPathRenderer.cpp @@ -157,15 +157,16 @@ public: void initBatchTracker(const GrPipelineInfo& init) override { // Handle any color overrides - if (!init.readsColor()) { + if (init.fColorIgnored) { fBatch.fColor = GrColor_ILLEGAL; + } else if (GrColor_ILLEGAL != init.fOverrideColor) { + fBatch.fColor = init.fOverrideColor; } - init.getOverrideColorIfSet(&fBatch.fColor); // setup batch properties - fBatch.fColorIgnored = !init.readsColor(); - fBatch.fUsesLocalCoords = init.readsLocalCoords(); - fBatch.fCoverageIgnored = !init.readsCoverage(); + fBatch.fColorIgnored = init.fColorIgnored; + fBatch.fUsesLocalCoords = init.fUsesLocalCoords; + fBatch.fCoverageIgnored = init.fCoverageIgnored; } struct FlushInfo { diff --git a/src/gpu/GrAAHairLinePathRenderer.cpp b/src/gpu/GrAAHairLinePathRenderer.cpp index 14770b8531..da60a6cabd 100644 --- a/src/gpu/GrAAHairLinePathRenderer.cpp +++ b/src/gpu/GrAAHairLinePathRenderer.cpp @@ -700,16 +700,17 @@ public: void initBatchTracker(const GrPipelineInfo& init) override { // Handle any color overrides - if (!init.readsColor()) { + if (init.fColorIgnored) { fGeoData[0].fColor = GrColor_ILLEGAL; + } else if (GrColor_ILLEGAL != init.fOverrideColor) { + fGeoData[0].fColor = init.fOverrideColor; } - init.getOverrideColorIfSet(&fGeoData[0].fColor); // setup batch properties - fBatch.fColorIgnored = !init.readsColor(); + fBatch.fColorIgnored = init.fColorIgnored; fBatch.fColor = fGeoData[0].fColor; - fBatch.fUsesLocalCoords = init.readsLocalCoords(); - fBatch.fCoverageIgnored = !init.readsCoverage(); + fBatch.fUsesLocalCoords = init.fUsesLocalCoords; + fBatch.fCoverageIgnored = init.fCoverageIgnored; fBatch.fCoverage = fGeoData[0].fCoverage; } diff --git a/src/gpu/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/GrAALinearizingConvexPathRenderer.cpp index f9174cedeb..786378ba84 100644 --- a/src/gpu/GrAALinearizingConvexPathRenderer.cpp +++ b/src/gpu/GrAALinearizingConvexPathRenderer.cpp @@ -136,18 +136,19 @@ public: void initBatchTracker(const GrPipelineInfo& init) override { // Handle any color overrides - if (!init.readsColor()) { + if (init.fColorIgnored) { fGeoData[0].fColor = GrColor_ILLEGAL; + } else if (GrColor_ILLEGAL != init.fOverrideColor) { + fGeoData[0].fColor = init.fOverrideColor; } - init.getOverrideColorIfSet(&fGeoData[0].fColor); // setup batch properties - fBatch.fColorIgnored = !init.readsColor(); + fBatch.fColorIgnored = init.fColorIgnored; fBatch.fColor = fGeoData[0].fColor; - fBatch.fUsesLocalCoords = init.readsLocalCoords(); - fBatch.fCoverageIgnored = !init.readsCoverage(); + fBatch.fUsesLocalCoords = init.fUsesLocalCoords; + fBatch.fCoverageIgnored = init.fCoverageIgnored; fBatch.fLinesOnly = SkPath::kLine_SegmentMask == fGeoData[0].fPath.getSegmentMasks(); - fBatch.fCanTweakAlphaForCoverage = init.canTweakAlphaForCoverage(); + fBatch.fCanTweakAlphaForCoverage = init.fCanTweakAlphaForCoverage; } void draw(GrBatchTarget* batchTarget, const GrPipeline* pipeline, int vertexCount, diff --git a/src/gpu/GrAARectRenderer.cpp b/src/gpu/GrAARectRenderer.cpp index b0a0e51a68..1c5b6d8616 100644 --- a/src/gpu/GrAARectRenderer.cpp +++ b/src/gpu/GrAARectRenderer.cpp @@ -76,16 +76,18 @@ public: void initBatchTracker(const GrPipelineInfo& init) override { // Handle any color overrides - if (!init.readsColor()) { - fBatch.fColor = GrColor_ILLEGAL; + if (init.fColorIgnored) { + fGeoData[0].fColor = GrColor_ILLEGAL; + } else if (GrColor_ILLEGAL != init.fOverrideColor) { + fGeoData[0].fColor = init.fOverrideColor; } - init.getOverrideColorIfSet(&fBatch.fColor); // setup batch properties - fBatch.fColorIgnored = !init.readsColor(); - fBatch.fUsesLocalCoords = init.readsLocalCoords(); - fBatch.fCoverageIgnored = !init.readsCoverage(); - fBatch.fCanTweakAlphaForCoverage = init.canTweakAlphaForCoverage(); + fBatch.fColorIgnored = init.fColorIgnored; + fBatch.fColor = fGeoData[0].fColor; + fBatch.fUsesLocalCoords = init.fUsesLocalCoords; + fBatch.fCoverageIgnored = init.fCoverageIgnored; + fBatch.fCanTweakAlphaForCoverage = init.fCanTweakAlphaForCoverage; } void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline) override { @@ -422,18 +424,19 @@ public: void initBatchTracker(const GrPipelineInfo& init) override { // Handle any color overrides - if (!init.readsColor()) { + if (init.fColorIgnored) { fGeoData[0].fColor = GrColor_ILLEGAL; + } else if (GrColor_ILLEGAL != init.fOverrideColor) { + fGeoData[0].fColor = init.fOverrideColor; } - init.getOverrideColorIfSet(&fGeoData[0].fColor); // setup batch properties - fBatch.fColorIgnored = !init.readsColor(); + fBatch.fColorIgnored = init.fColorIgnored; fBatch.fColor = fGeoData[0].fColor; - fBatch.fUsesLocalCoords = init.readsLocalCoords(); - fBatch.fCoverageIgnored = !init.readsCoverage(); + fBatch.fUsesLocalCoords = init.fUsesLocalCoords; + fBatch.fCoverageIgnored = init.fCoverageIgnored; fBatch.fMiterStroke = fGeoData[0].fMiterStroke; - fBatch.fCanTweakAlphaForCoverage = init.canTweakAlphaForCoverage(); + fBatch.fCanTweakAlphaForCoverage = init.fCanTweakAlphaForCoverage; } void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline) override { diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp index e0d452997b..c25ddd25e2 100644 --- a/src/gpu/GrAtlasTextContext.cpp +++ b/src/gpu/GrAtlasTextContext.cpp @@ -1498,15 +1498,16 @@ public: void initBatchTracker(const GrPipelineInfo& init) override { // Handle any color overrides - if (!init.readsColor()) { + if (init.fColorIgnored) { fBatch.fColor = GrColor_ILLEGAL; + } else if (GrColor_ILLEGAL != init.fOverrideColor) { + fBatch.fColor = init.fOverrideColor; } - init.getOverrideColorIfSet(&fBatch.fColor); // setup batch properties - fBatch.fColorIgnored = !init.readsColor(); - fBatch.fUsesLocalCoords = init.readsLocalCoords(); - fBatch.fCoverageIgnored = !init.readsCoverage(); + fBatch.fColorIgnored = init.fColorIgnored; + fBatch.fUsesLocalCoords = init.fUsesLocalCoords; + fBatch.fCoverageIgnored = init.fCoverageIgnored; } struct FlushInfo { diff --git a/src/gpu/GrDefaultGeoProcFactory.cpp b/src/gpu/GrDefaultGeoProcFactory.cpp index 39efd248ea..a72c88052c 100644 --- a/src/gpu/GrDefaultGeoProcFactory.cpp +++ b/src/gpu/GrDefaultGeoProcFactory.cpp @@ -24,16 +24,16 @@ public: GrColor color, const SkMatrix& viewMatrix, const SkMatrix& localMatrix, - bool localCoordsWillBeRead, - bool coverageWillBeIgnored, + bool usesLocalCoords, + bool coverageIgnored, uint8_t coverage) { return SkNEW_ARGS(DefaultGeoProc, (gpTypeFlags, color, viewMatrix, localMatrix, coverage, - localCoordsWillBeRead, - coverageWillBeIgnored)); + usesLocalCoords, + coverageIgnored)); } const char* name() const override { return "DefaultGeometryProcessor"; } @@ -47,9 +47,9 @@ public: bool hasVertexColor() const { return SkToBool(fInColor); } const SkMatrix& viewMatrix() const { return fViewMatrix; } const SkMatrix& localMatrix() const { return fLocalMatrix; } - bool localCoordsWillBeRead() const { return fLocalCoordsWillBeRead; } + bool usesLocalCoords() const { return fUsesLocalCoords; } uint8_t coverage() const { return fCoverage; } - bool coverageWillBeIgnored() const { return fCoverageWillBeIgnored; } + bool coverageIgnored() const { return fCoverageIgnored; } bool hasVertexCoverage() const { return SkToBool(fInCoverage); } class GLProcessor : public GrGLGeometryProcessor { @@ -90,7 +90,7 @@ public: } // Setup coverage as pass through - if (!gp.coverageWillBeIgnored()) { + if (!gp.coverageIgnored()) { if (gp.hasVertexCoverage()) { fs->codeAppendf("float alpha = 1.0;"); args.fPB->addPassThroughAttribute(gp.inCoverage(), "alpha"); @@ -116,12 +116,11 @@ public: const DefaultGeoProc& def = gp.cast<DefaultGeoProc>(); uint32_t key = def.fFlags; key |= def.colorIgnored() << 8; - key |= def.coverageWillBeIgnored() << 9; + key |= def.coverageIgnored() << 9; key |= def.hasVertexColor() << 10; key |= def.hasVertexCoverage() << 11; key |= def.coverage() == 0xff ? 0x1 << 12 : 0; - key |= def.localCoordsWillBeRead() && def.localMatrix().hasPerspective() ? 0x1 << 24 : - 0x0; + key |= def.usesLocalCoords() && def.localMatrix().hasPerspective() ? 0x1 << 24 : 0x0; key |= ComputePosKey(def.viewMatrix()) << 25; b->add32(key); } @@ -145,8 +144,7 @@ public: fColor = dgp.color(); } - if (!dgp.coverageWillBeIgnored() && - dgp.coverage() != fCoverage && !dgp.hasVertexCoverage()) { + if (!dgp.coverageIgnored() && dgp.coverage() != fCoverage && !dgp.hasVertexCoverage()) { pdman.set1f(fCoverageUniform, GrNormalizeByteToFloat(dgp.coverage())); fCoverage = dgp.coverage(); } @@ -187,8 +185,8 @@ private: const SkMatrix& viewMatrix, const SkMatrix& localMatrix, uint8_t coverage, - bool localCoordsWillBeRead, - bool coverageWillBeIgnored) + bool usesLocalCoords, + bool coverageIgnored) : fInPosition(NULL) , fInColor(NULL) , fInLocalCoords(NULL) @@ -198,8 +196,8 @@ private: , fLocalMatrix(localMatrix) , fCoverage(coverage) , fFlags(gpTypeFlags) - , fLocalCoordsWillBeRead(localCoordsWillBeRead) - , fCoverageWillBeIgnored(coverageWillBeIgnored) { + , fUsesLocalCoords(usesLocalCoords) + , fCoverageIgnored(coverageIgnored) { this->initClassID<DefaultGeoProc>(); bool hasColor = SkToBool(gpTypeFlags & GrDefaultGeoProcFactory::kColor_GPType); bool hasLocalCoord = SkToBool(gpTypeFlags & GrDefaultGeoProcFactory::kLocalCoord_GPType); @@ -216,7 +214,7 @@ private: } if (hasCoverage) { fInCoverage = &this->addVertexAttrib(Attribute("inCoverage", - kFloat_GrVertexAttribType)); + kFloat_GrVertexAttribType)); } } @@ -229,8 +227,8 @@ private: SkMatrix fLocalMatrix; uint8_t fCoverage; uint32_t fFlags; - bool fLocalCoordsWillBeRead; - bool fCoverageWillBeIgnored; + bool fUsesLocalCoords; + bool fCoverageIgnored; GR_DECLARE_GEOMETRY_PROCESSOR_TEST; @@ -265,8 +263,8 @@ GrGeometryProcessor* DefaultGeoProc::TestCreate(SkRandom* random, const GrGeometryProcessor* GrDefaultGeoProcFactory::Create(uint32_t gpTypeFlags, GrColor color, - bool localCoordsWillBeRead, - bool coverageWillBeIgnored, + bool usesLocalCoords, + bool coverageIgnored, const SkMatrix& viewMatrix, const SkMatrix& localMatrix, uint8_t coverage) { @@ -274,7 +272,7 @@ const GrGeometryProcessor* GrDefaultGeoProcFactory::Create(uint32_t gpTypeFlags, color, viewMatrix, localMatrix, - localCoordsWillBeRead, - coverageWillBeIgnored, + usesLocalCoords, + coverageIgnored, coverage); } diff --git a/src/gpu/GrDefaultGeoProcFactory.h b/src/gpu/GrDefaultGeoProcFactory.h index 00fd0bce6b..3722a320ce 100644 --- a/src/gpu/GrDefaultGeoProcFactory.h +++ b/src/gpu/GrDefaultGeoProcFactory.h @@ -74,17 +74,17 @@ public: }; /* - * The following functions are used to create default GPs. If you just need to create - * attributes separately from creating the default GP, use the SetAttribs function followed - * by the Create function. Otherwise use CreateAndSetAttribs to do both at once. + * The following functions are used to create default GPs. If you just need to create + * attributes seperately from creating the default GP, use the SetAttribs function followed + * by the Create function. Otherwise use CreateAndSetAttribs to do both at once. * * You must unref the return from Create. */ // TODO clean this up static const GrGeometryProcessor* Create(uint32_t gpTypeFlags, GrColor, - bool localCoordsWillBeRead, - bool coverageWillBeIgnored, + bool usesLocalCoords, + bool coverageIgnored, const SkMatrix& viewMatrix = SkMatrix::I(), const SkMatrix& localMatrix = SkMatrix::I(), uint8_t coverage = 0xff); diff --git a/src/gpu/GrDefaultPathRenderer.cpp b/src/gpu/GrDefaultPathRenderer.cpp index 2431696d06..f039cee198 100644 --- a/src/gpu/GrDefaultPathRenderer.cpp +++ b/src/gpu/GrDefaultPathRenderer.cpp @@ -237,16 +237,17 @@ public: void initBatchTracker(const GrPipelineInfo& init) override { // Handle any color overrides - if (!init.readsColor()) { + if (init.fColorIgnored) { fGeoData[0].fColor = GrColor_ILLEGAL; + } else if (GrColor_ILLEGAL != init.fOverrideColor) { + fGeoData[0].fColor = init.fOverrideColor; } - init.getOverrideColorIfSet(&fGeoData[0].fColor); // setup batch properties - fBatch.fColorIgnored = !init.readsColor(); + fBatch.fColorIgnored = init.fColorIgnored; fBatch.fColor = fGeoData[0].fColor; - fBatch.fUsesLocalCoords = init.readsLocalCoords(); - fBatch.fCoverageIgnored = !init.readsCoverage(); + fBatch.fUsesLocalCoords = init.fUsesLocalCoords; + fBatch.fCoverageIgnored = init.fCoverageIgnored; } void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline) override { diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp index b957b9124e..f7d7e7bb09 100644 --- a/src/gpu/GrDrawContext.cpp +++ b/src/gpu/GrDrawContext.cpp @@ -275,16 +275,17 @@ public: void initBatchTracker(const GrPipelineInfo& init) override { // Handle any color overrides - if (!init.readsColor()) { + if (init.fColorIgnored) { fGeoData[0].fColor = GrColor_ILLEGAL; + } else if (GrColor_ILLEGAL != init.fOverrideColor) { + fGeoData[0].fColor = init.fOverrideColor; } - init.getOverrideColorIfSet(&fGeoData[0].fColor); // setup batch properties - fBatch.fColorIgnored = !init.readsColor(); + fBatch.fColorIgnored = init.fColorIgnored; fBatch.fColor = fGeoData[0].fColor; - fBatch.fUsesLocalCoords = init.readsLocalCoords(); - fBatch.fCoverageIgnored = !init.readsCoverage(); + fBatch.fUsesLocalCoords = init.fUsesLocalCoords; + fBatch.fCoverageIgnored = init.fCoverageIgnored; } void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline) override { @@ -613,16 +614,17 @@ public: void initBatchTracker(const GrPipelineInfo& init) override { // Handle any color overrides - if (!init.readsColor()) { + if (init.fColorIgnored) { fGeoData[0].fColor = GrColor_ILLEGAL; + } else if (GrColor_ILLEGAL != init.fOverrideColor) { + fGeoData[0].fColor = init.fOverrideColor; } - init.getOverrideColorIfSet(&fGeoData[0].fColor); // setup batch properties - fBatch.fColorIgnored = !init.readsColor(); + fBatch.fColorIgnored = init.fColorIgnored; fBatch.fColor = fGeoData[0].fColor; - fBatch.fUsesLocalCoords = init.readsLocalCoords(); - fBatch.fCoverageIgnored = !init.readsCoverage(); + fBatch.fUsesLocalCoords = init.fUsesLocalCoords; + fBatch.fCoverageIgnored = init.fCoverageIgnored; } void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline) override { diff --git a/src/gpu/GrImmediateDrawTarget.cpp b/src/gpu/GrImmediateDrawTarget.cpp index 2b72bae9b8..59a105a73e 100644 --- a/src/gpu/GrImmediateDrawTarget.cpp +++ b/src/gpu/GrImmediateDrawTarget.cpp @@ -33,7 +33,7 @@ void GrImmediateDrawTarget::onDrawBatch(GrBatch* batch, return; } - batch->initBatchTracker(pipeline->infoForPrimitiveProcessor()); + batch->initBatchTracker(pipeline->getInitBatchTracker()); fBatchTarget.resetNumberOfDraws(); diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp index 0b4dab1c2c..2a2b5b6912 100644 --- a/src/gpu/GrInOrderDrawBuffer.cpp +++ b/src/gpu/GrInOrderDrawBuffer.cpp @@ -157,8 +157,8 @@ GrInOrderDrawBuffer::setupPipelineAndShouldDraw(const GrPrimitiveProcessor* prim return NULL; } - state->fPrimitiveProcessor->initBatchTracker( - &state->fBatchTracker, state->getPipeline()->infoForPrimitiveProcessor()); + state->fPrimitiveProcessor->initBatchTracker(&state->fBatchTracker, + state->getPipeline()->getInitBatchTracker()); if (fPrevState && fPrevState->fPrimitiveProcessor.get() && fPrevState->fPrimitiveProcessor->canMakeEqual(fPrevState->fBatchTracker, @@ -186,7 +186,7 @@ GrInOrderDrawBuffer::setupPipelineAndShouldDraw(GrBatch* batch, return NULL; } - batch->initBatchTracker(state->getPipeline()->infoForPrimitiveProcessor()); + batch->initBatchTracker(state->getPipeline()->getInitBatchTracker()); if (fPrevState && !fPrevState->fPrimitiveProcessor.get() && fPrevState->getPipeline()->isEqual(*state->getPipeline())) { diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp index 57e53b69d6..a429caba11 100644 --- a/src/gpu/GrOvalRenderer.cpp +++ b/src/gpu/GrOvalRenderer.cpp @@ -661,17 +661,18 @@ public: void initBatchTracker(const GrPipelineInfo& init) override { // Handle any color overrides - if (!init.readsColor()) { + if (init.fColorIgnored) { fGeoData[0].fColor = GrColor_ILLEGAL; + } else if (GrColor_ILLEGAL != init.fOverrideColor) { + fGeoData[0].fColor = init.fOverrideColor; } - init.getOverrideColorIfSet(&fGeoData[0].fColor); // setup batch properties - fBatch.fColorIgnored = !init.readsColor(); + fBatch.fColorIgnored = init.fColorIgnored; fBatch.fColor = fGeoData[0].fColor; fBatch.fStroke = fGeoData[0].fStroke; - fBatch.fUsesLocalCoords = init.readsLocalCoords(); - fBatch.fCoverageIgnored = !init.readsCoverage(); + fBatch.fUsesLocalCoords = init.fUsesLocalCoords; + fBatch.fCoverageIgnored = init.fCoverageIgnored; } void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline) override { @@ -875,17 +876,18 @@ public: void initBatchTracker(const GrPipelineInfo& init) override { // Handle any color overrides - if (!init.readsCoverage()) { + if (init.fColorIgnored) { fGeoData[0].fColor = GrColor_ILLEGAL; + } else if (GrColor_ILLEGAL != init.fOverrideColor) { + fGeoData[0].fColor = init.fOverrideColor; } - init.getOverrideColorIfSet(&fGeoData[0].fColor); // setup batch properties - fBatch.fColorIgnored = !init.readsColor(); + fBatch.fColorIgnored = init.fColorIgnored; fBatch.fColor = fGeoData[0].fColor; fBatch.fStroke = fGeoData[0].fStroke; - fBatch.fUsesLocalCoords = init.readsLocalCoords(); - fBatch.fCoverageIgnored = !init.readsCoverage(); + fBatch.fUsesLocalCoords = init.fUsesLocalCoords; + fBatch.fCoverageIgnored = init.fCoverageIgnored; } void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline) override { @@ -1138,17 +1140,18 @@ public: void initBatchTracker(const GrPipelineInfo& init) override { // Handle any color overrides - if (!init.readsColor()) { + if (init.fColorIgnored) { fGeoData[0].fColor = GrColor_ILLEGAL; + } else if (GrColor_ILLEGAL != init.fOverrideColor) { + fGeoData[0].fColor = init.fOverrideColor; } - init.getOverrideColorIfSet(&fGeoData[0].fColor); // setup batch properties - fBatch.fColorIgnored = !init.readsColor(); + fBatch.fColorIgnored = init.fColorIgnored; fBatch.fColor = fGeoData[0].fColor; fBatch.fMode = fGeoData[0].fMode; - fBatch.fUsesLocalCoords = init.readsLocalCoords(); - fBatch.fCoverageIgnored = !init.readsCoverage(); + fBatch.fUsesLocalCoords = init.fUsesLocalCoords; + fBatch.fCoverageIgnored = init.fCoverageIgnored; } void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline) override { @@ -1486,17 +1489,18 @@ public: void initBatchTracker(const GrPipelineInfo& init) override { // Handle any color overrides - if (!init.readsColor()) { + if (init.fColorIgnored) { fGeoData[0].fColor = GrColor_ILLEGAL; + } else if (GrColor_ILLEGAL != init.fOverrideColor) { + fGeoData[0].fColor = init.fOverrideColor; } - init.getOverrideColorIfSet(&fGeoData[0].fColor); // setup batch properties - fBatch.fColorIgnored = !init.readsColor(); + fBatch.fColorIgnored = init.fColorIgnored; fBatch.fColor = fGeoData[0].fColor; fBatch.fStroke = fGeoData[0].fStroke; - fBatch.fUsesLocalCoords = init.readsLocalCoords(); - fBatch.fCoverageIgnored = !init.readsCoverage(); + fBatch.fUsesLocalCoords = init.fUsesLocalCoords; + fBatch.fCoverageIgnored = init.fCoverageIgnored; } void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline) override { @@ -1658,17 +1662,18 @@ public: void initBatchTracker(const GrPipelineInfo& init) override { // Handle any color overrides - if (!init.readsColor()) { + if (init.fColorIgnored) { fGeoData[0].fColor = GrColor_ILLEGAL; + } else if (GrColor_ILLEGAL != init.fOverrideColor) { + fGeoData[0].fColor = init.fOverrideColor; } - init.getOverrideColorIfSet(&fGeoData[0].fColor); // setup batch properties - fBatch.fColorIgnored = !init.readsColor(); + fBatch.fColorIgnored = init.fColorIgnored; fBatch.fColor = fGeoData[0].fColor; fBatch.fStroke = fGeoData[0].fStroke; - fBatch.fUsesLocalCoords = init.readsLocalCoords(); - fBatch.fCoverageIgnored = !init.readsCoverage(); + fBatch.fUsesLocalCoords = init.fUsesLocalCoords; + fBatch.fCoverageIgnored = init.fCoverageIgnored; } void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline) override { diff --git a/src/gpu/GrPathProcessor.cpp b/src/gpu/GrPathProcessor.cpp index d10c4662e9..b47fa6a973 100644 --- a/src/gpu/GrPathProcessor.cpp +++ b/src/gpu/GrPathProcessor.cpp @@ -32,18 +32,17 @@ void GrPathProcessor::getInvariantOutputCoverage(GrInitInvariantOutput* out) con void GrPathProcessor::initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const { PathBatchTracker* local = bt->cast<PathBatchTracker>(); - if (!init.readsColor()) { + if (init.fColorIgnored) { local->fInputColorType = kIgnored_GrGPInput; local->fColor = GrColor_ILLEGAL; } else { local->fInputColorType = kUniform_GrGPInput; - if (!init.getOverrideColorIfSet(&local->fColor)) { - local->fColor = this->color(); - } + local->fColor = GrColor_ILLEGAL == init.fOverrideColor ? this->color() : + init.fOverrideColor; } - local->fInputCoverageType = init.readsCoverage() ? kAllOnes_GrGPInput : kIgnored_GrGPInput; - local->fUsesLocalCoords = init.readsLocalCoords(); + local->fInputCoverageType = init.fCoverageIgnored ? kIgnored_GrGPInput : kAllOnes_GrGPInput; + local->fUsesLocalCoords = init.fUsesLocalCoords; } bool GrPathProcessor::canMakeEqual(const GrBatchTracker& m, diff --git a/src/gpu/GrPipeline.cpp b/src/gpu/GrPipeline.cpp index 7bdc3000d5..4feddb00ab 100644 --- a/src/gpu/GrPipeline.cpp +++ b/src/gpu/GrPipeline.cpp @@ -30,7 +30,7 @@ GrPipeline::GrPipeline(const GrPipelineBuilder& pipelineBuilder, overrideColor = colorPOI.inputColorToEffectiveStage(); } - GrXferProcessor::OptFlags optFlags = GrXferProcessor::kNone_OptFlags; + GrXferProcessor::OptFlags optFlags; if (xferProcessor) { fXferProcessor.reset(xferProcessor.get()); @@ -41,11 +41,6 @@ GrPipeline::GrPipeline(const GrPipelineBuilder& pipelineBuilder, caps); } - // No need to have an override color if it isn't even going to be used. - if (SkToBool(GrXferProcessor::kIgnoreColor_OptFlag)) { - overrideColor = GrColor_ILLEGAL; - } - // When path rendering the stencil settings are not always set on the GrPipelineBuilder // so we must check the draw type. In cases where we will skip drawing we simply return a // null GrPipeline. @@ -103,25 +98,13 @@ GrPipeline::GrPipeline(const GrPipelineBuilder& pipelineBuilder, pipelineBuilder.fCoverageStages[i].processor()->usesLocalCoords(); } - // Setup info we need to pass to GrPrimitiveProcessors that are used with this GrPipeline. - fInfoForPrimitiveProcessor.fFlags = 0; - if (!SkToBool(optFlags & GrXferProcessor::kIgnoreColor_OptFlag)) { - fInfoForPrimitiveProcessor.fFlags |= GrPipelineInfo::kReadsColor_GrPipelineInfoFlag; - } - if (GrColor_ILLEGAL != overrideColor) { - fInfoForPrimitiveProcessor.fFlags |= GrPipelineInfo::kUseOverrideColor_GrPipelineInfoFlag; - fInfoForPrimitiveProcessor.fOverrideColor = overrideColor; - } - if (!SkToBool(optFlags & GrXferProcessor::kIgnoreCoverage_OptFlag)) { - fInfoForPrimitiveProcessor.fFlags |= GrPipelineInfo::kReadsCoverage_GrPipelineInfoFlag; - } - if (usesLocalCoords) { - fInfoForPrimitiveProcessor.fFlags |= GrPipelineInfo::kReadsLocalCoords_GrPipelineInfoFlag; - } - if (SkToBool(optFlags & GrXferProcessor::kCanTweakAlphaForCoverage_OptFlag)) { - fInfoForPrimitiveProcessor.fFlags |= - GrPipelineInfo::kCanTweakAlphaForCoverage_GrPipelineInfoFlag; - } + // let the GP init the batch tracker + fInitBT.fColorIgnored = SkToBool(optFlags & GrXferProcessor::kIgnoreColor_OptFlag); + fInitBT.fOverrideColor = fInitBT.fColorIgnored ? GrColor_ILLEGAL : overrideColor; + fInitBT.fCoverageIgnored = SkToBool(optFlags & GrXferProcessor::kIgnoreCoverage_OptFlag); + fInitBT.fUsesLocalCoords = usesLocalCoords; + fInitBT.fCanTweakAlphaForCoverage = + SkToBool(optFlags & GrXferProcessor::kCanTweakAlphaForCoverage_OptFlag); } void GrPipeline::adjustProgramFromOptimizations(const GrPipelineBuilder& pipelineBuilder, diff --git a/src/gpu/GrPipeline.h b/src/gpu/GrPipeline.h index bf8ca8a725..e91baeb35e 100644 --- a/src/gpu/GrPipeline.h +++ b/src/gpu/GrPipeline.h @@ -97,9 +97,7 @@ public: bool readsFragPosition() const { return fReadsFragPosition; } - const GrPipelineInfo& infoForPrimitiveProcessor() const { - return fInfoForPrimitiveProcessor; - } + const GrPipelineInfo& getInitBatchTracker() const { return fInitBT; } private: /** @@ -137,7 +135,7 @@ private: ProgramXferProcessor fXferProcessor; FragmentStageArray fFragmentStages; bool fReadsFragPosition; - GrPipelineInfo fInfoForPrimitiveProcessor; + GrPipelineInfo fInitBT; // This function is equivalent to the offset into fFragmentStages where coverage stages begin. int fNumColorStages; diff --git a/src/gpu/GrPrimitiveProcessor.h b/src/gpu/GrPrimitiveProcessor.h index e5635a823b..4147b74963 100644 --- a/src/gpu/GrPrimitiveProcessor.h +++ b/src/gpu/GrPrimitiveProcessor.h @@ -72,65 +72,16 @@ class GrGLPrimitiveProcessor; struct GrInitInvariantOutput; /* - * This class allows the GrPipeline to communicate information about the pipeline to a - * GrPrimitiveProcessor that will be used in conjunction with the GrPipeline. + * This struct allows the GrPipeline to communicate information about the pipeline. Most of this + * is overrides, but some of it is general information. Logically it should live in GrPipeline.h, + * but this is problematic due to circular dependencies. */ -class GrPipelineInfo { -public: - /** Does the pipeline require the GrPrimitiveProcessor's color? */ - bool readsColor() const { return SkToBool(kReadsColor_GrPipelineInfoFlag & fFlags); } - - /** Does the pipeline require the GrPrimitiveProcessor's coverage? */ - bool readsCoverage() const { return SkToBool(kReadsCoverage_GrPipelineInfoFlag & fFlags); } - - /** Does the pipeline require access to (implicit or explicit) local coordinates? */ - bool readsLocalCoords() const { - return SkToBool(kReadsLocalCoords_GrPipelineInfoFlag & fFlags); - } - - /** Does the pipeline allow the GrPrimitiveProcessor to combine color and coverage into one - color output ? */ - bool canTweakAlphaForCoverage() const { - return SkToBool(kCanTweakAlphaForCoverage_GrPipelineInfoFlag & fFlags); - } - - /** Does the pipeline require the GrPrimitiveProcessor to specify a specific color (and if - so get the color)? */ - bool getOverrideColorIfSet(GrColor* overrideColor) const { - if (SkToBool(kUseOverrideColor_GrPipelineInfoFlag & fFlags)) { - SkASSERT(SkToBool(kReadsColor_GrPipelineInfoFlag & fFlags)); - if (overrideColor) { - *overrideColor = fOverrideColor; - } - return true; - } - return false; - } - -private: - enum { - // If this is not set the primitive processor need not produce a color output - kReadsColor_GrPipelineInfoFlag = 0x1, - - // If this is not set the primitive processor need not produce a coverage output - kReadsCoverage_GrPipelineInfoFlag = 0x2, - - // If this is not set the primitive processor need not produce local coordinates - kReadsLocalCoords_GrPipelineInfoFlag = 0x4, - - // If this flag is set then the primitive processor may produce color*coverage as - // its color output (and not output a separate coverage). - kCanTweakAlphaForCoverage_GrPipelineInfoFlag = 0x8, - - // If this flag is set the GrPrimitiveProcessor must produce fOverrideColor as its - // output color. If not set fOverrideColor is to be ignored. - kUseOverrideColor_GrPipelineInfoFlag = 0x10, - }; - - uint32_t fFlags; - GrColor fOverrideColor; - - friend class GrPipeline; // To initialize this +struct GrPipelineInfo { + bool fColorIgnored; + bool fCoverageIgnored; + GrColor fOverrideColor; + bool fUsesLocalCoords; + bool fCanTweakAlphaForCoverage; }; /* diff --git a/src/gpu/GrRectBatch.cpp b/src/gpu/GrRectBatch.cpp index 222aaef8a9..bf085bdfdf 100644 --- a/src/gpu/GrRectBatch.cpp +++ b/src/gpu/GrRectBatch.cpp @@ -70,16 +70,17 @@ public: void initBatchTracker(const GrPipelineInfo& init) override { // Handle any color overrides - if (!init.readsColor()) { + if (init.fColorIgnored) { fGeoData[0].fColor = GrColor_ILLEGAL; + } else if (GrColor_ILLEGAL != init.fOverrideColor) { + fGeoData[0].fColor = init.fOverrideColor; } - init.getOverrideColorIfSet(&fGeoData[0].fColor); // setup batch properties - fBatch.fColorIgnored = !init.readsColor(); + fBatch.fColorIgnored = init.fColorIgnored; fBatch.fColor = fGeoData[0].fColor; - fBatch.fUsesLocalCoords = init.readsLocalCoords(); - fBatch.fCoverageIgnored = !init.readsCoverage(); + fBatch.fUsesLocalCoords = init.fUsesLocalCoords; + fBatch.fCoverageIgnored = init.fCoverageIgnored; } void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline) override { diff --git a/src/gpu/GrTessellatingPathRenderer.cpp b/src/gpu/GrTessellatingPathRenderer.cpp index de5dcab8ab..a41a88eed6 100644 --- a/src/gpu/GrTessellatingPathRenderer.cpp +++ b/src/gpu/GrTessellatingPathRenderer.cpp @@ -1375,10 +1375,11 @@ public: void initBatchTracker(const GrPipelineInfo& init) override { // Handle any color overrides - if (!init.readsColor()) { + if (init.fColorIgnored) { fColor = GrColor_ILLEGAL; + } else if (GrColor_ILLEGAL != init.fOverrideColor) { + fColor = init.fOverrideColor; } - init.getOverrideColorIfSet(&fColor); fPipelineInfo = init; } @@ -1411,8 +1412,8 @@ public: LOG("got %d pts, %d contours\n", maxPts, contourCnt); uint32_t flags = GrDefaultGeoProcFactory::kPosition_GPType; SkAutoTUnref<const GrGeometryProcessor> gp( - GrDefaultGeoProcFactory::Create(flags, fColor, fPipelineInfo.readsLocalCoords(), - !fPipelineInfo.readsCoverage(), fViewMatrix, + GrDefaultGeoProcFactory::Create(flags, fColor, fPipelineInfo.fUsesLocalCoords, + fPipelineInfo.fCoverageIgnored, fViewMatrix, SkMatrix::I())); batchTarget->initDraw(gp, pipeline); diff --git a/src/gpu/GrTestBatch.h b/src/gpu/GrTestBatch.h index 5e0f107d27..aa0c63773e 100644 --- a/src/gpu/GrTestBatch.h +++ b/src/gpu/GrTestBatch.h @@ -34,16 +34,17 @@ public: void initBatchTracker(const GrPipelineInfo& init) override { // Handle any color overrides - if (!init.readsColor()) { + if (init.fColorIgnored) { this->geoData(0)->fColor = GrColor_ILLEGAL; + } else if (GrColor_ILLEGAL != init.fOverrideColor) { + this->geoData(0)->fColor = init.fOverrideColor; } - init.getOverrideColorIfSet(&this->geoData(0)->fColor); // setup batch properties - fBatch.fColorIgnored = !init.readsColor(); + fBatch.fColorIgnored = init.fColorIgnored; fBatch.fColor = this->geoData(0)->fColor; - fBatch.fUsesLocalCoords = init.readsLocalCoords(); - fBatch.fCoverageIgnored = !init.readsCoverage(); + fBatch.fUsesLocalCoords = init.fUsesLocalCoords; + fBatch.fCoverageIgnored = init.fCoverageIgnored; } void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline) override { diff --git a/src/gpu/effects/GrCustomXfermode.cpp b/src/gpu/effects/GrCustomXfermode.cpp index 94d50f684e..da3b5a25a9 100644 --- a/src/gpu/effects/GrCustomXfermode.cpp +++ b/src/gpu/effects/GrCustomXfermode.cpp @@ -755,7 +755,7 @@ GrXferProcessor::OptFlags CustomXP::onGetOptimizations(const GrProcOptInfo& colo = blend(f*Sa, Da) */ - OptFlags flags = kNone_OptFlags; + OptFlags flags = kNone_Opt; if (colorPOI.allStagesMultiplyInput()) { flags |= kCanTweakAlphaForCoverage_OptFlag; } diff --git a/src/gpu/effects/GrDashingEffect.cpp b/src/gpu/effects/GrDashingEffect.cpp index 063bfd1352..8ebb31f9fe 100644 --- a/src/gpu/effects/GrDashingEffect.cpp +++ b/src/gpu/effects/GrDashingEffect.cpp @@ -274,16 +274,17 @@ public: void initBatchTracker(const GrPipelineInfo& init) override { // Handle any color overrides - if (!init.readsColor()) { + if (init.fColorIgnored) { fGeoData[0].fColor = GrColor_ILLEGAL; + } else if (GrColor_ILLEGAL != init.fOverrideColor) { + fGeoData[0].fColor = init.fOverrideColor; } - init.getOverrideColorIfSet(&fGeoData[0].fColor); // setup batch properties - fBatch.fColorIgnored = !init.readsColor(); + fBatch.fColorIgnored = init.fColorIgnored; fBatch.fColor = fGeoData[0].fColor; - fBatch.fUsesLocalCoords = init.readsLocalCoords(); - fBatch.fCoverageIgnored = !init.readsCoverage(); + fBatch.fUsesLocalCoords = init.fUsesLocalCoords; + fBatch.fCoverageIgnored = init.fCoverageIgnored; } struct DashDraw { diff --git a/src/gpu/effects/GrPorterDuffXferProcessor.cpp b/src/gpu/effects/GrPorterDuffXferProcessor.cpp index 6fc3c93e00..df44a1b555 100644 --- a/src/gpu/effects/GrPorterDuffXferProcessor.cpp +++ b/src/gpu/effects/GrPorterDuffXferProcessor.cpp @@ -428,7 +428,7 @@ PorterDuffXferProcessor::onGetOptimizations(const GrProcOptInfo& colorPOI, bool doesStencilWrite, GrColor* overrideColor, const GrCaps& caps) { - GrXferProcessor::OptFlags optFlags = GrXferProcessor::kNone_OptFlags; + GrXferProcessor::OptFlags optFlags = GrXferProcessor::kNone_Opt; if (!fBlendFormula.modifiesDst()) { if (!doesStencilWrite) { optFlags |= GrXferProcessor::kSkipDraw_OptFlag; @@ -471,7 +471,7 @@ public: private: GrXferProcessor::OptFlags onGetOptimizations(const GrProcOptInfo&, const GrProcOptInfo&, bool, GrColor*, const GrCaps&) override { - return kNone_OptFlags; + return kNone_Opt; } void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override; diff --git a/tests/GrPorterDuffTest.cpp b/tests/GrPorterDuffTest.cpp index b7f7572896..def7280eee 100644 --- a/tests/GrPorterDuffTest.cpp +++ b/tests/GrPorterDuffTest.cpp @@ -62,7 +62,7 @@ enum { }; enum { - kNone_OptFlags = GrXferProcessor::kNone_OptFlags, + kNone_Opt = GrXferProcessor::kNone_Opt, kSkipDraw_OptFlag = GrXferProcessor::kSkipDraw_OptFlag, kIgnoreColor_OptFlag = GrXferProcessor::kIgnoreColor_OptFlag, kIgnoreCoverage_OptFlag = GrXferProcessor::kIgnoreCoverage_OptFlag, @@ -128,7 +128,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const case SkXfermode::kSrc_Mode: TEST_ASSERT(!xpi.fBlendedColor.fWillBlendWithDst); TEST_ASSERT(kNone_GrColorComponentFlags == xpi.fBlendedColor.fKnownColorFlags); - TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags); + TEST_ASSERT((kNone_Opt) == xpi.fOptFlags); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kCoverage_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -175,7 +175,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const case SkXfermode::kSrcIn_Mode: TEST_ASSERT(xpi.fBlendedColor.fWillBlendWithDst); TEST_ASSERT(kNone_GrColorComponentFlags == xpi.fBlendedColor.fKnownColorFlags); - TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags); + TEST_ASSERT((kNone_Opt) == xpi.fOptFlags); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kCoverage_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -186,7 +186,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const case SkXfermode::kDstIn_Mode: TEST_ASSERT(xpi.fBlendedColor.fWillBlendWithDst); TEST_ASSERT(kNone_GrColorComponentFlags == xpi.fBlendedColor.fKnownColorFlags); - TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags); + TEST_ASSERT((kNone_Opt) == xpi.fOptFlags); TEST_ASSERT(kISAModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kReverseSubtract_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -197,7 +197,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const case SkXfermode::kSrcOut_Mode: TEST_ASSERT(xpi.fBlendedColor.fWillBlendWithDst); TEST_ASSERT(kNone_GrColorComponentFlags == xpi.fBlendedColor.fKnownColorFlags); - TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags); + TEST_ASSERT((kNone_Opt) == xpi.fOptFlags); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kCoverage_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -230,7 +230,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const case SkXfermode::kDstATop_Mode: TEST_ASSERT(xpi.fBlendedColor.fWillBlendWithDst); TEST_ASSERT(kNone_GrColorComponentFlags == xpi.fBlendedColor.fKnownColorFlags); - TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags); + TEST_ASSERT((kNone_Opt) == xpi.fOptFlags); TEST_ASSERT(kModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kISAModulate_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kAdd_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -263,7 +263,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const case SkXfermode::kModulate_Mode: TEST_ASSERT(xpi.fBlendedColor.fWillBlendWithDst); TEST_ASSERT(kNone_GrColorComponentFlags == xpi.fBlendedColor.fKnownColorFlags); - TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags); + TEST_ASSERT((kNone_Opt) == xpi.fOptFlags); TEST_ASSERT(kISCModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kReverseSubtract_GrBlendEquation == xpi.fBlendInfo.fEquation); @@ -663,7 +663,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const case SkXfermode::kModulate_Mode: TEST_ASSERT(xpi.fBlendedColor.fWillBlendWithDst); TEST_ASSERT(kNone_GrColorComponentFlags == xpi.fBlendedColor.fKnownColorFlags); - TEST_ASSERT((kNone_OptFlags) == xpi.fOptFlags); + TEST_ASSERT((kNone_Opt) == xpi.fOptFlags); TEST_ASSERT(kISCModulate_OutputType == xpi.fPrimaryOutputType); TEST_ASSERT(kNone_OutputType == xpi.fSecondaryOutputType); TEST_ASSERT(kReverseSubtract_GrBlendEquation == xpi.fBlendInfo.fEquation); |