aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkTypeface_remote.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/SkTypeface_remote.cpp')
-rw-r--r--src/core/SkTypeface_remote.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/core/SkTypeface_remote.cpp b/src/core/SkTypeface_remote.cpp
index 479ad16b7b..b5871ded25 100644
--- a/src/core/SkTypeface_remote.cpp
+++ b/src/core/SkTypeface_remote.cpp
@@ -15,7 +15,8 @@ SkScalerContextProxy::SkScalerContextProxy(sk_sp<SkTypeface> tf,
const SkScalerContextEffects& effects,
const SkDescriptor* desc,
sk_sp<SkStrikeClient::DiscardableHandleManager> manager)
- : SkScalerContext{std::move(tf), effects, desc}, fDiscardableManager{std::move(manager)} {}
+ : SkScalerContext{std::move(tf), effects, desc}
+ , fDiscardableManager{std::move(manager)} {}
unsigned SkScalerContextProxy::generateGlyphCount() {
SK_ABORT("Should never be called.");
@@ -33,7 +34,9 @@ void SkScalerContextProxy::generateAdvance(SkGlyph* glyph) {
void SkScalerContextProxy::generateMetrics(SkGlyph* glyph) {
TRACE_EVENT1("skia", "generateMetrics", "rec", TRACE_STR_COPY(this->getRec().dump().c_str()));
- //SkDebugf("GlyphCacheMiss generateMetrics: %s\n", this->getRec().dump().c_str());
+ if (this->getProxyTypeface()->isLogging()) {
+ SkDebugf("GlyphCacheMiss generateMetrics: %s\n", this->getRec().dump().c_str());
+ }
fDiscardableManager->NotifyCacheMiss(SkStrikeClient::CacheMissType::kGlyphMetrics);
glyph->zeroMetrics();
@@ -41,14 +44,18 @@ void SkScalerContextProxy::generateMetrics(SkGlyph* glyph) {
void SkScalerContextProxy::generateImage(const SkGlyph& glyph) {
TRACE_EVENT1("skia", "generateImage", "rec", TRACE_STR_COPY(this->getRec().dump().c_str()));
- //SkDebugf("GlyphCacheMiss generateImage: %s\n", this->getRec().dump().c_str());
+ if (this->getProxyTypeface()->isLogging()) {
+ SkDebugf("GlyphCacheMiss generateImage: %s\n", this->getRec().dump().c_str());
+ }
fDiscardableManager->NotifyCacheMiss(SkStrikeClient::CacheMissType::kGlyphImage);
}
bool SkScalerContextProxy::generatePath(SkGlyphID glyphID, SkPath* path) {
TRACE_EVENT1("skia", "generatePath", "rec", TRACE_STR_COPY(this->getRec().dump().c_str()));
- //SkDebugf("GlyphCacheMiss generatePath: %s\n", this->getRec().dump().c_str());
+ if (this->getProxyTypeface()->isLogging()) {
+ SkDebugf("GlyphCacheMiss generatePath: %s\n", this->getRec().dump().c_str());
+ }
fDiscardableManager->NotifyCacheMiss(SkStrikeClient::CacheMissType::kGlyphPath);
return false;
@@ -57,9 +64,15 @@ bool SkScalerContextProxy::generatePath(SkGlyphID glyphID, SkPath* path) {
void SkScalerContextProxy::generateFontMetrics(SkPaint::FontMetrics* metrics) {
TRACE_EVENT1(
"skia", "generateFontMetrics", "rec", TRACE_STR_COPY(this->getRec().dump().c_str()));
- //SkDebugf("GlyphCacheMiss generateFontMetrics: %s\n", this->getRec().dump().c_str());
- //SkDEBUGCODE(SkStrikeCache::Dump());
+ if (this->getProxyTypeface()->isLogging()) {
+ SkDebugf("GlyphCacheMiss generateFontMetrics: %s\n", this->getRec().dump().c_str());
+ SkDEBUGCODE(SkStrikeCache::Dump());
+ }
fDiscardableManager->NotifyCacheMiss(SkStrikeClient::CacheMissType::kFontMetrics);
sk_bzero(metrics, sizeof(*metrics));
}
+
+SkTypefaceProxy* SkScalerContextProxy::getProxyTypeface() const {
+ return (SkTypefaceProxy*)this->getTypeface();
+} \ No newline at end of file