aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2015-04-10 15:35:22 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-04-10 15:35:22 -0700
commit94164944f88972e7fd555170ca94536a70db1515 (patch)
tree72f770e69494f2a2f8cbcd06c7d389f5ee3586f0 /src/ports
parent3c309db75bb8c4c2b58724a0e2f6f3b387ca842c (diff)
Ammend font table data experiment on Mac.
Calling CGFontCopyTableForTag did not affect the runtime results, so try to actually access the data to see if that makes a difference. TBR=reed1 This is a test change, allow data to be collected. Review URL: https://codereview.chromium.org/1076183004
Diffstat (limited to 'src/ports')
-rwxr-xr-xsrc/ports/SkFontHost_mac.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index 836576bc2a..5eaf7df603 100755
--- a/src/ports/SkFontHost_mac.cpp
+++ b/src/ports/SkFontHost_mac.cpp
@@ -913,6 +913,14 @@ CGRGBPixel* Offscreen::getCG(const SkScalerContext_Mac& context, const SkGlyph&
AutoCFRelease<CFDataRef> sbix;
if (static_cast<SkTypeface_Mac*>(context.getTypeface())->fHasColorGlyphs) {
sbix.reset(CGFontCopyTableForTag(context.fCGFont, 'sbix'));
+ // Attempt to read from the sbix table data to determine if the returned data is valid.
+ const UInt8* sbixData = CFDataGetBytePtr(sbix);
+ CFIndex sbixLength = CFDataGetLength(sbix);
+ if (sbixLength > 0 && *sbixData > 0x80) {
+ // We need to actually do something to avoid this being optimized away.
+ CFRetain(sbix);
+ CFRelease(sbix);
+ }
}
ctFontDrawGlyphs(context.fCTUnrotatedFont, &glyphID, &point, 1, fCG);