aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-07-21 08:55:08 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-21 08:55:08 -0700
commitd2b6d6486ed9d00df779f6b337d756c9a818006f (patch)
tree42dec09e869f89f94a3085844942e403bc0f34f4 /src/gpu
parent7b33bf1d2a8664235a9eb372024641d2da1a0dad (diff)
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
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrSWMaskHelper.cpp4
-rw-r--r--src/gpu/GrSWMaskHelper.h2
-rw-r--r--src/gpu/GrSoftwarePathRenderer.cpp14
-rw-r--r--src/gpu/GrSoftwarePathRenderer.h4
-rw-r--r--src/gpu/batches/GrDefaultPathRenderer.cpp10
-rw-r--r--src/gpu/batches/GrDefaultPathRenderer.h2
-rw-r--r--src/gpu/batches/GrMSAAPathRenderer.cpp8
-rw-r--r--src/gpu/batches/GrMSAAPathRenderer.h2
-rw-r--r--src/gpu/text/GrStencilAndCoverTextContext.cpp3
9 files changed, 25 insertions, 24 deletions
diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp
index b966264789..66d60ab956 100644
--- a/src/gpu/GrSWMaskHelper.cpp
+++ b/src/gpu/GrSWMaskHelper.cpp
@@ -160,7 +160,7 @@ GrTexture* GrSWMaskHelper::DrawShapeMaskToTexture(GrTextureProvider* texProvider
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 @@ void GrSWMaskHelper::DrawToTargetWithShapeMask(GrTexture* texture,
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 ab88b8d6b9..6d1d9b1d46 100644
--- a/src/gpu/GrSWMaskHelper.h
+++ b/src/gpu/GrSWMaskHelper.h
@@ -87,7 +87,7 @@ public:
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 54d4851b1c..87b0926a8c 100644
--- a/src/gpu/GrSoftwarePathRenderer.cpp
+++ b/src/gpu/GrSoftwarePathRenderer.cpp
@@ -63,7 +63,7 @@ bool get_shape_and_clip_bounds(int width, int height,
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 @@ void GrSoftwarePathRenderer::DrawNonAARect(GrDrawContext* drawContext,
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 @@ bool GrSoftwarePathRenderer::onDrawPath(const DrawPathArgs& args) {
*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 @@ bool GrSoftwarePathRenderer::onDrawPath(const DrawPathArgs& args) {
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 f488cbdceb..1548fa69c0 100644
--- a/src/gpu/GrSoftwarePathRenderer.h
+++ b/src/gpu/GrSoftwarePathRenderer.h
@@ -22,14 +22,14 @@ public:
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 dc40b7c611..8e733d025f 100644
--- a/src/gpu/batches/GrDefaultPathRenderer.cpp
+++ b/src/gpu/batches/GrDefaultPathRenderer.cpp
@@ -413,7 +413,7 @@ private:
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 @@ bool GrDefaultPathRenderer::internalDrawPath(GrDrawContext* drawContext,
if (stencilOnly) {
passes[0] = &gDirectToStencil;
} else {
- passes[0] = userStencilSettings;
+ passes[0] = &userStencilSettings;
}
lastPassIsBounds = false;
drawFace[0] = GrPipelineBuilder::kBoth_DrawFace;
@@ -452,7 +452,7 @@ bool GrDefaultPathRenderer::internalDrawPath(GrDrawContext* drawContext,
if (stencilOnly) {
passes[0] = &gDirectToStencil;
} else {
- passes[0] = userStencilSettings;
+ passes[0] = &userStencilSettings;
}
drawFace[0] = GrPipelineBuilder::kBoth_DrawFace;
lastPassIsBounds = false;
@@ -591,7 +591,7 @@ bool GrDefaultPathRenderer::onDrawPath(const DrawPathArgs& args) {
"GrDefaultPathRenderer::onDrawPath");
return this->internalDrawPath(args.fDrawContext,
*args.fPaint,
- args.fUserStencilSettings,
+ *args.fUserStencilSettings,
*args.fClip,
*args.fViewMatrix,
*args.fShape,
@@ -607,7 +607,7 @@ void GrDefaultPathRenderer::onStencilPath(const StencilPathArgs& args) {
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 abb5cc687a..9ae23e48d9 100644
--- a/src/gpu/batches/GrDefaultPathRenderer.h
+++ b/src/gpu/batches/GrDefaultPathRenderer.h
@@ -32,7 +32,7 @@ private:
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 39b924c1b6..ec54f320de 100644
--- a/src/gpu/batches/GrMSAAPathRenderer.cpp
+++ b/src/gpu/batches/GrMSAAPathRenderer.cpp
@@ -558,7 +558,7 @@ private:
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 @@ bool GrMSAAPathRenderer::internalDrawPath(GrDrawContext* drawContext,
if (stencilOnly) {
passes[0] = &gDirectToStencil;
} else {
- passes[0] = userStencilSettings;
+ passes[0] = &userStencilSettings;
}
lastPassIsBounds = false;
} else {
@@ -699,7 +699,7 @@ bool GrMSAAPathRenderer::onDrawPath(const DrawPathArgs& args) {
}
return this->internalDrawPath(args.fDrawContext,
*args.fPaint,
- args.fUserStencilSettings,
+ *args.fUserStencilSettings,
*args.fClip,
*args.fViewMatrix,
*shape,
@@ -716,7 +716,7 @@ void GrMSAAPathRenderer::onStencilPath(const StencilPathArgs& args) {
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 9cb48eeb4a..3bc4ee6f7b 100644
--- a/src/gpu/batches/GrMSAAPathRenderer.h
+++ b/src/gpu/batches/GrMSAAPathRenderer.h
@@ -23,7 +23,7 @@ private:
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 381aa30282..9cc0d7acb8 100644
--- a/src/gpu/text/GrStencilAndCoverTextContext.cpp
+++ b/src/gpu/text/GrStencilAndCoverTextContext.cpp
@@ -136,7 +136,8 @@ void GrStencilAndCoverTextContext::drawPosText(GrContext* context, GrDrawContext
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,