Don't call drawSimpleShape from drawShape

This can wait until drawShapeUsingPathRenderer.

Bug: chromium:1172543
Change-Id: I3217084f89125ee90f67907a2e045394cf8ae839
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/366147
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This commit is contained in:
Chris Dalton 2021-02-04 15:07:56 -07:00 committed by Skia Commit-Bot
parent 52bf4853c1
commit 9f704a8640
2 changed files with 6 additions and 14 deletions

View File

@ -1583,17 +1583,9 @@ void GrSurfaceDrawContext::drawShape(const GrClip* clip,
AutoCheckFlush acf(this->drawingManager());
// Always simplify the stroke for now. In the future we will give the tessellator a chance to
// claim strokes before trying to simplify them.
shape.simplifyStroke();
if (this->drawSimpleShape(clip, &paint, aa, viewMatrix, shape)) {
return;
}
// If we get here in drawShape(), we definitely need to use path rendering
this->drawShapeUsingPathRenderer(clip, std::move(paint), aa, viewMatrix, std::move(shape),
/* attemptDrawSimple */ false);
/* attemptDrawSimple */ true);
}
static SkIRect get_clip_bounds(const GrSurfaceDrawContext* rtc, const GrClip* clip) {
@ -1799,7 +1791,7 @@ void GrSurfaceDrawContext::drawShapeUsingPathRenderer(const GrClip* clip,
// claim strokes before trying to simplify them.
shape.simplifyStroke();
if (attemptDrawSimple && shape.simplified()) {
if (attemptDrawSimple || shape.simplified()) {
// Usually we enter drawShapeUsingPathRenderer() because the shape+style was too
// complex for dedicated draw ops. However, if GrStyledShape was able to reduce something
// we ought to try again instead of going right to path rendering.

View File

@ -713,11 +713,11 @@ private:
// we know how.
bool drawSimpleShape(const GrClip*, GrPaint*, GrAA, const SkMatrix&, const GrStyledShape&);
// If 'attemptDrawSimple' is true, and the original shape had been simplfied, this
// will attempt to re-route through drawSimpleShape() to see if we can avoid path rendering one
// more time.
// If 'attemptDrawSimple' is true, of if the original shape is marked as having been simplfied,
// this will attempt to re-route through drawSimpleShape() to see if we can avoid path rendering
// one more time.
void drawShapeUsingPathRenderer(const GrClip*, GrPaint&&, GrAA, const SkMatrix&,
GrStyledShape&&, bool attemptDrawSimple = true);
GrStyledShape&&, bool attemptDrawSimple = false);
// Makes a copy of the proxy if it is necessary for the draw and places the texture that should
// be used by GrXferProcessor to access the destination color in 'result'. If the return