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
This commit is contained in:
parent
7b33bf1d2a
commit
d2b6d6486e
@ -160,7 +160,7 @@ GrTexture* GrSWMaskHelper::DrawShapeMaskToTexture(GrTextureProvider* texProvider
|
|||||||
void GrSWMaskHelper::DrawToTargetWithShapeMask(GrTexture* texture,
|
void GrSWMaskHelper::DrawToTargetWithShapeMask(GrTexture* texture,
|
||||||
GrDrawContext* drawContext,
|
GrDrawContext* drawContext,
|
||||||
const GrPaint& paint,
|
const GrPaint& paint,
|
||||||
const GrUserStencilSettings* userStencilSettings,
|
const GrUserStencilSettings& userStencilSettings,
|
||||||
const GrClip& clip,
|
const GrClip& clip,
|
||||||
const SkMatrix& viewMatrix,
|
const SkMatrix& viewMatrix,
|
||||||
const SkIRect& rect) {
|
const SkIRect& rect) {
|
||||||
@ -182,7 +182,7 @@ void GrSWMaskHelper::DrawToTargetWithShapeMask(GrTexture* texture,
|
|||||||
maskMatrix.preTranslate(SkIntToScalar(-rect.fLeft), SkIntToScalar(-rect.fTop));
|
maskMatrix.preTranslate(SkIntToScalar(-rect.fLeft), SkIntToScalar(-rect.fTop));
|
||||||
|
|
||||||
GrPipelineBuilder pipelineBuilder(paint, drawContext->mustUseHWAA(paint));
|
GrPipelineBuilder pipelineBuilder(paint, drawContext->mustUseHWAA(paint));
|
||||||
pipelineBuilder.setUserStencil(userStencilSettings);
|
pipelineBuilder.setUserStencil(&userStencilSettings);
|
||||||
|
|
||||||
pipelineBuilder.addCoverageFragmentProcessor(
|
pipelineBuilder.addCoverageFragmentProcessor(
|
||||||
GrSimpleTextureEffect::Make(texture,
|
GrSimpleTextureEffect::Make(texture,
|
||||||
|
@ -87,7 +87,7 @@ public:
|
|||||||
static void DrawToTargetWithShapeMask(GrTexture* texture,
|
static void DrawToTargetWithShapeMask(GrTexture* texture,
|
||||||
GrDrawContext*,
|
GrDrawContext*,
|
||||||
const GrPaint& paint,
|
const GrPaint& paint,
|
||||||
const GrUserStencilSettings* userStencilSettings,
|
const GrUserStencilSettings& userStencilSettings,
|
||||||
const GrClip&,
|
const GrClip&,
|
||||||
const SkMatrix& viewMatrix,
|
const SkMatrix& viewMatrix,
|
||||||
const SkIRect& rect);
|
const SkIRect& rect);
|
||||||
|
@ -63,7 +63,7 @@ bool get_shape_and_clip_bounds(int width, int height,
|
|||||||
|
|
||||||
void GrSoftwarePathRenderer::DrawNonAARect(GrDrawContext* drawContext,
|
void GrSoftwarePathRenderer::DrawNonAARect(GrDrawContext* drawContext,
|
||||||
const GrPaint& paint,
|
const GrPaint& paint,
|
||||||
const GrUserStencilSettings* userStencilSettings,
|
const GrUserStencilSettings& userStencilSettings,
|
||||||
const GrClip& clip,
|
const GrClip& clip,
|
||||||
const SkMatrix& viewMatrix,
|
const SkMatrix& viewMatrix,
|
||||||
const SkRect& rect,
|
const SkRect& rect,
|
||||||
@ -73,14 +73,14 @@ void GrSoftwarePathRenderer::DrawNonAARect(GrDrawContext* drawContext,
|
|||||||
nullptr, &localMatrix));
|
nullptr, &localMatrix));
|
||||||
|
|
||||||
GrPipelineBuilder pipelineBuilder(paint, drawContext->mustUseHWAA(paint));
|
GrPipelineBuilder pipelineBuilder(paint, drawContext->mustUseHWAA(paint));
|
||||||
pipelineBuilder.setUserStencil(userStencilSettings);
|
pipelineBuilder.setUserStencil(&userStencilSettings);
|
||||||
|
|
||||||
drawContext->drawBatch(pipelineBuilder, clip, batch);
|
drawContext->drawBatch(pipelineBuilder, clip, batch);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrSoftwarePathRenderer::DrawAroundInvPath(GrDrawContext* drawContext,
|
void GrSoftwarePathRenderer::DrawAroundInvPath(GrDrawContext* drawContext,
|
||||||
const GrPaint& paint,
|
const GrPaint& paint,
|
||||||
const GrUserStencilSettings* userStencilSettings,
|
const GrUserStencilSettings& userStencilSettings,
|
||||||
const GrClip& clip,
|
const GrClip& clip,
|
||||||
const SkMatrix& viewMatrix,
|
const SkMatrix& viewMatrix,
|
||||||
const SkIRect& devClipBounds,
|
const SkIRect& devClipBounds,
|
||||||
@ -137,7 +137,7 @@ bool GrSoftwarePathRenderer::onDrawPath(const DrawPathArgs& args) {
|
|||||||
*args.fClip, *args.fShape,
|
*args.fClip, *args.fShape,
|
||||||
*args.fViewMatrix, &devShapeBounds, &devClipBounds)) {
|
*args.fViewMatrix, &devShapeBounds, &devClipBounds)) {
|
||||||
if (inverseFilled) {
|
if (inverseFilled) {
|
||||||
DrawAroundInvPath(args.fDrawContext, *args.fPaint, args.fUserStencilSettings,
|
DrawAroundInvPath(args.fDrawContext, *args.fPaint, *args.fUserStencilSettings,
|
||||||
*args.fClip,
|
*args.fClip,
|
||||||
*args.fViewMatrix, devClipBounds, devShapeBounds);
|
*args.fViewMatrix, devClipBounds, devShapeBounds);
|
||||||
|
|
||||||
@ -148,17 +148,17 @@ bool GrSoftwarePathRenderer::onDrawPath(const DrawPathArgs& args) {
|
|||||||
SkAutoTUnref<GrTexture> texture(
|
SkAutoTUnref<GrTexture> texture(
|
||||||
GrSWMaskHelper::DrawShapeMaskToTexture(fTexProvider, *args.fShape, devShapeBounds,
|
GrSWMaskHelper::DrawShapeMaskToTexture(fTexProvider, *args.fShape, devShapeBounds,
|
||||||
args.fAntiAlias, args.fViewMatrix));
|
args.fAntiAlias, args.fViewMatrix));
|
||||||
if (nullptr == texture) {
|
if (!texture) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
GrSWMaskHelper::DrawToTargetWithShapeMask(texture, args.fDrawContext, *args.fPaint,
|
GrSWMaskHelper::DrawToTargetWithShapeMask(texture, args.fDrawContext, *args.fPaint,
|
||||||
args.fUserStencilSettings,
|
*args.fUserStencilSettings,
|
||||||
*args.fClip, *args.fViewMatrix,
|
*args.fClip, *args.fViewMatrix,
|
||||||
devShapeBounds);
|
devShapeBounds);
|
||||||
|
|
||||||
if (inverseFilled) {
|
if (inverseFilled) {
|
||||||
DrawAroundInvPath(args.fDrawContext, *args.fPaint, args.fUserStencilSettings,
|
DrawAroundInvPath(args.fDrawContext, *args.fPaint, *args.fUserStencilSettings,
|
||||||
*args.fClip,
|
*args.fClip,
|
||||||
*args.fViewMatrix, devClipBounds, devShapeBounds);
|
*args.fViewMatrix, devClipBounds, devShapeBounds);
|
||||||
}
|
}
|
||||||
|
@ -22,14 +22,14 @@ public:
|
|||||||
private:
|
private:
|
||||||
static void DrawNonAARect(GrDrawContext* drawContext,
|
static void DrawNonAARect(GrDrawContext* drawContext,
|
||||||
const GrPaint& paint,
|
const GrPaint& paint,
|
||||||
const GrUserStencilSettings* userStencilSettings,
|
const GrUserStencilSettings& userStencilSettings,
|
||||||
const GrClip& clip,
|
const GrClip& clip,
|
||||||
const SkMatrix& viewMatrix,
|
const SkMatrix& viewMatrix,
|
||||||
const SkRect& rect,
|
const SkRect& rect,
|
||||||
const SkMatrix& localMatrix);
|
const SkMatrix& localMatrix);
|
||||||
static void DrawAroundInvPath(GrDrawContext* drawContext,
|
static void DrawAroundInvPath(GrDrawContext* drawContext,
|
||||||
const GrPaint& paint,
|
const GrPaint& paint,
|
||||||
const GrUserStencilSettings* userStencilSettings,
|
const GrUserStencilSettings& userStencilSettings,
|
||||||
const GrClip& clip,
|
const GrClip& clip,
|
||||||
const SkMatrix& viewMatrix,
|
const SkMatrix& viewMatrix,
|
||||||
const SkIRect& devClipBounds,
|
const SkIRect& devClipBounds,
|
||||||
|
@ -413,7 +413,7 @@ private:
|
|||||||
|
|
||||||
bool GrDefaultPathRenderer::internalDrawPath(GrDrawContext* drawContext,
|
bool GrDefaultPathRenderer::internalDrawPath(GrDrawContext* drawContext,
|
||||||
const GrPaint& paint,
|
const GrPaint& paint,
|
||||||
const GrUserStencilSettings* userStencilSettings,
|
const GrUserStencilSettings& userStencilSettings,
|
||||||
const GrClip& clip,
|
const GrClip& clip,
|
||||||
const SkMatrix& viewMatrix,
|
const SkMatrix& viewMatrix,
|
||||||
const GrShape& shape,
|
const GrShape& shape,
|
||||||
@ -442,7 +442,7 @@ bool GrDefaultPathRenderer::internalDrawPath(GrDrawContext* drawContext,
|
|||||||
if (stencilOnly) {
|
if (stencilOnly) {
|
||||||
passes[0] = &gDirectToStencil;
|
passes[0] = &gDirectToStencil;
|
||||||
} else {
|
} else {
|
||||||
passes[0] = userStencilSettings;
|
passes[0] = &userStencilSettings;
|
||||||
}
|
}
|
||||||
lastPassIsBounds = false;
|
lastPassIsBounds = false;
|
||||||
drawFace[0] = GrPipelineBuilder::kBoth_DrawFace;
|
drawFace[0] = GrPipelineBuilder::kBoth_DrawFace;
|
||||||
@ -452,7 +452,7 @@ bool GrDefaultPathRenderer::internalDrawPath(GrDrawContext* drawContext,
|
|||||||
if (stencilOnly) {
|
if (stencilOnly) {
|
||||||
passes[0] = &gDirectToStencil;
|
passes[0] = &gDirectToStencil;
|
||||||
} else {
|
} else {
|
||||||
passes[0] = userStencilSettings;
|
passes[0] = &userStencilSettings;
|
||||||
}
|
}
|
||||||
drawFace[0] = GrPipelineBuilder::kBoth_DrawFace;
|
drawFace[0] = GrPipelineBuilder::kBoth_DrawFace;
|
||||||
lastPassIsBounds = false;
|
lastPassIsBounds = false;
|
||||||
@ -591,7 +591,7 @@ bool GrDefaultPathRenderer::onDrawPath(const DrawPathArgs& args) {
|
|||||||
"GrDefaultPathRenderer::onDrawPath");
|
"GrDefaultPathRenderer::onDrawPath");
|
||||||
return this->internalDrawPath(args.fDrawContext,
|
return this->internalDrawPath(args.fDrawContext,
|
||||||
*args.fPaint,
|
*args.fPaint,
|
||||||
args.fUserStencilSettings,
|
*args.fUserStencilSettings,
|
||||||
*args.fClip,
|
*args.fClip,
|
||||||
*args.fViewMatrix,
|
*args.fViewMatrix,
|
||||||
*args.fShape,
|
*args.fShape,
|
||||||
@ -607,7 +607,7 @@ void GrDefaultPathRenderer::onStencilPath(const StencilPathArgs& args) {
|
|||||||
paint.setXPFactory(GrDisableColorXPFactory::Make());
|
paint.setXPFactory(GrDisableColorXPFactory::Make());
|
||||||
paint.setAntiAlias(args.fIsAA);
|
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);
|
*args.fViewMatrix, *args.fShape, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ private:
|
|||||||
|
|
||||||
bool internalDrawPath(GrDrawContext*,
|
bool internalDrawPath(GrDrawContext*,
|
||||||
const GrPaint&,
|
const GrPaint&,
|
||||||
const GrUserStencilSettings*,
|
const GrUserStencilSettings&,
|
||||||
const GrClip&,
|
const GrClip&,
|
||||||
const SkMatrix& viewMatrix,
|
const SkMatrix& viewMatrix,
|
||||||
const GrShape&,
|
const GrShape&,
|
||||||
|
@ -558,7 +558,7 @@ private:
|
|||||||
|
|
||||||
bool GrMSAAPathRenderer::internalDrawPath(GrDrawContext* drawContext,
|
bool GrMSAAPathRenderer::internalDrawPath(GrDrawContext* drawContext,
|
||||||
const GrPaint& paint,
|
const GrPaint& paint,
|
||||||
const GrUserStencilSettings* userStencilSettings,
|
const GrUserStencilSettings& userStencilSettings,
|
||||||
const GrClip& clip,
|
const GrClip& clip,
|
||||||
const SkMatrix& viewMatrix,
|
const SkMatrix& viewMatrix,
|
||||||
const GrShape& shape,
|
const GrShape& shape,
|
||||||
@ -579,7 +579,7 @@ bool GrMSAAPathRenderer::internalDrawPath(GrDrawContext* drawContext,
|
|||||||
if (stencilOnly) {
|
if (stencilOnly) {
|
||||||
passes[0] = &gDirectToStencil;
|
passes[0] = &gDirectToStencil;
|
||||||
} else {
|
} else {
|
||||||
passes[0] = userStencilSettings;
|
passes[0] = &userStencilSettings;
|
||||||
}
|
}
|
||||||
lastPassIsBounds = false;
|
lastPassIsBounds = false;
|
||||||
} else {
|
} else {
|
||||||
@ -699,7 +699,7 @@ bool GrMSAAPathRenderer::onDrawPath(const DrawPathArgs& args) {
|
|||||||
}
|
}
|
||||||
return this->internalDrawPath(args.fDrawContext,
|
return this->internalDrawPath(args.fDrawContext,
|
||||||
*args.fPaint,
|
*args.fPaint,
|
||||||
args.fUserStencilSettings,
|
*args.fUserStencilSettings,
|
||||||
*args.fClip,
|
*args.fClip,
|
||||||
*args.fViewMatrix,
|
*args.fViewMatrix,
|
||||||
*shape,
|
*shape,
|
||||||
@ -716,7 +716,7 @@ void GrMSAAPathRenderer::onStencilPath(const StencilPathArgs& args) {
|
|||||||
paint.setXPFactory(GrDisableColorXPFactory::Make());
|
paint.setXPFactory(GrDisableColorXPFactory::Make());
|
||||||
paint.setAntiAlias(args.fIsAA);
|
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);
|
*args.fViewMatrix, *args.fShape, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ private:
|
|||||||
|
|
||||||
bool internalDrawPath(GrDrawContext*,
|
bool internalDrawPath(GrDrawContext*,
|
||||||
const GrPaint&,
|
const GrPaint&,
|
||||||
const GrUserStencilSettings*,
|
const GrUserStencilSettings&,
|
||||||
const GrClip&,
|
const GrClip&,
|
||||||
const SkMatrix& viewMatrix,
|
const SkMatrix& viewMatrix,
|
||||||
const GrShape&,
|
const GrShape&,
|
||||||
|
@ -136,7 +136,8 @@ void GrStencilAndCoverTextContext::drawPosText(GrContext* context, GrDrawContext
|
|||||||
|
|
||||||
void GrStencilAndCoverTextContext::uncachedDrawTextBlob(GrContext* context,
|
void GrStencilAndCoverTextContext::uncachedDrawTextBlob(GrContext* context,
|
||||||
GrDrawContext* dc,
|
GrDrawContext* dc,
|
||||||
const GrClip& clip, const SkPaint& skPaint,
|
const GrClip& clip,
|
||||||
|
const SkPaint& skPaint,
|
||||||
const SkMatrix& viewMatrix,
|
const SkMatrix& viewMatrix,
|
||||||
const SkSurfaceProps& props,
|
const SkSurfaceProps& props,
|
||||||
const SkTextBlob* blob,
|
const SkTextBlob* blob,
|
||||||
|
Loading…
Reference in New Issue
Block a user