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,
|
||||
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,
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ private:
|
||||
|
||||
bool internalDrawPath(GrDrawContext*,
|
||||
const GrPaint&,
|
||||
const GrUserStencilSettings*,
|
||||
const GrUserStencilSettings&,
|
||||
const GrClip&,
|
||||
const SkMatrix& viewMatrix,
|
||||
const GrShape&,
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ private:
|
||||
|
||||
bool internalDrawPath(GrDrawContext*,
|
||||
const GrPaint&,
|
||||
const GrUserStencilSettings*,
|
||||
const GrUserStencilSettings&,
|
||||
const GrClip&,
|
||||
const SkMatrix& viewMatrix,
|
||||
const GrShape&,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user