aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrOpFlushState.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-08-09 16:27:09 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-10 12:54:05 +0000
commitbfd18cdd5421b6fac063bd07a96a5b9b1afa6a88 (patch)
tree122c5d36cc5e8aef3232ec822540262d64007ae6 /src/gpu/GrOpFlushState.h
parent65048139bd26c8edbc6796f220e79b6c848151d7 (diff)
Move GrAppliedClip into GrPipeline
Change-Id: I522c2fd52bea9813baba7cdb3f11b63e7ab96b50 Reviewed-on: https://skia-review.googlesource.com/28861 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrOpFlushState.h')
-rw-r--r--src/gpu/GrOpFlushState.h18
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: