cleanup TODOs, and warnings The API for a remote glyph cache had a couple of TODO's left waiting for Chromium to implement the functions. This happened three years ago. This is waiting for the Chromium CL to finish: https://chromium-review.googlesource.com/c/chromium/src/+/3338117 Change-Id: If8e3de619f0f4be7044e6955204b599c5a42e802 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/484437 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Herb Derby <herb@google.com>
diff --git a/bench/SkGlyphCacheBench.cpp b/bench/SkGlyphCacheBench.cpp index c82fbc5..2127f1a 100644 --- a/bench/SkGlyphCacheBench.cpp +++ b/bench/SkGlyphCacheBench.cpp
@@ -147,7 +147,7 @@ return id <= fLastDeletedHandleId; } - void notifyCacheMiss(SkStrikeClient::CacheMissType type) override { + void notifyCacheMiss(SkStrikeClient::CacheMissType type, int fontSize) override { SkAutoMutexExclusive l(fMutex); fCacheMissCount[type]++;
diff --git a/include/private/chromium/SkChromeRemoteGlyphCache.h b/include/private/chromium/SkChromeRemoteGlyphCache.h index 88a61d5..2973e03 100644 --- a/include/private/chromium/SkChromeRemoteGlyphCache.h +++ b/include/private/chromium/SkChromeRemoteGlyphCache.h
@@ -49,8 +49,7 @@ // Returns true if a handle has been deleted on the remote client. It is // invalid to use a handle id again with this manager once this returns true. - // TODO(khushalsagar): Make pure virtual once chrome implementation lands. - SK_SPI virtual bool isHandleDeleted(SkDiscardableHandleId) { return false; } + SK_SPI virtual bool isHandleDeleted(SkDiscardableHandleId) = 0; }; SK_SPI explicit SkStrikeServer(DiscardableHandleManager* discardableHandleManager); @@ -94,7 +93,7 @@ // (DEPRECATED) The original glyph could not be found and a fallback was used. kGlyphMetricsFallback = 4, - kGlyphPathFallback = 5, + kGlyphPathFallback = 5, kLast = kGlyphPath }; @@ -108,12 +107,7 @@ // successful, subsequent attempts to delete the same handle are invalid. virtual bool deleteHandle(SkDiscardableHandleId) = 0; - // 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); - } + virtual void notifyCacheMiss(CacheMissType type, int fontSize) = 0; struct ReadFailureData { size_t memorySize;
diff --git a/tools/remote_demo.cpp b/tools/remote_demo.cpp index 12a51e7..8367659 100644 --- a/tools/remote_demo.cpp +++ b/tools/remote_demo.cpp
@@ -37,6 +37,8 @@ } void purgeAll() { lastPurgedHandleId = nextHandleId; } + bool isHandleDeleted(SkDiscardableHandleId id) override { return false; } + private: SkDiscardableHandleId nextHandleId = 0u; SkDiscardableHandleId lastPurgedHandleId = 0u; @@ -62,6 +64,8 @@ bool deleteHandle(SkDiscardableHandleId) override { return allowPurging; } + void notifyCacheMiss(SkStrikeClient::CacheMissType type, int fontSize) override { } + private: bool allowPurging = false; };