Check rejects exist before attempting drawables.
Change-Id: I64b8a1e9da3351080bcc13eb490ec534c9d21eed Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505797 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
This commit is contained in:
parent
61e7b64962
commit
654f09a5ad
@ -147,21 +147,23 @@ void SkGlyphRunListPainter::drawForBitmapDevice(
|
||||
}
|
||||
}
|
||||
|
||||
fAccepted.startSource(fRejected.source());
|
||||
strike->prepareForDrawableDrawing(&fAccepted, &fRejected);
|
||||
fRejected.flipRejectsToSource();
|
||||
if (!fRejected.source().empty()) {
|
||||
fAccepted.startSource(fRejected.source());
|
||||
strike->prepareForDrawableDrawing(&fAccepted, &fRejected);
|
||||
fRejected.flipRejectsToSource();
|
||||
|
||||
for (auto [variant, pos] : fAccepted.accepted()) {
|
||||
SkDrawable* drawable = variant.drawable();
|
||||
SkMatrix m;
|
||||
SkPoint translate = drawOrigin + pos;
|
||||
m.setScaleTranslate(strikeToSourceScale, strikeToSourceScale,
|
||||
translate.x(), translate.y());
|
||||
SkAutoCanvasRestore acr(canvas, false);
|
||||
SkRect drawableBounds = drawable->getBounds();
|
||||
m.mapRect(&drawableBounds);
|
||||
canvas->saveLayer(&drawableBounds, &paint);
|
||||
drawable->draw(canvas, &m);
|
||||
for (auto [variant, pos] : fAccepted.accepted()) {
|
||||
SkDrawable* drawable = variant.drawable();
|
||||
SkMatrix m;
|
||||
SkPoint translate = drawOrigin + pos;
|
||||
m.setScaleTranslate(strikeToSourceScale, strikeToSourceScale,
|
||||
translate.x(), translate.y());
|
||||
SkAutoCanvasRestore acr(canvas, false);
|
||||
SkRect drawableBounds = drawable->getBounds();
|
||||
m.mapRect(&drawableBounds);
|
||||
canvas->saveLayer(&drawableBounds, &paint);
|
||||
drawable->draw(canvas, &m);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!fRejected.source().empty() && !deviceMatrix.hasPerspective()) {
|
||||
|
Loading…
Reference in New Issue
Block a user