summaryrefslogtreecommitdiff
path: root/libs/hwui/SkiaCanvas.cpp
diff options
context:
space:
mode:
author Leon Scroggins III <scroggo@google.com> 2020-04-29 13:46:00 -0400
committer Leon Scroggins <scroggo@google.com> 2020-05-01 15:38:26 +0000
commit950f2aa8258e35a8d65e538c3c1da39005f3dd0e (patch)
treef54b3190b8f687b9b08ed6ec3c0e7d95c20ddc4d /libs/hwui/SkiaCanvas.cpp
parenta9eec3d8ed4385ff515f37d30c16b04484a0a2f5 (diff)
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
Diffstat (limited to 'libs/hwui/SkiaCanvas.cpp')
-rw-r--r--libs/hwui/SkiaCanvas.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/hwui/SkiaCanvas.cpp b/libs/hwui/SkiaCanvas.cpp
index 5790150a3425..941437998838 100644
--- a/libs/hwui/SkiaCanvas.cpp
+++ b/libs/hwui/SkiaCanvas.cpp
@@ -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);
});
}