Clean up handling of lambda capture to use refs correctly
Change-Id: I7f52f46ba8ddb683ab7c156a88d8a7257a5f051b
Reviewed-on: https://skia-review.googlesource.com/c/174041
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
diff --git a/src/core/SkGlyphRunPainter.cpp b/src/core/SkGlyphRunPainter.cpp
index db8c31a..7c7fcd6 100644
--- a/src/core/SkGlyphRunPainter.cpp
+++ b/src/core/SkGlyphRunPainter.cpp
@@ -733,7 +733,7 @@
auto perEmpty = [](const SkGlyph&, SkPoint) {};
auto perSDF =
- [this, run, &currStrike, filteredColor, cache{cache.get()}, textRatio]
+ [this, &run, &currStrike, &filteredColor, cache{cache.get()}, textRatio]
(const SkGlyph& glyph, SkPoint position) {
run->appendGlyph(this, currStrike,
glyph, GrGlyph::kDistance_MaskStyle, position,
@@ -742,7 +742,7 @@
};
auto perPath =
- [run, textRatio, cache{cache.get()}]
+ [&run, textRatio, cache{cache.get()}]
(const SkGlyph& glyph, SkPoint position) {
if (const SkPath* glyphPath = cache->findPath(glyph)) {
run->appendPathGlyph(*glyphPath, position, textRatio, false);
@@ -775,7 +775,7 @@
scalerContextFlags, SkMatrix::I());
// Given a glyph that is not ARGB, draw it.
- auto perPath = [textScale, run, &pathCache]
+ auto perPath = [textScale, &run, &pathCache]
(const SkGlyph& glyph, SkPoint position) {
const SkPath* path = pathCache->findPath(glyph);
if (path != nullptr) {
@@ -800,7 +800,7 @@
auto perEmpty = [](const SkGlyph&, SkPoint) {};
auto perGlyph =
- [this, run, &currStrike, filteredColor, cache{cache.get()}]
+ [this, &run, &currStrike, &filteredColor, cache{cache.get()}]
(const SkGlyph& glyph, SkPoint mappedPt) {
SkPoint pt{SkScalarFloorToScalar(mappedPt.fX),
SkScalarFloorToScalar(mappedPt.fY)};
@@ -810,7 +810,7 @@
};
auto perPath =
- [run, cache{cache.get()}]
+ [&run, cache{cache.get()}]
(const SkGlyph& glyph, SkPoint position) {
const SkPath* glyphPath = cache->findPath(glyph);
SkPoint pt{SkScalarFloorToScalar(position.fX),