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 /gm | |
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 'gm')
-rw-r--r-- | gm/beziereffects.cpp | 11 | ||||
-rw-r--r-- | gm/convexpolyeffect.cpp | 5 |
2 files changed, 9 insertions, 7 deletions
diff --git a/gm/beziereffects.cpp b/gm/beziereffects.cpp index 26da791746..9f3bcd74ec 100644 --- a/gm/beziereffects.cpp +++ b/gm/beziereffects.cpp @@ -50,7 +50,7 @@ protected: this->setBounds(rect, HasAABloat::kYes, IsZeroArea::kNo); } - const GrPipeline* makePipeline(Target* target) { + Target::PipelineAndFixedDynamicState makePipeline(Target* target) { return target->makePipeline(0, std::move(fProcessorSet), target->detachAppliedClip()); } @@ -100,7 +100,8 @@ private: } SkRect rect = this->rect(); SkPointPriv::SetRectTriStrip(pts, rect, sizeof(SkPoint)); - helper.recordDraw(target, this->gp(), this->makePipeline(target)); + auto pipe = this->makePipeline(target); + helper.recordDraw(target, this->gp(), pipe.fPipeline, pipe.fFixedDynamicState); } static constexpr int kVertsPerCubic = 4; @@ -296,7 +297,8 @@ private: SkPoint3 pt3 = {verts[v].fPosition.x(), verts[v].fPosition.y(), 1.f}; fKLM.mapHomogeneousPoints((SkPoint3* ) verts[v].fKLM, &pt3, 1); } - helper.recordDraw(target, this->gp(), this->makePipeline(target)); + auto pipe = this->makePipeline(target); + helper.recordDraw(target, this->gp(), pipe.fPipeline, pipe.fFixedDynamicState); } SkMatrix fKLM; @@ -513,7 +515,8 @@ private: SkRect rect = this->rect(); SkPointPriv::SetRectTriStrip(&verts[0].fPosition, rect, sizeof(Vertex)); fDevToUV.apply<4, sizeof(Vertex), sizeof(SkPoint)>(verts); - helper.recordDraw(target, this->gp(), this->makePipeline(target)); + auto pipe = this->makePipeline(target); + helper.recordDraw(target, this->gp(), pipe.fPipeline, pipe.fFixedDynamicState); } GrPathUtils::QuadUVMatrix fDevToUV; diff --git a/gm/convexpolyeffect.cpp b/gm/convexpolyeffect.cpp index 496b6b173f..3c825dc78a 100644 --- a/gm/convexpolyeffect.cpp +++ b/gm/convexpolyeffect.cpp @@ -92,9 +92,8 @@ private: SkPointPriv::SetRectTriStrip(verts, fRect, sizeof(SkPoint)); - helper.recordDraw( - target, gp.get(), - target->makePipeline(0, std::move(fProcessors), target->detachAppliedClip())); + auto pipe = target->makePipeline(0, std::move(fProcessors), target->detachAppliedClip()); + helper.recordDraw(target, gp.get(), pipe.fPipeline, pipe.fFixedDynamicState); } bool onCombineIfPossible(GrOp* op, const GrCaps& caps) override { return false; } |