Minor change to Ganesh path renderers
In large part this is an attempt to get non-substantive changes out of https://codereview.chromium.org/2092893003/ (Retract PipelineBuilder some more)
All the other parameters extracted from DrawPathArgs are passed around by reference except for the userStencilSettings
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2167183002
Review-Url: https://codereview.chromium.org/2167183002
diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp
index b966264..66d60ab 100644
--- a/src/gpu/GrSWMaskHelper.cpp
+++ b/src/gpu/GrSWMaskHelper.cpp
@@ -160,7 +160,7 @@
void GrSWMaskHelper::DrawToTargetWithShapeMask(GrTexture* texture,
GrDrawContext* drawContext,
const GrPaint& paint,
- const GrUserStencilSettings* userStencilSettings,
+ const GrUserStencilSettings& userStencilSettings,
const GrClip& clip,
const SkMatrix& viewMatrix,
const SkIRect& rect) {
@@ -182,7 +182,7 @@
maskMatrix.preTranslate(SkIntToScalar(-rect.fLeft), SkIntToScalar(-rect.fTop));
GrPipelineBuilder pipelineBuilder(paint, drawContext->mustUseHWAA(paint));
- pipelineBuilder.setUserStencil(userStencilSettings);
+ pipelineBuilder.setUserStencil(&userStencilSettings);
pipelineBuilder.addCoverageFragmentProcessor(
GrSimpleTextureEffect::Make(texture,
diff --git a/src/gpu/GrSWMaskHelper.h b/src/gpu/GrSWMaskHelper.h
index ab88b8d..6d1d9b1 100644
--- a/src/gpu/GrSWMaskHelper.h
+++ b/src/gpu/GrSWMaskHelper.h
@@ -87,7 +87,7 @@
static void DrawToTargetWithShapeMask(GrTexture* texture,
GrDrawContext*,
const GrPaint& paint,
- const GrUserStencilSettings* userStencilSettings,
+ const GrUserStencilSettings& userStencilSettings,
const GrClip&,
const SkMatrix& viewMatrix,
const SkIRect& rect);
diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp
index 54d4851..87b0926 100644
--- a/src/gpu/GrSoftwarePathRenderer.cpp
+++ b/src/gpu/GrSoftwarePathRenderer.cpp
@@ -63,7 +63,7 @@
void GrSoftwarePathRenderer::DrawNonAARect(GrDrawContext* drawContext,
const GrPaint& paint,
- const GrUserStencilSettings* userStencilSettings,
+ const GrUserStencilSettings& userStencilSettings,
const GrClip& clip,
const SkMatrix& viewMatrix,
const SkRect& rect,
@@ -73,14 +73,14 @@
nullptr, &localMatrix));
GrPipelineBuilder pipelineBuilder(paint, drawContext->mustUseHWAA(paint));
- pipelineBuilder.setUserStencil(userStencilSettings);
+ pipelineBuilder.setUserStencil(&userStencilSettings);
drawContext->drawBatch(pipelineBuilder, clip, batch);
}
void GrSoftwarePathRenderer::DrawAroundInvPath(GrDrawContext* drawContext,
const GrPaint& paint,
- const GrUserStencilSettings* userStencilSettings,
+ const GrUserStencilSettings& userStencilSettings,
const GrClip& clip,
const SkMatrix& viewMatrix,
const SkIRect& devClipBounds,
@@ -137,7 +137,7 @@
*args.fClip, *args.fShape,
*args.fViewMatrix, &devShapeBounds, &devClipBounds)) {
if (inverseFilled) {
- DrawAroundInvPath(args.fDrawContext, *args.fPaint, args.fUserStencilSettings,
+ DrawAroundInvPath(args.fDrawContext, *args.fPaint, *args.fUserStencilSettings,
*args.fClip,
*args.fViewMatrix, devClipBounds, devShapeBounds);
@@ -148,17 +148,17 @@
SkAutoTUnref<GrTexture> texture(
GrSWMaskHelper::DrawShapeMaskToTexture(fTexProvider, *args.fShape, devShapeBounds,
args.fAntiAlias, args.fViewMatrix));
- if (nullptr == texture) {
+ if (!texture) {
return false;
}
GrSWMaskHelper::DrawToTargetWithShapeMask(texture, args.fDrawContext, *args.fPaint,
- args.fUserStencilSettings,
+ *args.fUserStencilSettings,
*args.fClip, *args.fViewMatrix,
devShapeBounds);
if (inverseFilled) {
- DrawAroundInvPath(args.fDrawContext, *args.fPaint, args.fUserStencilSettings,
+ DrawAroundInvPath(args.fDrawContext, *args.fPaint, *args.fUserStencilSettings,
*args.fClip,
*args.fViewMatrix, devClipBounds, devShapeBounds);
}
diff --git a/src/gpu/GrSoftwarePathRenderer.h b/src/gpu/GrSoftwarePathRenderer.h
index f488cbd..1548fa6 100644
--- a/src/gpu/GrSoftwarePathRenderer.h
+++ b/src/gpu/GrSoftwarePathRenderer.h
@@ -22,14 +22,14 @@
private:
static void DrawNonAARect(GrDrawContext* drawContext,
const GrPaint& paint,
- const GrUserStencilSettings* userStencilSettings,
+ const GrUserStencilSettings& userStencilSettings,
const GrClip& clip,
const SkMatrix& viewMatrix,
const SkRect& rect,
const SkMatrix& localMatrix);
static void DrawAroundInvPath(GrDrawContext* drawContext,
const GrPaint& paint,
- const GrUserStencilSettings* userStencilSettings,
+ const GrUserStencilSettings& userStencilSettings,
const GrClip& clip,
const SkMatrix& viewMatrix,
const SkIRect& devClipBounds,
diff --git a/src/gpu/batches/GrDefaultPathRenderer.cpp b/src/gpu/batches/GrDefaultPathRenderer.cpp
index dc40b7c..8e733d0 100644
--- a/src/gpu/batches/GrDefaultPathRenderer.cpp
+++ b/src/gpu/batches/GrDefaultPathRenderer.cpp
@@ -413,7 +413,7 @@
bool GrDefaultPathRenderer::internalDrawPath(GrDrawContext* drawContext,
const GrPaint& paint,
- const GrUserStencilSettings* userStencilSettings,
+ const GrUserStencilSettings& userStencilSettings,
const GrClip& clip,
const SkMatrix& viewMatrix,
const GrShape& shape,
@@ -442,7 +442,7 @@
if (stencilOnly) {
passes[0] = &gDirectToStencil;
} else {
- passes[0] = userStencilSettings;
+ passes[0] = &userStencilSettings;
}
lastPassIsBounds = false;
drawFace[0] = GrPipelineBuilder::kBoth_DrawFace;
@@ -452,7 +452,7 @@
if (stencilOnly) {
passes[0] = &gDirectToStencil;
} else {
- passes[0] = userStencilSettings;
+ passes[0] = &userStencilSettings;
}
drawFace[0] = GrPipelineBuilder::kBoth_DrawFace;
lastPassIsBounds = false;
@@ -591,7 +591,7 @@
"GrDefaultPathRenderer::onDrawPath");
return this->internalDrawPath(args.fDrawContext,
*args.fPaint,
- args.fUserStencilSettings,
+ *args.fUserStencilSettings,
*args.fClip,
*args.fViewMatrix,
*args.fShape,
@@ -607,7 +607,7 @@
paint.setXPFactory(GrDisableColorXPFactory::Make());
paint.setAntiAlias(args.fIsAA);
- this->internalDrawPath(args.fDrawContext, paint, &GrUserStencilSettings::kUnused, *args.fClip,
+ this->internalDrawPath(args.fDrawContext, paint, GrUserStencilSettings::kUnused, *args.fClip,
*args.fViewMatrix, *args.fShape, true);
}
diff --git a/src/gpu/batches/GrDefaultPathRenderer.h b/src/gpu/batches/GrDefaultPathRenderer.h
index abb5cc6..9ae23e4 100644
--- a/src/gpu/batches/GrDefaultPathRenderer.h
+++ b/src/gpu/batches/GrDefaultPathRenderer.h
@@ -32,7 +32,7 @@
bool internalDrawPath(GrDrawContext*,
const GrPaint&,
- const GrUserStencilSettings*,
+ const GrUserStencilSettings&,
const GrClip&,
const SkMatrix& viewMatrix,
const GrShape&,
diff --git a/src/gpu/batches/GrMSAAPathRenderer.cpp b/src/gpu/batches/GrMSAAPathRenderer.cpp
index 39b924c..ec54f32 100644
--- a/src/gpu/batches/GrMSAAPathRenderer.cpp
+++ b/src/gpu/batches/GrMSAAPathRenderer.cpp
@@ -558,7 +558,7 @@
bool GrMSAAPathRenderer::internalDrawPath(GrDrawContext* drawContext,
const GrPaint& paint,
- const GrUserStencilSettings* userStencilSettings,
+ const GrUserStencilSettings& userStencilSettings,
const GrClip& clip,
const SkMatrix& viewMatrix,
const GrShape& shape,
@@ -579,7 +579,7 @@
if (stencilOnly) {
passes[0] = &gDirectToStencil;
} else {
- passes[0] = userStencilSettings;
+ passes[0] = &userStencilSettings;
}
lastPassIsBounds = false;
} else {
@@ -699,7 +699,7 @@
}
return this->internalDrawPath(args.fDrawContext,
*args.fPaint,
- args.fUserStencilSettings,
+ *args.fUserStencilSettings,
*args.fClip,
*args.fViewMatrix,
*shape,
@@ -716,7 +716,7 @@
paint.setXPFactory(GrDisableColorXPFactory::Make());
paint.setAntiAlias(args.fIsAA);
- this->internalDrawPath(args.fDrawContext, paint, &GrUserStencilSettings::kUnused, *args.fClip,
+ this->internalDrawPath(args.fDrawContext, paint, GrUserStencilSettings::kUnused, *args.fClip,
*args.fViewMatrix, *args.fShape, true);
}
diff --git a/src/gpu/batches/GrMSAAPathRenderer.h b/src/gpu/batches/GrMSAAPathRenderer.h
index 9cb48ee..3bc4ee6 100644
--- a/src/gpu/batches/GrMSAAPathRenderer.h
+++ b/src/gpu/batches/GrMSAAPathRenderer.h
@@ -23,7 +23,7 @@
bool internalDrawPath(GrDrawContext*,
const GrPaint&,
- const GrUserStencilSettings*,
+ const GrUserStencilSettings&,
const GrClip&,
const SkMatrix& viewMatrix,
const GrShape&,
diff --git a/src/gpu/text/GrStencilAndCoverTextContext.cpp b/src/gpu/text/GrStencilAndCoverTextContext.cpp
index 381aa30..9cc0d7a 100644
--- a/src/gpu/text/GrStencilAndCoverTextContext.cpp
+++ b/src/gpu/text/GrStencilAndCoverTextContext.cpp
@@ -136,7 +136,8 @@
void GrStencilAndCoverTextContext::uncachedDrawTextBlob(GrContext* context,
GrDrawContext* dc,
- const GrClip& clip, const SkPaint& skPaint,
+ const GrClip& clip,
+ const SkPaint& skPaint,
const SkMatrix& viewMatrix,
const SkSurfaceProps& props,
const SkTextBlob* blob,