Chromium Code Reviews| Index: src/gpu/GrPathRenderer.h |
| diff --git a/src/gpu/GrPathRenderer.h b/src/gpu/GrPathRenderer.h |
| index 051e0078525a5f7a3c9353924b8fe30636467efc..203668cb412616a1a927ec81d0f3ceb4a44054a7 100644 |
| --- a/src/gpu/GrPathRenderer.h |
| +++ b/src/gpu/GrPathRenderer.h |
| @@ -57,14 +57,13 @@ public: |
| /** |
| * This function is to get the stencil support for a particular path. The path's fill must |
| - * not be an inverse type. |
| + * not be an inverse type. The path will always be filled and not stroked. |
| * |
| * @param path the path that will be drawn |
| - * @param stroke the stroke information (width, join, cap). |
| */ |
| - StencilSupport getStencilSupport(const SkPath& path, const GrStrokeInfo& stroke) const { |
| + StencilSupport getStencilSupport(const SkPath& path) const { |
| SkASSERT(!path.isInverseFillType()); |
| - return this->onGetStencilSupport(path, stroke); |
| + return this->onGetStencilSupport(path); |
| } |
| /** Args to canDrawPath() |
| @@ -161,9 +160,11 @@ public: |
| canArgs.fIsStencilBufferMSAA = |
| args.fPipelineBuilder->getRenderTarget()->isStencilBufferMultisampled(); |
| SkASSERT(this->canDrawPath(canArgs)); |
| - SkASSERT(args.fPipelineBuilder->getStencil().isDisabled() || |
| - kNoRestriction_StencilSupport == this->getStencilSupport(*args.fPath, |
| - *args.fStroke)); |
| + if (!args.fPipelineBuilder->getStencil().isDisabled()) { |
| + SkASSERT(kNoRestriction_StencilSupport == this->getStencilSupport(*args.fPath)); |
| + SkASSERT(!args.fStroke->isDashed()); |
| + SkASSERT(args.fStroke->isFillStyle()); |
| + } |
| #endif |
| return this->onDrawPath(args); |
| } |
| @@ -175,7 +176,6 @@ public: |
| * fPipelineBuilder The pipeline builder. |
| * fViewMatrix Matrix applied to the path. |
| * fPath The path to draw. |
| - * fStroke The stroke information (width, join, cap) |
| */ |
| struct StencilPathArgs { |
| GrDrawTarget* fTarget; |
| @@ -183,7 +183,6 @@ public: |
| GrPipelineBuilder* fPipelineBuilder; |
| const SkMatrix* fViewMatrix; |
| const SkPath* fPath; |
| - const GrStrokeInfo* fStroke; |
| void validate() const { |
| SkASSERT(fTarget); |
| @@ -191,7 +190,6 @@ public: |
| SkASSERT(fPipelineBuilder); |
| SkASSERT(fViewMatrix); |
| SkASSERT(fPath); |
| - SkASSERT(fStroke); |
| SkASSERT(!fPath->isEmpty()); |
| } |
| }; |
| @@ -203,7 +201,7 @@ public: |
| */ |
| void stencilPath(const StencilPathArgs& args) { |
| SkDEBUGCODE(args.validate();) |
| - SkASSERT(kNoSupport_StencilSupport != this->getStencilSupport(*args.fPath, *args.fStroke)); |
| + SkASSERT(kNoSupport_StencilSupport != this->getStencilSupport(*args.fPath)); |
| this->onStencilPath(args); |
| } |
| @@ -246,7 +244,7 @@ private: |
| /** |
| * Subclass overrides if it has any limitations of stenciling support. |
| */ |
| - virtual StencilSupport onGetStencilSupport(const SkPath&, const GrStrokeInfo&) const { |
| + virtual StencilSupport onGetStencilSupport(const SkPath&) const { |
| return kNoRestriction_StencilSupport; |
| } |
| @@ -281,7 +279,6 @@ private: |
| drawArgs.fColor = 0xFFFFFFFF; |
| drawArgs.fViewMatrix = args.fViewMatrix; |
| drawArgs.fPath = args.fPath; |
|
robertphillips
2016/05/04 20:44:19
Don't we still need to fill in the DrawPathArgs fS
bsalomon
2016/05/04 20:59:08
Yes, you're right. This changed worked for me loca
|
| - drawArgs.fStroke = args.fStroke; |
| drawArgs.fAntiAlias = false; |
| drawArgs.fGammaCorrect = false; |
| this->drawPath(drawArgs); |