notify type size for SkGlyphScaler_remote

Add type size so we can check that the UWA failures are
happening on the size boundaries between direct and
SDF, and SDF small to SDF medium.

Bug=skia:11241

Change-Id: I7d0823ab1fb4c9c8db13ba884a2b2454ba4bf210
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/365636
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This commit is contained in:
Herb Derby 2021-02-03 14:29:54 -05:00 committed by Skia Commit-Bot
parent e1db1fb6df
commit e5ed50b2c8
3 changed files with 15 additions and 6 deletions

View File

@ -130,7 +130,12 @@ public:
// successful, subsequent attempts to delete the same handle are invalid.
virtual bool deleteHandle(SkDiscardableHandleId) = 0;
virtual void notifyCacheMiss(CacheMissType) {}
// TODO: remove this old interface when Chrome has moved over to the one below.
virtual void notifyCacheMiss(CacheMissType type) { }
virtual void notifyCacheMiss(CacheMissType type, int fontSize) {
this->notifyCacheMiss(type);
}
struct ReadFailureData {
size_t memorySize;

View File

@ -31,7 +31,8 @@ void SkScalerContextProxy::generateMetrics(SkGlyph* glyph) {
glyph->fMaskFormat = fRec.fMaskFormat;
glyph->zeroMetrics();
fDiscardableManager->notifyCacheMiss(SkStrikeClient::CacheMissType::kGlyphMetrics);
fDiscardableManager->notifyCacheMiss(
SkStrikeClient::CacheMissType::kGlyphMetrics, fRec.fTextSize);
}
void SkScalerContextProxy::generateImage(const SkGlyph& glyph) {
@ -42,7 +43,8 @@ void SkScalerContextProxy::generateImage(const SkGlyph& glyph) {
// There is no desperation search here, because if there was an image to be found it was
// copied over with the metrics search.
fDiscardableManager->notifyCacheMiss(SkStrikeClient::CacheMissType::kGlyphImage);
fDiscardableManager->notifyCacheMiss(
SkStrikeClient::CacheMissType::kGlyphImage, fRec.fTextSize);
}
bool SkScalerContextProxy::generatePath(SkGlyphID glyphID, SkPath* path) {
@ -51,7 +53,8 @@ bool SkScalerContextProxy::generatePath(SkGlyphID glyphID, SkPath* path) {
SkDebugf("GlyphCacheMiss generatePath: %s\n", this->getRec().dump().c_str());
}
fDiscardableManager->notifyCacheMiss(SkStrikeClient::CacheMissType::kGlyphPath);
fDiscardableManager->notifyCacheMiss(
SkStrikeClient::CacheMissType::kGlyphPath, fRec.fTextSize);
return false;
}
@ -64,7 +67,8 @@ void SkScalerContextProxy::generateFontMetrics(SkFontMetrics* metrics) {
}
// Font metrics aren't really used for render, so just zero out the data and return.
fDiscardableManager->notifyCacheMiss(SkStrikeClient::CacheMissType::kFontMetrics);
fDiscardableManager->notifyCacheMiss(
SkStrikeClient::CacheMissType::kFontMetrics, fRec.fTextSize);
sk_bzero(metrics, sizeof(*metrics));
}

View File

@ -55,7 +55,7 @@ public:
return id <= fLastDeletedHandleId;
}
void notifyCacheMiss(SkStrikeClient::CacheMissType type) override {
void notifyCacheMiss(SkStrikeClient::CacheMissType type, int fontSize) override {
SkAutoMutexExclusive l(fMutex);
fCacheMissCount[type]++;