aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkGlyphCache.cpp
diff options
context:
space:
mode:
authorGravatar Herb Derby <herb@google.com>2018-01-23 13:39:21 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-23 21:55:50 +0000
commit980a48de64baf2f974f6c99096391280d1c1d22c (patch)
tree8268924145dd50b4e6ce3e2e01bb36fb536ca948 /src/core/SkGlyphCache.cpp
parent27059d36d63284b1af2c25e0e5a52c17485c54d7 (diff)
Move glyph cache and descriptor functions off of SkPaint
BUG=skia:7515 Change-Id: If17b157db1077a9a3c0f9efd03929f62a3486419 Reviewed-on: https://skia-review.googlesource.com/98841 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Herb Derby <herb@google.com>
Diffstat (limited to 'src/core/SkGlyphCache.cpp')
-rw-r--r--src/core/SkGlyphCache.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/SkGlyphCache.cpp b/src/core/SkGlyphCache.cpp
index 9ddf70cc4d..16f18639bd 100644
--- a/src/core/SkGlyphCache.cpp
+++ b/src/core/SkGlyphCache.cpp
@@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
+
#include "SkGlyphCache.h"
#include "SkGlyphCache_Globals.h"
#include "SkGraphics.h"
@@ -810,3 +811,16 @@ void SkGraphics::PurgeFontCache() {
// TODO(herb): clean up TLS apis.
size_t SkGraphics::GetTLSFontCacheLimit() { return 0; }
void SkGraphics::SetTLSFontCacheLimit(size_t bytes) { }
+
+SkGlyphCache* SkGlyphCache::DetachCacheUsingPaint(const SkPaint& paint,
+ const SkSurfaceProps* surfaceProps,
+ SkScalerContextFlags scalerContextFlags,
+ const SkMatrix* deviceMatrix) {
+ SkAutoDescriptor ad;
+ SkScalerContextEffects effects;
+
+ auto desc = SkScalerContext::CreateDescriptorAndEffectsUsingPaint(
+ paint, surfaceProps, scalerContextFlags, deviceMatrix, &ad, &effects);
+
+ return SkGlyphCache::DetachCache(paint.getTypeface(), effects, desc);
+}