aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkTypeface_remote.cpp
diff options
context:
space:
mode:
authorGravatar Herb Derby <herb@google.com>2018-06-01 16:47:21 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-04 15:23:29 +0000
commitfeb9fa9e9ba47ec4a4e6480d90a88ad5cdb46020 (patch)
tree5a39a775f1ef0d6142f1a81c5b21c5109a390e84 /src/core/SkTypeface_remote.cpp
parente1adc3a9552c21e7b45b7a910f2a0854e00a92b9 (diff)
Turn off logging for tests
Change-Id: I00bb3059bb92b5c11178022aff8a87918bb3781e Reviewed-on: https://skia-review.googlesource.com/131640 Reviewed-by: Khushal Sagar <khushalsagar@google.com> Commit-Queue: Herb Derby <herb@google.com>
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