aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrPipeline.cpp
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2017-06-06 12:27:16 -0600
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-07 18:26:11 +0000
commit46983b7dd88603bb2a9a3c3e1ce3e147f5615f2f (patch)
treecb2dccc7b6d44b1100dc34af92c60d7b243d01c7 /src/gpu/GrPipeline.cpp
parent912e6b883782cd6a53348056012ff7ed38658c79 (diff)
Introduce dynamic pipeline state
Adds a DynamicState struct to GrPipeline that has a field for the scissor rect. Eventually this should become the only way to specify a scissor rectangle and may grow to contain more fields. Adds an array of DynamicStates to GrGpuCommandBuffer::draw and implements support in GL and Vulkan. Bug: skia: Change-Id: If5aebbf9da5d192acf7e68e7def4674ffc7ec310 Reviewed-on: https://skia-review.googlesource.com/18510 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu/GrPipeline.cpp')
-rw-r--r--src/gpu/GrPipeline.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/gpu/GrPipeline.cpp b/src/gpu/GrPipeline.cpp
index 8d1b926be1..9d8b2ef984 100644
--- a/src/gpu/GrPipeline.cpp
+++ b/src/gpu/GrPipeline.cpp
@@ -112,15 +112,19 @@ void GrPipeline::addDependenciesTo(GrRenderTargetProxy* rtp) const {
}
}
-GrPipeline::GrPipeline(GrRenderTarget* rt, SkBlendMode blendmode)
- : fRenderTarget(rt)
- , fScissorState()
- , fWindowRectsState()
- , fUserStencilSettings(&GrUserStencilSettings::kUnused)
- , fFlags()
- , fXferProcessor(GrPorterDuffXPFactory::MakeNoCoverageXP(blendmode))
- , fFragmentProcessors()
- , fNumColorProcessors(0) {}
+GrPipeline::GrPipeline(GrRenderTarget* rt, ScissorState scissorState, SkBlendMode blendmode)
+ : fRenderTarget(rt)
+ , fScissorState()
+ , fWindowRectsState()
+ , fUserStencilSettings(&GrUserStencilSettings::kUnused)
+ , fFlags()
+ , fXferProcessor(GrPorterDuffXPFactory::MakeNoCoverageXP(blendmode))
+ , fFragmentProcessors()
+ , fNumColorProcessors(0) {
+ if (ScissorState::kEnabled == scissorState) {
+ fScissorState.set({0, 0, 0, 0}); // caller will use the DynamicState struct.
+ }
+}
////////////////////////////////////////////////////////////////////////////////