diff options
Diffstat (limited to 'src/gpu/ops/GrDefaultPathRenderer.cpp')
-rw-r--r-- | src/gpu/ops/GrDefaultPathRenderer.cpp | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/src/gpu/ops/GrDefaultPathRenderer.cpp b/src/gpu/ops/GrDefaultPathRenderer.cpp index 91eca931ac..df6f81f552 100644 --- a/src/gpu/ops/GrDefaultPathRenderer.cpp +++ b/src/gpu/ops/GrDefaultPathRenderer.cpp @@ -14,6 +14,7 @@ #include "GrOpFlushState.h" #include "GrPathUtils.h" #include "GrSimpleMeshDrawOpHelper.h" +#include "GrSurfaceContextPriv.h" #include "SkGeometry.h" #include "SkString.h" #include "SkStrokeRec.h" @@ -333,13 +334,19 @@ private: public: DEFINE_OP_CLASS_ID - static std::unique_ptr<GrDrawOp> Make(GrPaint&& paint, const SkPath& path, SkScalar tolerance, - uint8_t coverage, const SkMatrix& viewMatrix, - bool isHairline, GrAAType aaType, const SkRect& devBounds, + static std::unique_ptr<GrDrawOp> Make(GrContext* context, + GrPaint&& paint, + const SkPath& path, + SkScalar tolerance, + uint8_t coverage, + const SkMatrix& viewMatrix, + bool isHairline, + GrAAType aaType, + const SkRect& devBounds, const GrUserStencilSettings* stencilSettings) { - return Helper::FactoryHelper<DefaultPathOp>(std::move(paint), path, tolerance, coverage, - viewMatrix, isHairline, aaType, devBounds, - stencilSettings); + return Helper::FactoryHelper<DefaultPathOp>(context, std::move(paint), path, tolerance, + coverage, viewMatrix, isHairline, aaType, + devBounds, stencilSettings); } const char* name() const override { return "DefaultPathOp"; } @@ -480,6 +487,8 @@ bool GrDefaultPathRenderer::internalDrawPath(GrRenderTargetContext* renderTarget const SkMatrix& viewMatrix, const GrShape& shape, bool stencilOnly) { + GrContext* context = renderTargetContext->surfPriv().getContext(); + SkASSERT(GrAAType::kCoverage != aaType); SkPath path; shape.asPath(&path); @@ -595,17 +604,19 @@ bool GrDefaultPathRenderer::internalDrawPath(GrRenderTargetContext* renderTarget renderTargetContext->addDrawOp( clip, GrRectOpFactory::MakeNonAAFillWithLocalMatrix( - std::move(paint), viewM, localMatrix, bounds, aaType, passes[p])); + context, std::move(paint), viewM, localMatrix, + bounds, aaType, passes[p])); } else { bool stencilPass = stencilOnly || passCount > 1; std::unique_ptr<GrDrawOp> op; if (stencilPass) { GrPaint stencilPaint; stencilPaint.setXPFactory(GrDisableColorXPFactory::Get()); - op = DefaultPathOp::Make(std::move(stencilPaint), path, srcSpaceTol, newCoverage, - viewMatrix, isHairline, aaType, devBounds, passes[p]); + op = DefaultPathOp::Make(context, std::move(stencilPaint), path, srcSpaceTol, + newCoverage, viewMatrix, isHairline, aaType, devBounds, + passes[p]); } else { - op = DefaultPathOp::Make(std::move(paint), path, srcSpaceTol, newCoverage, + op = DefaultPathOp::Make(context, std::move(paint), path, srcSpaceTol, newCoverage, viewMatrix, isHairline, aaType, devBounds, passes[p]); } renderTargetContext->addDrawOp(clip, std::move(op)); @@ -679,8 +690,8 @@ GR_DRAW_OP_TEST_DEFINE(DefaultPathOp) { if (GrFSAAType::kUnifiedMSAA == fsaaType && random->nextBool()) { aaType = GrAAType::kMSAA; } - return DefaultPathOp::Make(std::move(paint), path, srcSpaceTol, coverage, viewMatrix, true, - aaType, bounds, GrGetRandomStencil(random, context)); + return DefaultPathOp::Make(context, std::move(paint), path, srcSpaceTol, coverage, viewMatrix, + true, aaType, bounds, GrGetRandomStencil(random, context)); } #endif |