Fix setShadowLayer + drawTextOnPath
Bug: 140255441 Test: I49c468b0f4cc142e5d6b03f0aee917b3d85153f3 Fix two issues that prevented this combination from working: - make() the SkTextBlob once and reuse it for each iteration of the loop. This is necessary because make() resets the SkTextBlobBuilder, so a second call does nothing. - use the altered SkPaint, passed as a parameter to the lambda, rather than the Paint passed to apply_looper. Incidentally, reference mCanvas directly like the other methods, rather than calling asSkCanvas(), which returns mCanvas. Change-Id: I48ea1232b12df4f5f8afffc20c7dc8e5dc2bb511
This commit is contained in:
committed by
Leon Scroggins
parent
a9eec3d8ed
commit
950f2aa825
@@ -789,9 +789,11 @@ void SkiaCanvas::drawLayoutOnPath(const minikin::Layout& layout, float hOffset,
|
||||
xform[i - start].fTx = pos.x() - tan.y() * y - halfWidth * tan.x();
|
||||
xform[i - start].fTy = pos.y() + tan.x() * y - halfWidth * tan.y();
|
||||
}
|
||||
auto* finalCanvas = this->asSkCanvas();
|
||||
|
||||
sk_sp<SkTextBlob> textBlob(builder.make());
|
||||
|
||||
apply_looper(&paintCopy, [&](const SkPaint& p) {
|
||||
finalCanvas->drawTextBlob(builder.make(), 0, 0, paintCopy);
|
||||
mCanvas->drawTextBlob(textBlob, 0, 0, p);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user