Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Issue 2302353002: SkPDF: Glyph validation change (Closed)

Created:
4 years, 3 months ago by hal.canary
Modified:
4 years, 3 months ago
Reviewers:
reed1
CC:
reviews_skia.org
Target Ref:
refs/heads/chrome/m54
Project:
skia
Visibility:
Public.

Description

SkPDF: Glyph validation change [cherry-pick https://skia.googlesource.com/skia.git/+/4871f22 to m54] 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 NOTREECHECKS=true NOTRY=true NOPRESUBMIT=true Committed: https://skia.googlesource.com/skia/+/9baacd93a1fa5e2518b492bfd293c13e2020e62c

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+243 lines, -200 lines) Patch
M include/core/SkPostConfig.h View 1 chunk +5 lines, -1 line 0 comments Download
M src/pdf/SkPDFDevice.h View 1 chunk +5 lines, -2 lines 0 comments Download
M src/pdf/SkPDFDevice.cpp View 10 chunks +104 lines, -107 lines 0 comments Download
M src/pdf/SkPDFFont.h View 4 chunks +40 lines, -22 lines 0 comments Download
M src/pdf/SkPDFFont.cpp View 4 chunks +29 lines, -68 lines 0 comments Download
A src/pdf/SkScopeExit.h View 1 chunk +50 lines, -0 lines 0 comments Download
M tests/CPlusPlusEleven.cpp View 2 chunks +10 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (3 generated)
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2302353002/1
4 years, 3 months ago (2016-09-02 14:28:11 UTC) #3
commit-bot: I haz the power
4 years, 3 months ago (2016-09-02 14:28:20 UTC) #5
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://skia.googlesource.com/skia/+/9baacd93a1fa5e2518b492bfd293c13e2020e62c

Powered by Google App Engine
This is Rietveld 408576698