diff options
Diffstat (limited to 'src/gpu/GrOpFlushState.h')
-rw-r--r-- | src/gpu/GrOpFlushState.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/gpu/GrOpFlushState.h b/src/gpu/GrOpFlushState.h index 2c860f9b81..cc1d22b962 100644 --- a/src/gpu/GrOpFlushState.h +++ b/src/gpu/GrOpFlushState.h @@ -8,6 +8,7 @@ #ifndef GrOpFlushState_DEFINED #define GrOpFlushState_DEFINED +#include "GrAppliedClip.h" #include "GrBufferAllocPool.h" #include "SkArenaAlloc.h" #include "ops/GrMeshDrawOp.h" @@ -100,8 +101,8 @@ public: GrRenderTarget* renderTarget() const { return fProxy->priv().peekRenderTarget(); } // TODO: do we still need the dst proxy here? - GrRenderTargetProxy* fProxy; - const GrAppliedClip* fAppliedClip; + GrRenderTargetProxy* fProxy; + GrAppliedClip* fAppliedClip; GrXferProcessor::DstProxy fDstProxy; }; @@ -112,6 +113,11 @@ public: return *fOpArgs; } + GrAppliedClip detachAppliedClip() { + SkASSERT(fOpArgs); + return fOpArgs->fAppliedClip ? std::move(*fOpArgs->fAppliedClip) : GrAppliedClip(); + } + template <typename... Args> GrPipeline* allocPipeline(Args&&... args) { return fPipelines.make<GrPipeline>(std::forward<Args>(args)...); @@ -239,6 +245,8 @@ public: const GrAppliedClip* clip() const { return this->state()->drawOpArgs().fAppliedClip; } + GrAppliedClip detachAppliedClip() { return this->state()->detachAppliedClip(); } + const GrXferProcessor::DstProxy& dstProxy() const { return this->state()->drawOpArgs().fDstProxy; } @@ -252,15 +260,15 @@ public: * Helper that makes a pipeline targeting the op's render target that incorporates the op's * GrAppliedClip. * */ - GrPipeline* makePipeline(uint32_t pipelineFlags, GrProcessorSet&& processorSet) { + GrPipeline* makePipeline(uint32_t pipelineFlags, GrProcessorSet&& processorSet, + GrAppliedClip&& clip) { GrPipeline::InitArgs pipelineArgs; pipelineArgs.fFlags = pipelineFlags; pipelineArgs.fProxy = this->proxy(); - pipelineArgs.fAppliedClip = this->clip(); pipelineArgs.fDstProxy = this->dstProxy(); pipelineArgs.fCaps = &this->caps(); pipelineArgs.fResourceProvider = this->resourceProvider(); - return this->allocPipeline(pipelineArgs, std::move(processorSet)); + return this->allocPipeline(pipelineArgs, std::move(processorSet), std::move(clip)); } private: |