diff options
author | Herb Derby <herb@google.com> | 2018-06-20 14:43:23 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-20 20:24:47 +0000 |
commit | 3e36ce6e660ad585c58c5cc5591f23a46fcab767 (patch) | |
tree | 1a63f02ccef4ba8414997378b5dff225750b44a7 /src/core/SkStrikeCache.h | |
parent | b70e3b4831398aff696b9e15ad7e8f581db8aa9d (diff) |
Make SkRemoteGlyphCache tests use private glyph cache
Change-Id: If6aa189f3badc7558ab8ecf71ee3d704b275b20f
Reviewed-on: https://skia-review.googlesource.com/136225
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Diffstat (limited to 'src/core/SkStrikeCache.h')
-rw-r--r-- | src/core/SkStrikeCache.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/core/SkStrikeCache.h b/src/core/SkStrikeCache.h index 05e3aa4025..a2b3a8a19d 100644 --- a/src/core/SkStrikeCache.h +++ b/src/core/SkStrikeCache.h @@ -47,7 +47,7 @@ public: class ExclusiveStrikePtr { public: - explicit ExclusiveStrikePtr(Node*); + explicit ExclusiveStrikePtr(Node*, SkStrikeCache*); ExclusiveStrikePtr(); ExclusiveStrikePtr(const ExclusiveStrikePtr&) = delete; ExclusiveStrikePtr& operator = (const ExclusiveStrikePtr&) = delete; @@ -65,8 +65,10 @@ public: private: Node* fNode; + SkStrikeCache* fStrikeCache; }; + static SkStrikeCache* GetGlobalStrikeCache(); static ExclusiveStrikePtr FindStrikeExclusive(const SkDescriptor&); @@ -111,6 +113,17 @@ public: void attachNode(Node* node); ExclusiveStrikePtr findStrikeExclusive(const SkDescriptor&); + ExclusiveStrikePtr findOrCreateStrikeExclusive( + const SkDescriptor& desc, + const SkScalerContextEffects& effects, + const SkTypeface& typeface); + + ExclusiveStrikePtr createStrikeExclusive( + const SkDescriptor& desc, + std::unique_ptr<SkScalerContext> scaler, + SkPaint::FontMetrics* maybeMetrics = nullptr, + std::unique_ptr<SkStrikePinner> = nullptr); + // Routines to find suitable data when working in a remote cache situation. These are // suitable as substitutes for similar calls in SkScalerContext. bool desperationSearchForImage(const SkDescriptor& desc, @@ -133,13 +146,13 @@ public: #ifdef SK_DEBUG void validate() const; + void internalValidate() const; #else void validate() const {} + void internalValidate() const {} #endif private: - static void Attach(Node* node); - // The following methods can only be called when mutex is already held. Node* internalGetHead() const { return fHead; } Node* internalGetTail() const { return fTail; } |