diff options
author | Brian Salomon <bsalomon@google.com> | 2018-06-26 09:12:38 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-26 15:35:12 +0000 |
commit | 493489054f85d1b7725412ad7a3cdc70c7ec5466 (patch) | |
tree | 45223f5039eefd3aba721d737cb70549baaa8d0d /src/gpu/GrPipeline.cpp | |
parent | d5506cb888858bd19fa54be50714a8d661cedf33 (diff) |
Refactor GrPipeline dynamic state.
Remove scissor rect from GrPipeline.
Draws can specify "fixed dynamic state" which doesn't use the dynamism at
all or can specify dynamic state arrays with an entry per GrMesh.
When we state other than scissor rects this will allow the caller to
use a mix of truly dynamic and fixed dynamic state. So a caller that
only has dynamic scissor rects doesn't need to store its remaining
unvarying state in an array.
Change-Id: I8fcc07eb600c72a26cc712b185755c2116021a8a
Reviewed-on: https://skia-review.googlesource.com/137223
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrPipeline.cpp')
-rw-r--r-- | src/gpu/GrPipeline.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gpu/GrPipeline.cpp b/src/gpu/GrPipeline.cpp index a0eceb32af..6608d7c7d2 100644 --- a/src/gpu/GrPipeline.cpp +++ b/src/gpu/GrPipeline.cpp @@ -16,7 +16,8 @@ #include "ops/GrOp.h" -GrPipeline::GrPipeline(const InitArgs& args, GrProcessorSet&& processors, +GrPipeline::GrPipeline(const InitArgs& args, + GrProcessorSet&& processors, GrAppliedClip&& appliedClip) { SkASSERT(args.fProxy); SkASSERT(processors.isFinalized()); @@ -24,10 +25,13 @@ GrPipeline::GrPipeline(const InitArgs& args, GrProcessorSet&& processors, fProxy.reset(args.fProxy); fFlags = args.fFlags; - fScissorState = appliedClip.scissorState(); if (appliedClip.hasStencilClip()) { fFlags |= kHasStencilClip_Flag; } + if (appliedClip.scissorState().enabled()) { + fFlags |= kScissorEnabled_Flag; + } + fWindowRectsState = appliedClip.windowRectsState(); if (!args.fUserStencil->isDisabled(fFlags & kHasStencilClip_Flag)) { fFlags |= kStencilEnabled_Flag; @@ -97,7 +101,6 @@ GrXferBarrierType GrPipeline::xferBarrierType(const GrCaps& caps) const { GrPipeline::GrPipeline(GrRenderTargetProxy* proxy, ScissorState scissorState, SkBlendMode blendmode) : fProxy(proxy) - , fScissorState() , fWindowRectsState() , fUserStencilSettings(&GrUserStencilSettings::kUnused) , fFlags() @@ -105,7 +108,7 @@ GrPipeline::GrPipeline(GrRenderTargetProxy* proxy, ScissorState scissorState, Sk , fFragmentProcessors() , fNumColorProcessors(0) { SkASSERT(proxy); - if (ScissorState::kEnabled == scissorState) { - fScissorState.set({0, 0, 0, 0}); // caller will use the DynamicState struct. + if (scissorState) { + fFlags |= kScissorEnabled_Flag; } } |