diff options
author | robertphillips <robertphillips@google.com> | 2015-10-29 12:12:21 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-29 12:12:21 -0700 |
commit | 687378229aecefc0ab7e639181593774ec8a4290 (patch) | |
tree | 18eef745eb26d302a6bf90bcb2615984b5dfea10 /src/gpu/GrPathRenderer.h | |
parent | 89fe56bb98de55c7bd2b547c875b74a98bd5a1ca (diff) |
Remove GrPipelineBuilder from getPathRenderer call
Logically this CL:
Moves the PathRendererChain from GrContext to GrDrawManager
- this was needed to untangled the Path-Chain/Renderer header mess
- this entailed adding getDrawingMgr so the CMM could access the PathRenderingChain
- this also entailed re-adding freeGpuResources to the GrDrawingMgr
Moves the CanDrawArgs struct up stack
Removes the GrPipelineBuilder from the CanDrawArgs struct
Review URL: https://codereview.chromium.org/1407883004
Diffstat (limited to 'src/gpu/GrPathRenderer.h')
-rw-r--r-- | src/gpu/GrPathRenderer.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/gpu/GrPathRenderer.h b/src/gpu/GrPathRenderer.h index 2390ba0f97..25a2a68abb 100644 --- a/src/gpu/GrPathRenderer.h +++ b/src/gpu/GrPathRenderer.h @@ -10,7 +10,6 @@ #define GrPathRenderer_DEFINED #include "GrDrawTarget.h" -#include "GrPathRendererChain.h" #include "GrStencil.h" #include "GrStrokeInfo.h" @@ -51,13 +50,11 @@ public: * covered by the path. * 3) kNoSupport: This path renderer cannot be used to stencil the path. */ - typedef GrPathRendererChain::StencilSupport StencilSupport; - static const StencilSupport kNoSupport_StencilSupport = - GrPathRendererChain::kNoSupport_StencilSupport; - static const StencilSupport kStencilOnly_StencilSupport = - GrPathRendererChain::kStencilOnly_StencilSupport; - static const StencilSupport kNoRestriction_StencilSupport = - GrPathRendererChain::kNoRestriction_StencilSupport; + enum StencilSupport { + kNoSupport_StencilSupport, + kStencilOnly_StencilSupport, + kNoRestriction_StencilSupport, + }; /** * This function is to get the stencil support for a particular path. The path's fill must @@ -82,15 +79,17 @@ public: */ struct CanDrawPathArgs { const GrShaderCaps* fShaderCaps; - const GrPipelineBuilder* fPipelineBuilder;// only used by GrStencilAndCoverPathRenderer const SkMatrix* fViewMatrix; const SkPath* fPath; const GrStrokeInfo* fStroke; bool fAntiAlias; + // These next two are only used by GrStencilAndCoverPathRenderer + bool fIsStencilDisabled; + bool fIsStencilBufferMSAA; + void validate() const { SkASSERT(fShaderCaps); - SkASSERT(fPipelineBuilder); SkASSERT(fViewMatrix); SkASSERT(fPath); SkASSERT(fStroke); @@ -151,11 +150,14 @@ public: #ifdef SK_DEBUG CanDrawPathArgs canArgs; canArgs.fShaderCaps = args.fTarget->caps()->shaderCaps(); - canArgs.fPipelineBuilder = args.fPipelineBuilder; canArgs.fViewMatrix = args.fViewMatrix; canArgs.fPath = args.fPath; canArgs.fStroke = args.fStroke; canArgs.fAntiAlias = args.fAntiAlias; + + canArgs.fIsStencilDisabled = args.fPipelineBuilder->getStencil().isDisabled(); + canArgs.fIsStencilBufferMSAA = + args.fPipelineBuilder->getRenderTarget()->isStencilBufferMultisampled(); SkASSERT(this->canDrawPath(canArgs)); SkASSERT(args.fPipelineBuilder->getStencil().isDisabled() || kNoRestriction_StencilSupport == this->getStencilSupport(*args.fPath, |