diff options
Diffstat (limited to 'src/gpu/ops/GrDrawPathOp.h')
-rw-r--r-- | src/gpu/ops/GrDrawPathOp.h | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/src/gpu/ops/GrDrawPathOp.h b/src/gpu/ops/GrDrawPathOp.h index 0631adcdf6..8995de4bbd 100644 --- a/src/gpu/ops/GrDrawPathOp.h +++ b/src/gpu/ops/GrDrawPathOp.h @@ -23,31 +23,33 @@ class GrPaint; class GrDrawPathOpBase : public GrDrawOp { protected: - GrDrawPathOpBase(uint32_t classID, const SkMatrix& viewMatrix, GrPaint&& paint, - GrPathRendering::FillType fill, GrAA aa); + GrDrawPathOpBase(uint32_t classID, const SkMatrix& viewMatrix, GrPaint&&, + GrPathRendering::FillType, GrAAType); FixedFunctionFlags fixedFunctionFlags() const override { - return FixedFunctionFlags::kUsesHWAA | FixedFunctionFlags::kUsesStencil; + if (GrAATypeIsHW(fAAType)) { + return FixedFunctionFlags::kUsesHWAA | FixedFunctionFlags::kUsesStencil; + } + return FixedFunctionFlags::kUsesStencil; } bool xpRequiresDstTexture(const GrCaps& caps, const GrAppliedClip* clip) override { return this->doProcessorAnalysis(caps, clip).requiresDstTexture(); } - void wasRecorded() override { fProcessorSet.makePendingExecution(); } - protected: const SkMatrix& viewMatrix() const { return fViewMatrix; } - GrColor color() const { return fAnalysis.inputColor(); } + GrColor color() const { return fInputColor; } GrPathRendering::FillType fillType() const { return fFillType; } const GrProcessorSet& processors() const { return fProcessorSet; } void initPipeline(const GrOpFlushState&, GrPipeline*); const GrProcessorSet::Analysis& doProcessorAnalysis(const GrCaps& caps, const GrAppliedClip* clip) { - fProcessorSet.analyzeAndEliminateFragmentProcessors( - &fAnalysis, fAnalysis.inputColor(), GrProcessorAnalysisCoverage::kNone, clip, caps); + bool isMixedSamples = GrAAType::kMixedSamples == fAAType; + fAnalysis = fProcessorSet.finalize(fInputColor, GrProcessorAnalysisCoverage::kNone, clip, + isMixedSamples, caps, &fInputColor); return fAnalysis; } const GrProcessorSet::Analysis& processorAnalysis() const { - SkASSERT(fAnalysis.isInitializedWithProcessorSet()); + SkASSERT(fAnalysis.isInitialized()); return fAnalysis; } @@ -55,10 +57,11 @@ private: void onPrepare(GrOpFlushState*) final {} SkMatrix fViewMatrix; + GrColor fInputColor; GrProcessorSet fProcessorSet; GrProcessorSet::Analysis fAnalysis; GrPathRendering::FillType fFillType; - GrAA fAA; + GrAAType fAAType; typedef GrDrawOp INHERITED; }; @@ -67,9 +70,10 @@ class GrDrawPathOp final : public GrDrawPathOpBase { public: DEFINE_OP_CLASS_ID - static std::unique_ptr<GrDrawOp> Make(const SkMatrix& viewMatrix, GrPaint&& paint, GrAA aa, - GrPath* path) { - return std::unique_ptr<GrDrawOp>(new GrDrawPathOp(viewMatrix, std::move(paint), aa, path)); + static std::unique_ptr<GrDrawOp> Make(const SkMatrix& viewMatrix, GrPaint&& paint, + GrAAType aaType, GrPath* path) { + return std::unique_ptr<GrDrawOp>( + new GrDrawPathOp(viewMatrix, std::move(paint), aaType, path)); } const char* name() const override { return "DrawPath"; } @@ -77,8 +81,8 @@ public: SkString dumpInfo() const override; private: - GrDrawPathOp(const SkMatrix& viewMatrix, GrPaint&& paint, GrAA aa, const GrPath* path) - : GrDrawPathOpBase(ClassID(), viewMatrix, std::move(paint), path->getFillType(), aa) + GrDrawPathOp(const SkMatrix& viewMatrix, GrPaint&& paint, GrAAType aaType, const GrPath* path) + : GrDrawPathOpBase(ClassID(), viewMatrix, std::move(paint), path->getFillType(), aaType) , fPath(path) { this->setTransformedBounds(path->getBounds(), viewMatrix, HasAABloat::kNo, IsZeroArea::kNo); } @@ -160,11 +164,12 @@ public: static std::unique_ptr<GrDrawOp> Make(const SkMatrix& viewMatrix, SkScalar scale, SkScalar x, SkScalar y, GrPaint&& paint, - GrPathRendering::FillType fill, GrAA aa, + GrPathRendering::FillType fill, GrAAType aaType, GrPathRange* range, const InstanceData* instanceData, const SkRect& bounds) { - return std::unique_ptr<GrDrawOp>(new GrDrawPathRangeOp( - viewMatrix, scale, x, y, std::move(paint), fill, aa, range, instanceData, bounds)); + return std::unique_ptr<GrDrawOp>(new GrDrawPathRangeOp(viewMatrix, scale, x, y, + std::move(paint), fill, aaType, + range, instanceData, bounds)); } const char* name() const override { return "DrawPathRange"; } @@ -173,8 +178,8 @@ public: private: GrDrawPathRangeOp(const SkMatrix& viewMatrix, SkScalar scale, SkScalar x, SkScalar y, - GrPaint&& paint, GrPathRendering::FillType fill, GrAA aa, GrPathRange* range, - const InstanceData* instanceData, const SkRect& bounds); + GrPaint&& paint, GrPathRendering::FillType fill, GrAAType aaType, + GrPathRange* range, const InstanceData* instanceData, const SkRect& bounds); TransformType transformType() const { return fDraws.head()->fInstanceData->transformType(); } |