aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkGlyphCache.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/SkGlyphCache.h')
-rw-r--r--src/core/SkGlyphCache.h26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/core/SkGlyphCache.h b/src/core/SkGlyphCache.h
index 8d5098a496..30928da744 100644
--- a/src/core/SkGlyphCache.h
+++ b/src/core/SkGlyphCache.h
@@ -10,15 +10,12 @@
#include "SkArenaAlloc.h"
#include "SkDescriptor.h"
#include "SkGlyph.h"
-#include "SkStrikeCache.h"
#include "SkPaint.h"
#include "SkTHash.h"
#include "SkScalerContext.h"
#include "SkTemplates.h"
#include <memory>
-class SkTraceMemoryDump;
-
/** \class SkGlyphCache
This class represents a strike: a specific combination of typeface, size, matrix, etc., and
@@ -32,8 +29,15 @@ class SkTraceMemoryDump;
The Find*Exclusive() method returns SkExclusiveStrikePtr, which releases exclusive ownership
when they go out of scope.
*/
-class SkGlyphCache : private SkStrikeCache::Node {
+class SkGlyphCache {
public:
+ SkGlyphCache(const SkDescriptor& desc,
+ std::unique_ptr<SkScalerContext> scaler,
+ const SkPaint::FontMetrics&);
+ ~SkGlyphCache();
+
+ const SkDescriptor& getDescriptor() const;
+
/** Return true if glyph is cached. */
bool isGlyphCached(SkGlyphID glyphID, SkFixed x, SkFixed y) const;
@@ -106,8 +110,6 @@ public:
return fFontMetrics;
}
- using Node::getDescriptor;
-
SkMask::Format getMaskFormat() const {
return fScalerContext->getMaskFormat();
}
@@ -149,8 +151,6 @@ public:
};
private:
- friend class SkStrikeCache;
-
enum MetricsType {
kNothing_MetricsType,
kJustAdvance_MetricsType,
@@ -168,10 +168,6 @@ private:
SkPackedGlyphID fPackedGlyphID;
};
- SkGlyphCache(const SkDescriptor& desc, std::unique_ptr<SkScalerContext> scaler,
- const SkPaint::FontMetrics&);
- ~SkGlyphCache();
-
// Return the SkGlyph* associated with MakeID. The id parameter is the
// combined glyph/x/y id generated by MakeID. If it is just a glyph id
// then x and y are assumed to be zero.
@@ -201,6 +197,7 @@ private:
static const SkGlyph::Intercept* MatchBounds(const SkGlyph* glyph,
const SkScalar bounds[2]);
+ const SkAutoDescriptor fDesc;
const std::unique_ptr<SkScalerContext> fScalerContext;
SkPaint::FontMetrics fFontMetrics;
@@ -220,7 +217,9 @@ private:
size_t fMemoryUsed;
};
+// This will be deleted soon, and keeps android building.
#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
+#include "SkStrikeCache.h"
class SkAutoGlyphCacheNoGamma : public SkExclusiveStrikePtr {
public:
SkAutoGlyphCacheNoGamma(const SkPaint& paint,
@@ -228,9 +227,8 @@ public:
const SkMatrix* matrix)
: SkExclusiveStrikePtr(SkStrikeCache::FindOrCreateStrikeExclusive(
paint, surfaceProps, SkScalerContextFlags::kNone, matrix)) {}
-
};
#define SkAutoGlyphCacheNoGamma(...) SK_REQUIRE_LOCAL_VAR(SkAutoGlyphCacheNoGamma)
#endif
-#endif
+#endif // SkGlyphCache_DEFINED