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

Issue 2150393002: SkPDF: Join Positioned Text (Closed)

Created:
4 years, 5 months ago by hal.canary
Modified:
4 years, 5 months ago
Reviewers:
bungeman-skia
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

SkPDF: Join Positioned Text When N sequential positioned glyphs differ in positions by exactly the advances of the first (N-1) glyphs, join the glyphs into a string rather than changing the text matrix between each glyph draw. Decreases PDF output size by about ~1.4%. Potentially more on text-heavy pages. A single-typeface PDF of an 27kB ASCII document shaped with harfbuzz: before: 187743 Bytes after: 65513 Bytes difference: -65.1% Before: BT /F0 13 Tf 1 0 0 -1 143.5 61 Tm <0029> Tj 1 0 0 -1 150.634765 61 Tm <004C> Tj 1 0 0 -1 154.602050 61 Tm <0055> Tj 1 0 0 -1 160.245117 61 Tm <0048> Tj 1 0 0 -1 167.925781 61 Tm <004B> Tj 1 0 0 -1 176.469726 61 Tm <0052> Tj 1 0 0 -1 184.518554 61 Tm <0056> Tj 1 0 0 -1 190.980468 61 Tm <0048> Tj ET After: BT /F0 13 Tf 1 0 0 -1 0 0 Tm 143.5 -61 Td <0029004C0055> Tj 16.7451171 0 Td <0048004B005200560048> Tj ET Also: update the Text matrix with the `Td` operator, instead of overwriting it with the the `Tm` operator. In the worst case, when every glyph is positioned differently than it's advance, this still makes the command stream smaller: Before: ... 1 0 0 -1 58.328125 660 Tm <0055> Tj 1 0 0 -1 61.609375 660 Tm <004C> Tj 1 0 0 -1 63.828125 660 Tm <0056> Tj ... After: ... 3.140625 0 Td <0055> Tj 3.28125 0 Td <004C> Tj 2.21875 0 Td <0056> Tj ... GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2150393002 Committed: https://skia.googlesource.com/skia/+/f0c30f55665eb3555ca438855d4995baed182e97

Patch Set 1 #

Patch Set 2 : 2016-07-15 (Friday) 16:11:07 EDT #

Unified diffs Side-by-side diffs Delta from patch set Stats (+82 lines, -5 lines) Patch
M src/pdf/SkPDFDevice.cpp View 4 chunks +75 lines, -5 lines 0 comments Download
M src/pdf/SkPDFUtils.h View 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (12 generated)
hal.canary
PTAL
4 years, 5 months ago (2016-07-15 18:16:04 UTC) #5
bungeman-skia
lgtm
4 years, 5 months ago (2016-07-15 20:10:15 UTC) #11
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/2150393002/20001
4 years, 5 months ago (2016-07-15 20:11:36 UTC) #14
commit-bot: I haz the power
4 years, 5 months ago (2016-07-15 20:35:48 UTC) #16
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://skia.googlesource.com/skia/+/f0c30f55665eb3555ca438855d4995baed182e97

Powered by Google App Engine
This is Rietveld 408576698