Verify pinned state in glyphVector and deserialization
Change-Id: I283f421183f747e7225eaf96c9c5e4217b6f5dc7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/540036
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
diff --git a/src/core/SkChromeRemoteGlyphCache.cpp b/src/core/SkChromeRemoteGlyphCache.cpp
index d6e1edb..9be90778 100644
--- a/src/core/SkChromeRemoteGlyphCache.cpp
+++ b/src/core/SkChromeRemoteGlyphCache.cpp
@@ -1050,6 +1050,12 @@
msg.appendf(" Mapped descriptor:\n%s", clientDesc->dumpRec().c_str());
#endif
auto strike = fStrikeCache->findStrike(*clientDesc);
+
+ // Make sure strike is pinned
+ if (strike) {
+ strike->verifyPinnedStrike();
+ }
+
// Metrics are only sent the first time. If the metrics are not initialized, there must
// be an existing strike.
if (fontMetricsInitialized && strike == nullptr) READ_FAILURE
diff --git a/src/text/gpu/GlyphVector.cpp b/src/text/gpu/GlyphVector.cpp
index bd96740..654329c 100644
--- a/src/text/gpu/GlyphVector.cpp
+++ b/src/text/gpu/GlyphVector.cpp
@@ -96,8 +96,7 @@
}
// This must be pinned for the Atlas filling to work.
- // TODO(herb): re-enable after the cut on 20220414
- // fSkStrike->verifyPinnedStrike();
+ fSkStrike->verifyPinnedStrike();
// Drop the ref on the strike that was taken in the SkGlyphRunPainter process* methods.
fSkStrike = nullptr;