aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2016-08-26 13:17:44 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-26 13:17:44 -0700
commit4871f2277738fa7e9232d25424c008b36dae4711 (patch)
tree050146b76e6a7f80cc50c856081ac92110dc1956 /include
parentab83da71426195dad58a85e2caff213358c8461d (diff)
SkPDF: Glyph validation change
Instead of mapping invaid glyphIDs to zero or maxGlyphID, don't draw them at all. Validate glyphs when glyph is written, not ahead of time. Don't allocate array to copy user-provided glyphs. Easy early exit from SkPDFDevice::internalDrawText() GlyphPositioner::flush() called ~GlyphPositioner() SkScopeExit class now exists. Assume SkTypeface* pointers are now never null in more places. precalculate alignmentFactor to clean up code. SkPDFDevice::updateFont must be called with validated glyphID. Skip bad glyphs to make this true. SkPDFDevice::updateFont always succeeds. SkPDFFont::GetFontResource always succeeds (preconditions are asserted). If GetMetrics fails, don't call GetFontResource. SkPDFFont::glyphsToPDFFontEncodingCount() becomes SkPDFFont::countStretch() and is inlined. SkPDFFont::glyphsToPDFFontEncoding now works one Glyph at a time and is inlined. SkPDFFont::noteGlyphUsage() operates one glyph at a time. Add SkScopeExit.h; also a unit test for it. SkPostConfig: Fix SK_UNUSED for Win32. No public API changes. TBR=reed@google.com BUG=625995 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2278703002 Review-Url: https://codereview.chromium.org/2278703002
Diffstat (limited to 'include')
-rw-r--r--include/core/SkPostConfig.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h
index 97c868f30f..1b1cb3e751 100644
--- a/include/core/SkPostConfig.h
+++ b/include/core/SkPostConfig.h
@@ -245,7 +245,11 @@
//////////////////////////////////////////////////////////////////////
#if !defined(SK_UNUSED)
-# define SK_UNUSED SK_ATTRIBUTE(unused)
+# if defined(_MSC_VER)
+# define SK_UNUSED __pragma(warning(suppress:4189))
+# else
+# define SK_UNUSED SK_ATTRIBUTE(unused)
+# endif
#endif
#if !defined(SK_ATTR_DEPRECATED)