Revert "Update GrRTC to use GrFillRectOp::MakeGeneric"

This reverts commit ffd4da3cd4.

Reason for revert: Likely breaking Adreno 405 bot

Original change's description:
> Update GrRTC to use GrFillRectOp::MakeGeneric
> 
> Change-Id: I4b137c545e726a49c7c5a64febdb83388f335e08
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215082
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I495da5181e71b98a280c53787e8e3279a5d7b162
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216281
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This commit is contained in:
Michael Ludwig 2019-05-27 15:47:01 +00:00 committed by Skia Commit-Bot
parent de7e074e81
commit dbddfff933

View File

@ -347,9 +347,8 @@ void GrRenderTargetContext::internalClear(const GrFixedClip& clip,
GrPaint paint;
clear_to_grpaint(color, &paint);
this->addDrawOp(GrFixedClip::Disabled(),
GrFillRectOp::MakeGeneric(fContext, std::move(paint),
GrAAType::kNone, GrQuadAAFlags::kNone,
GrPerspQuad(rtRect), GrPerspQuad(rtRect)));
GrFillRectOp::Make(fContext, std::move(paint),
GrAAType::kNone, SkMatrix::I(), rtRect));
} else {
this->getRTOpList()->addOp(GrClearOp::Make(fContext, SkIRect::MakeEmpty(), color,
/* fullscreen */ true), *this->caps());
@ -361,10 +360,8 @@ void GrRenderTargetContext::internalClear(const GrFixedClip& clip,
GrPaint paint;
clear_to_grpaint(color, &paint);
this->addDrawOp(clip,
GrFillRectOp::MakeGeneric(fContext, std::move(paint),
GrAAType::kNone, GrQuadAAFlags::kNone,
GrPerspQuad(scissor), GrPerspQuad(scissor)));
this->addDrawOp(clip, GrFillRectOp::Make(fContext, std::move(paint), GrAAType::kNone,
SkMatrix::I(), scissor));
} else {
std::unique_ptr<GrOp> op(GrClearOp::Make(fContext, clip, color,
this->asSurfaceProxy()));
@ -408,14 +405,16 @@ void GrRenderTargetContextPriv::absClear(const SkIRect* clearRect, const SkPMCol
if (fRenderTargetContext->caps()->performPartialClearsAsDraws()) {
GrPaint paint;
clear_to_grpaint(color, &paint);
GrPerspQuad clearQuad(SkRect::Make(rtRect));
// Use the disabled clip; the rect geometry already matches the clear rectangle and
// if it were added to a scissor, that would be intersected with the logical surface
// bounds and not the worst case dimensions required here.
fRenderTargetContext->addDrawOp(GrFixedClip::Disabled(),
GrFillRectOp::MakeGeneric(fRenderTargetContext->fContext, std::move(paint),
GrAAType::kNone, GrQuadAAFlags::kNone,
clearQuad, clearQuad));
GrFillRectOp::Make(fRenderTargetContext->fContext,
std::move(paint),
GrAAType::kNone,
SkMatrix::I(),
SkRect::Make(rtRect)));
} else {
// Must use the ClearOp factory that takes a boolean (false) instead of a surface
// proxy. The surface proxy variant would intersect the clip rect with its logical
@ -435,11 +434,12 @@ void GrRenderTargetContextPriv::absClear(const SkIRect* clearRect, const SkPMCol
// width and height like in internalClear().
GrPaint paint;
clear_to_grpaint(color, &paint);
GrPerspQuad clearQuad(SkRect::Make(rtRect));
fRenderTargetContext->addDrawOp(GrFixedClip::Disabled(),
GrFillRectOp::MakeGeneric(fRenderTargetContext->fContext, std::move(paint),
GrAAType::kNone, GrQuadAAFlags::kNone,
clearQuad, clearQuad));
GrFillRectOp::Make(fRenderTargetContext->fContext,
std::move(paint),
GrAAType::kNone,
SkMatrix::I(),
SkRect::Make(rtRect)));
} else {
// Nothing special about this path in absClear compared to internalClear()
fRenderTargetContext->getRTOpList()->addOp(
@ -501,9 +501,8 @@ void GrRenderTargetContext::drawPaint(const GrClip& clip,
}
AutoCheckFlush acf(this->drawingManager());
std::unique_ptr<GrDrawOp> op = GrFillRectOp::MakeGeneric(
fContext, std::move(paint), GrAAType::kNone, GrQuadAAFlags::kNone,
GrPerspQuad(r), GrPerspQuad::MakeFromRect(r, localMatrix));
std::unique_ptr<GrDrawOp> op = GrFillRectOp::MakeWithLocalMatrix(
fContext, std::move(paint), GrAAType::kNone, SkMatrix::I(), localMatrix, r);
this->addDrawOp(clip, std::move(op));
}
@ -698,8 +697,8 @@ bool GrRenderTargetContext::drawFilledRectAsClear(const GrClip& clip, GrPaint&&
aa = edgeFlags == GrQuadAAFlags::kNone ? GrAA::kNo : GrAA::kYes;
GrAAType aaType = this->chooseAAType(aa);
this->addDrawOp(GrFixedClip::Disabled(),
GrFillRectOp::MakeGeneric(fContext, std::move(paint), aaType, edgeFlags,
GrPerspQuad(combinedRect), GrPerspQuad(combinedRect)));
GrFillRectOp::MakePerEdge(fContext, std::move(paint), aaType, edgeFlags,
SkMatrix::I(), combinedRect));
return true;
}
@ -725,9 +724,8 @@ void GrRenderTargetContext::drawFilledRect(const GrClip& clip,
}
GrAAType aaType = this->chooseAAType(aa);
this->addDrawOp(clip, GrFillRectOp::MakeGeneric(fContext, std::move(paint), aaType,
aa == GrAA::kYes ? GrQuadAAFlags::kAll : GrQuadAAFlags::kNone,
GrPerspQuad::MakeFromRect(croppedRect, viewMatrix), GrPerspQuad(croppedRect), ss));
this->addDrawOp(clip, GrFillRectOp::Make(fContext, std::move(paint), aaType, viewMatrix,
croppedRect, ss));
}
void GrRenderTargetContext::drawRect(const GrClip& clip,
@ -835,14 +833,14 @@ void GrRenderTargetContext::internalStencilClear(const GrFixedClip& clip, bool i
// Configure the paint to have no impact on the color buffer
GrPaint paint;
paint.setXPFactory(GrDisableColorXPFactory::Get());
paint.setColor4f({0.f, 0.f, 0.f, 0.f});
paint.setPorterDuffXPFactory(SkBlendMode::kSrcOver);
// Mark stencil usage here before addDrawOp() so that it doesn't try to re-call
// internalStencilClear() just because the op has stencil settings.
this->setNeedsStencil();
GrPerspQuad clearRect(rtRect);
this->addDrawOp(clip, GrFillRectOp::MakeGeneric(fContext, std::move(paint), GrAAType::kNone,
GrQuadAAFlags::kNone, clearRect, clearRect, ss));
this->addDrawOp(clip, GrFillRectOp::Make(fContext, std::move(paint),
GrAAType::kNone, SkMatrix::I(), rtRect, ss));
} else {
std::unique_ptr<GrOp> op(GrClearStencilClipOp::Make(fContext, clip, insideStencilMask,
fRenderTargetProxy.get()));
@ -910,9 +908,8 @@ void GrRenderTargetContextPriv::stencilRect(const GrHardClip& clip,
GrPaint paint;
paint.setXPFactory(GrDisableColorXPFactory::Get());
auto aaType = (GrAA::kYes == doStencilMSAA) ? GrAAType::kMSAA : GrAAType::kNone;
std::unique_ptr<GrDrawOp> op = GrFillRectOp::MakeGeneric(
fRenderTargetContext->fContext, std::move(paint), aaType, GrQuadAAFlags::kNone,
GrPerspQuad::MakeFromRect(rect, viewMatrix), GrPerspQuad(rect), ss);
std::unique_ptr<GrDrawOp> op = GrFillRectOp::Make(
fRenderTargetContext->fContext, std::move(paint), aaType, viewMatrix, rect, ss);
fRenderTargetContext->addDrawOp(clip, std::move(op));
}
@ -959,9 +956,8 @@ void GrRenderTargetContext::fillRectWithEdgeAA(const GrClip& clip, GrPaint&& pai
&croppedLocalRect)) {
return;
}
op = GrFillRectOp::MakeGeneric(fContext, std::move(paint), aaType, edgeAA,
GrPerspQuad::MakeFromRect(croppedRect, viewMatrix),
GrPerspQuad(croppedLocalRect));
op = GrFillRectOp::MakePerEdgeWithLocalRect(fContext, std::move(paint), aaType, edgeAA,
viewMatrix, croppedRect, croppedLocalRect);
} else {
// If aaType turns into MSAA, make sure to keep quads with no AA edges as MSAA. Sending
// those to drawFilledRect() would have it turn off MSAA in that case, which breaks seaming
@ -979,8 +975,8 @@ void GrRenderTargetContext::fillRectWithEdgeAA(const GrClip& clip, GrPaint&& pai
if (!crop_filled_rect(this->width(), this->height(), clip, viewMatrix, &croppedRect)) {
return;
}
op = GrFillRectOp::MakeGeneric(fContext, std::move(paint), aaType, edgeAA,
GrPerspQuad::MakeFromRect(croppedRect, viewMatrix), GrPerspQuad(croppedRect));
op = GrFillRectOp::MakePerEdge(fContext, std::move(paint), aaType, edgeAA, viewMatrix,
croppedRect);
}
AutoCheckFlush acf(this->drawingManager());
@ -998,10 +994,9 @@ void GrRenderTargetContext::fillQuadWithEdgeAA(const GrClip& clip, GrPaint&& pai
GrAAType aaType = this->chooseAAType(aa);
AutoCheckFlush acf(this->drawingManager());
const SkPoint* localPoints = localQuad ? localQuad : quad;
this->addDrawOp(clip, GrFillRectOp::MakeGeneric(fContext, std::move(paint), aaType, edgeAA,
GrPerspQuad::MakeFromSkQuad(quad, viewMatrix),
GrPerspQuad::MakeFromSkQuad(localPoints, SkMatrix::I())));
// MakePerEdgeQuad automatically does the right thing if localQuad is null or not
this->addDrawOp(clip, GrFillRectOp::MakePerEdgeQuad(fContext, std::move(paint), aaType, edgeAA,
viewMatrix, quad, localQuad));
}
// Creates a paint for GrFillRectOp that matches behavior of GrTextureOp
@ -1067,8 +1062,8 @@ void GrRenderTargetContext::drawTexture(const GrClip& clip, sk_sp<GrTextureProxy
draw_texture_to_grpaint(std::move(proxy),
constraint == SkCanvas::kStrict_SrcRectConstraint ? &srcRect : nullptr,
filter, mode, color, std::move(textureColorSpaceXform), &paint);
op = GrFillRectOp::MakeGeneric(fContext, std::move(paint), aaType, aaFlags,
GrPerspQuad::MakeFromRect(clippedDstRect, viewMatrix), GrPerspQuad(clippedSrcRect));
op = GrFillRectOp::MakePerEdgeWithLocalRect(fContext, std::move(paint), aaType, aaFlags,
viewMatrix, clippedDstRect, clippedSrcRect);
} else {
// Can use a lighter weight op that can chain across proxies
op = GrTextureOp::Make(fContext, std::move(proxy), filter, color, clippedSrcRect,
@ -1106,9 +1101,8 @@ void GrRenderTargetContext::drawTextureQuad(const GrClip& clip, sk_sp<GrTextureP
GrPaint paint;
draw_texture_to_grpaint(
std::move(proxy), domain, filter, mode, color, std::move(texXform), &paint);
op = GrFillRectOp::MakeGeneric(fContext, std::move(paint), aaType, aaFlags,
GrPerspQuad::MakeFromSkQuad(dstQuad, viewMatrix),
GrPerspQuad::MakeFromSkQuad(srcQuad, SkMatrix::I()));
op = GrFillRectOp::MakePerEdgeQuad(fContext, std::move(paint), aaType, aaFlags, viewMatrix,
dstQuad, srcQuad);
} else {
// Use lighter weight GrTextureOp
op = GrTextureOp::MakeQuad(fContext, std::move(proxy), filter, color, srcQuad, dstQuad,
@ -1185,10 +1179,8 @@ void GrRenderTargetContext::fillRectWithLocalMatrix(const GrClip& clip,
AutoCheckFlush acf(this->drawingManager());
GrAAType aaType = this->chooseAAType(aa);
this->addDrawOp(clip, GrFillRectOp::MakeGeneric(fContext, std::move(paint), aaType,
aa == GrAA::kYes ? GrQuadAAFlags::kAll : GrQuadAAFlags::kNone,
GrPerspQuad::MakeFromRect(rectToDraw, viewMatrix),
GrPerspQuad::MakeFromRect(rectToDraw, localMatrix)));
this->addDrawOp(clip, GrFillRectOp::MakeWithLocalMatrix(fContext, std::move(paint), aaType,
viewMatrix, localMatrix, croppedRect));
}
void GrRenderTargetContext::drawVertices(const GrClip& clip,