simplify how we call apply
Bug: skia: Change-Id: I16dd773812a63da7e565f610fe7a243a88e482d8 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228575 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com> Auto-Submit: Mike Reed <reed@google.com>
This commit is contained in:
parent
056bdda97a
commit
c9f0c593ed
@ -252,21 +252,13 @@ protected:
|
|||||||
|
|
||||||
int y = 0;
|
int y = 0;
|
||||||
for (int looper = 0; looper < fLoopers.count(); looper++) {
|
for (int looper = 0; looper < fLoopers.count(); looper++) {
|
||||||
if (0) {
|
SkTextBlob* b = fBlob.get();
|
||||||
paint.setLooper(fLoopers[looper]);
|
canvas->save();
|
||||||
canvas->save();
|
canvas->translate(0, SkIntToScalar(y));
|
||||||
canvas->translate(0, SkIntToScalar(y));
|
fLoopers[looper]->apply(canvas, paint, [b](SkCanvas* c, const SkPaint& p) {
|
||||||
canvas->drawTextBlob(fBlob, 0, 0, paint);
|
c->drawTextBlob(b, 0, 0, p);
|
||||||
canvas->restore();
|
});
|
||||||
} else {
|
canvas->restore();
|
||||||
auto b = fBlob;
|
|
||||||
fLoopers[looper]->apply(canvas, paint, [b, y](SkCanvas* c, const SkPaint& p) {
|
|
||||||
c->save();
|
|
||||||
c->translate(0, SkIntToScalar(y));
|
|
||||||
c->drawTextBlob(b, 0, 0, p);
|
|
||||||
c->restore();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
y += SkScalarFloorToInt(bounds.height());
|
y += SkScalarFloorToInt(bounds.height());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user