aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrPathRenderer.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-01-11 13:42:54 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-11 19:56:48 +0000
commit82f44319159bb98dcacdbbec7ea643dde5ed024b (patch)
treedcd8c8a5caaac2675fcfdf48c5af67f946200c24 /src/gpu/GrPathRenderer.h
parentab273facbfe496a3d5dd798e6b4b57c41eed7f16 (diff)
Make GrPaints move their GrProcessor ownership into GrPipelineBuilder.
This makes GrPaints usable only once. In some places we must make copies in order to issue draws with the same paint state. Change-Id: Ie816e5185ce93a064111cad64c6880e1e21184c2 Reviewed-on: https://skia-review.googlesource.com/6844 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrPathRenderer.h')
-rw-r--r--src/gpu/GrPathRenderer.h38
1 files changed, 18 insertions, 20 deletions
diff --git a/src/gpu/GrPathRenderer.h b/src/gpu/GrPathRenderer.h
index 8548087641..f1164a9503 100644
--- a/src/gpu/GrPathRenderer.h
+++ b/src/gpu/GrPathRenderer.h
@@ -124,20 +124,18 @@ public:
* fGammaCorrect true if gamma-correct rendering is to be used.
*/
struct DrawPathArgs {
- GrResourceProvider* fResourceProvider;
- const GrPaint* fPaint;
- const GrUserStencilSettings*fUserStencilSettings;
-
- GrRenderTargetContext* fRenderTargetContext;
- const GrClip* fClip;
- const SkMatrix* fViewMatrix;
- const GrShape* fShape;
- GrAAType fAAType;
- bool fGammaCorrect;
+ GrResourceProvider* fResourceProvider;
+ GrPaint&& fPaint;
+ const GrUserStencilSettings* fUserStencilSettings;
+ GrRenderTargetContext* fRenderTargetContext;
+ const GrClip* fClip;
+ const SkMatrix* fViewMatrix;
+ const GrShape* fShape;
+ GrAAType fAAType;
+ bool fGammaCorrect;
#ifdef SK_DEBUG
void validate() const {
SkASSERT(fResourceProvider);
- SkASSERT(fPaint);
SkASSERT(fUserStencilSettings);
SkASSERT(fRenderTargetContext);
SkASSERT(fClip);
@@ -279,15 +277,15 @@ private:
GrPaint paint;
- DrawPathArgs drawArgs;
- drawArgs.fResourceProvider = args.fResourceProvider;
- drawArgs.fPaint = &paint;
- drawArgs.fUserStencilSettings = &kIncrementStencil;
- drawArgs.fRenderTargetContext = args.fRenderTargetContext;
- drawArgs.fViewMatrix = args.fViewMatrix;
- drawArgs.fShape = args.fShape;
- drawArgs.fAAType = args.fAAType;
- drawArgs.fGammaCorrect = false;
+ DrawPathArgs drawArgs{args.fResourceProvider,
+ std::move(paint),
+ &kIncrementStencil,
+ args.fRenderTargetContext,
+ nullptr, // clip
+ args.fViewMatrix,
+ args.fShape,
+ args.fAAType,
+ false};
this->drawPath(drawArgs);
}