History log of /external/skia/src/pdf/SkPDFFont.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
d3b65972aad96453ff4510caa3e25a2b847c6d1e 22-Mar-2017 Brian Salomon <bsalomon@google.com> Mark overridden destructors with 'override' and remove 'virtual'

This silences a new warning in clang 5.0

Change-Id: Ieb5b75a6ffed60107c3fd16075d2ecfd515b55e8
Reviewed-on: https://skia-review.googlesource.com/10006
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
/external/skia/src/pdf/SkPDFFont.cpp
aa3af7b4692932c4fab4109b2d9f29ae40e49ad5 06-Mar-2017 Hal Canary <halcanary@google.com> SkPDF: Always get advances at unitsPerEm.

* Work around BUG=chromium:696356
* SkTestScalerContext needs a return a em-size.
* SkPDFFont::MakeVectorCache which always produces a glyph
cache at emsize. Replaces vector_cache().
* Stop looking at fLastGlyphID and fEmSize in TypefaceMetrics.

Change-Id: I28d93b8f62d461a60fa046e9aaf7fa6d116a7ee5
Reviewed-on: https://skia-review.googlesource.com/9324
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
/external/skia/src/pdf/SkPDFFont.cpp
7ad87938985e71f6f2d47200239322c4571a3c10 16-Feb-2017 Hal Canary <halcanary@google.com> SkPDF/font subsetting: Use new version of SfntlyWrapper::SubsetFont

Change-Id: Ib4bddcedb09b50556e8e1f02926c443870f46a09
Reviewed-on: https://skia-review.googlesource.com/8544
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
/external/skia/src/pdf/SkPDFFont.cpp
8be952ad8c9deefe19cff36f9ad217563400f817 14-Feb-2017 Mike Reed <reed@google.com> SkScalarMul is deprecated

BUG=skia:

Change-Id: I88ecfe9d4c72506f6b1a0e0dfadd2a5c171a6cb6
Reviewed-on: https://skia-review.googlesource.com/8353
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
/external/skia/src/pdf/SkPDFFont.cpp
b3480e1cb71b2ddf2a4aa8fa03e18449d38f9e1c 30-Sep-2016 Hal Canary <halcanary@google.com> SkPDF: de-duplicate text-as-paths

TBR=

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2851

Change-Id: I0accbca13945587cd5ef903cbd4127f1f6a3fb13
Reviewed-on: https://skia-review.googlesource.com/2851
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
/external/skia/src/pdf/SkPDFFont.cpp
2a4d1e1c1f574e3ee99ae0e3a47ef24f635b9b16 22-Sep-2016 halcanary <halcanary@google.com> SkPDF: do not assert when openStream return nullptr

BUG=163892
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2332813002

Review-Url: https://codereview.chromium.org/2332813002
/external/skia/src/pdf/SkPDFFont.cpp
e202bd8b71f6aa184c2c8ce6f653755de1331c88 19-Sep-2016 halcanary <halcanary@google.com> SkPDF: SkBitSet gets reset() to make drop() better.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2354583002

Review-Url: https://codereview.chromium.org/2354583002
/external/skia/src/pdf/SkPDFFont.cpp
c2f9ec1f5e4e8e98489cd5ea9356771cf4d8ce13 12-Sep-2016 halcanary <halcanary@google.com> SkPDF: refactor & code cleanup ahead of https://crrev.com/2322403002

SkPDFDevice::GraphicStateEntry: remove unnecessary fFont and
fTextSize.

SkPDFDevice::updateFont(): replace with update_font() and inlined
code. De-duplicate this block of code.

SkPDFResourceDict::GetResourceTypePrefix function made public: removes
need for temporary SkString returned by
SkPDFResourceDict::getResourceName()

GlyphPositioner: delay writing intial matrix until first glyph.
Assert that widechars is a constant.

SkPDFFont::FontType(): make public so that PDFDevice can know about
multibyte status.

SkPDFFont::countStretch() removed, and the stretch loop flattened.

*no changes in PDF output*

BUG=skia:5434
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2327953002

Review-Url: https://codereview.chromium.org/2327953002
/external/skia/src/pdf/SkPDFFont.cpp
426a2459290a57bf32151f042fe5cd67da61d02f 09-Sep-2016 halcanary <halcanary@google.com> SkPDF: hand SfntlyWrapper::SubsetFont() ttcIndex, not fontName.

Also, minor code refactoring.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2258233002

Committed: https://skia.googlesource.com/skia/+/fce190647285423bf36c44bca09db78a6af30f9f
Review-Url: https://codereview.chromium.org/2258233002
/external/skia/src/pdf/SkPDFFont.cpp
59be20c8d532a81992a9ec73b6a39265a479fce5 01-Sep-2016 halcanary <halcanary@google.com> SkPDF: revert changes to CMapName/Registry/Ordering in 3d01c62

BUG=skia:5606
TBR=bungeman@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2305803002

Review-Url: https://codereview.chromium.org/2305803002
/external/skia/src/pdf/SkPDFFont.cpp
3d01c62e19df9f369cdfaeff82ec8af2c0be75f1 31-Aug-2016 halcanary <halcanary@google.com> SkPDF: Fix Type3 ToUnicode table.

This seems to fix text extraction on Adobe Reader

- Registry/Ordering is now set to Skia/SkiaOrdering.
- Type3 fonts now get a FontDescriptor (force symbolic font).
- CMapName is now Skia-Identity-SkiaOrdering
- CMap behaves correctly for single-byte fonts.

Also:
- SkTestTypeface returns tounicode map for testing.
- Unit test updated

All PDFs render the same

BUG=skia:5606
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2292303004

Review-Url: https://codereview.chromium.org/2292303004
/external/skia/src/pdf/SkPDFFont.cpp
8e3f54d51930f0c2f3bebf163ee7754b69080ae8 30-Aug-2016 halcanary <halcanary@google.com> Revert of SkPDF: hand SfntlyWrapper::SubsetFont() ttcIndex, not fontName. (patchset #3 id:40001 of https://codereview.chromium.org/2258233002/ )

Reason for revert:
forgot to roll sfntly in android!

Original issue's description:
> SkPDF: hand SfntlyWrapper::SubsetFont() ttcIndex, not fontName.
>
> Also, minor code refactoring.
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2258233002
>
> Committed: https://skia.googlesource.com/skia/+/fce190647285423bf36c44bca09db78a6af30f9f

TBR=bungeman@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2296683004
/external/skia/src/pdf/SkPDFFont.cpp
1bab6ae133f3906729a08aecc212765361dbf178 30-Aug-2016 halcanary <halcanary@google.com> SkPDF: SK_SFNTLY_SUBSETTER is gone

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2296823002

Review-Url: https://codereview.chromium.org/2296823002
/external/skia/src/pdf/SkPDFFont.cpp
fce190647285423bf36c44bca09db78a6af30f9f 30-Aug-2016 halcanary <halcanary@google.com> SkPDF: hand SfntlyWrapper::SubsetFont() ttcIndex, not fontName.

Also, minor code refactoring.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2258233002

Review-Url: https://codereview.chromium.org/2258233002
/external/skia/src/pdf/SkPDFFont.cpp
1748432796116bc942dbf3922c97b5220237e733 29-Aug-2016 halcanary <halcanary@google.com> SkPDF: Remove some unused glyphs from fallback fonts

This makes the /Widths and the /Differences arrays smaller.

Example diff in output PDF (lines are wrapped for easy viewing):

<</Type /Font
/Subtype /Type3
/FontMatrix [.00100000005 0 0 -.00100000005 0 0]
/FirstChar 0
-/LastChar 255
+/LastChar 118
/FontBBox [23 228 669 -694]
/CIDToGIDMap /Identity
/ToUnicode 8 0 R
-/Widths [280 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-525 0 0 0 525 0 0 0 0 525 525 525 525 0 0 0 0 0 0 525 0 0 0 0 0 0 0 0
-0 0 0 0 0 525 0 525 0 0 0 525 0 0 0 0 0 0 0 0 0 0 0 525 0 0 0 0 0 0
-525 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 525 0 0 0 0 0 0 0 525
-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
+/Widths [280 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+525 0 0 0 525 0 0 0 0 525 525 525 525 0 0 0 0 0 0 525 0 0 0 0 0 0 0 0
+0 0 0 0 0 525 0 525 0 0 0 525 0 0 0 0 0 0 0 0 0 0 0 525 0 0 0 0 0 0
+525 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 525 0 0 0 0 0 0 0
+525]
/Encoding <</Type /Encoding
-/Differences [0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0
-/g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g1D
-/g0 /g0 /g0 /g21 /g0 /g0 /g0 /g0 /g26 /g27 /g28 /g29 /g0 /g0 /g0 /g0
-/g0 /g0 /g30 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g3E
-/g0 /g40 /g0 /g0 /g0 /g44 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0
-/g50 /g0 /g0 /g0 /g0 /g0 /g0 /g57 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0
-/g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g6E /g0 /g0 /g0
-/g0 /g0 /g0 /g0 /g76 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0
-/g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0
-/g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0
-/g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0
-/g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0
-/g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0
-/g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0
-/g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0
-/g0 /g0 /g0 /g0 /g0 /g0]>>
+/Differences [0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0
+/g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g1D
+/g0 /g0 /g0 /g21 /g0 /g0 /g0 /g0 /g26 /g27 /g28 /g29 /g0 /g0 /g0 /g0
+/g0 /g0 /g30 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g3E
+/g0 /g40 /g0 /g0 /g0 /g44 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0
+/g50 /g0 /g0 /g0 /g0 /g0 /g0 /g57 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0
+/g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g0 /g6E /g0 /g0 /g0
+/g0 /g0 /g0 /g0 /g76]>>
/CharProcs <</g0 9 0 R
/g1D 10 0 R
/g21 11 0 R
.......

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2287393002

Review-Url: https://codereview.chromium.org/2287393002
/external/skia/src/pdf/SkPDFFont.cpp
4871f2277738fa7e9232d25424c008b36dae4711 26-Aug-2016 halcanary <halcanary@google.com> 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
/external/skia/src/pdf/SkPDFFont.cpp
650e20d705a39eaa861cfbc821e9e1f81cef5316 25-Aug-2016 halcanary <halcanary@google.com> SkPDF: Stop `#include PREPROCESSOR_DEFINE` pattern

No more:
#include SK_SFNTLY_SUBSETTER
#include ZLIB_INCLUDE

Also, rename SK_SFNTLY_SUBSETTER to SK_PDF_USE_SFNTLY
to follow my pattern of prefixing SkPDF-specific defines
with 'SK_PDF_'.

The ZLIB_INCLUDE define is no longer is used by anyone.

TODO: rename Sfntly to something pronounceable.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2273343002

Review-Url: https://codereview.chromium.org/2273343002
/external/skia/src/pdf/SkPDFFont.cpp
e59cb1c1f1ab8f0a610889f4de9b3f20e174a94d 24-Aug-2016 halcanary <halcanary@google.com> SkPDF: set SK_SFNTLY_SUBSETTER uniformly

When Skia is built into the Android framework,
SK_SFNTLY_SUBSETTER="sample/chromium/font_subsetter.h".
This #includes the same value for GOOGLE3.

Once Chrome is also using this value, we can do away with
the `#ifdef GOOGLE3` line.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2272103002

Review-Url: https://codereview.chromium.org/2272103002
/external/skia/src/pdf/SkPDFFont.cpp
6321381d18f9d478598c0996c1380633003961dd 24-Aug-2016 mtklein <mtklein@chromium.org> GN: more optional components: jpeg, pdf, png, xml

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2267343004

Review-Url: https://codereview.chromium.org/2267343004
/external/skia/src/pdf/SkPDFFont.cpp
530032a18e373ee673ae96fdbfa1fae6292f8f08 18-Aug-2016 halcanary <halcanary@google.com> SkPDF: in-place font subsetting

Motivation: gross code simplification, also no bitset lookups at draw time.

SkPDFFont owns its glyph useage bitset.

SkPDFSubstituteMap goes away.

SkPDFObject interface is simplified.

SkPDFDocument tracks font usage (as hash set), not glyph usage.

SkPDFFont gets a simpler constructor.

SkPDFFont has first and last glyph set in constructor, not adjusted later.

SkPDFFont implementations are simplified.

SkPDFGlyphSet is replaced with simple SkBitSet.

SkPDFFont sizes its SkBitSets based on glyph count.

SkPDFGlyphSetMap goes away.

SkBitSet is now non-copyable.

SkBitSet now how utility methods to match old SkPDFGlyphSet.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2253283004

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Release-GDI-Trybot,Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Debug-GDI-Trybot

Review-Url: https://codereview.chromium.org/2253283004
/external/skia/src/pdf/SkPDFFont.cpp
cee13425b5cd862189d1e5d7cf8f258bccae5f5d 18-Aug-2016 halcanary <halcanary@google.com> SkPDF: cache metrics once.

Motivation: drawText can look up unicode mapping at draw time to see
if ActualText should be used after crrev.com/2084533004 lands.

For each SkTypeface, only call getAdvancedTypefaceMetrics() once per
document. Cache the result in the SkPDFCanon, indexed by SkFontID.
Also cache PDF FontDescriptors in the canon, also indexed by SkFontID
(Type1 fonts only).

Simplify PDF font lookup, map SkFontID+SkGlyphID into a uint64_t. Map
that uint64_t to SkPDFFonts. Remove SkPDFCanon::findFont(),
SkPDFCanon::addFont(), SkPDFFont::IsMatch(), and enum SkPDFFont::Match.

SkPDFFont no longer holds on to ref of SkAdvancedTypefaceMetrics.
Instead, SkPDFFont::GetFontResource() and SkPDFFont::getFontSubset()
get metrics from canon.

SkPDFFont multybite bool is now a function of type.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2253993002

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Release-GDI-Trybot,Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Debug-GDI-Trybot

Review-Url: https://codereview.chromium.org/2253993002
/external/skia/src/pdf/SkPDFFont.cpp
671fec43e51533b9969502c072cd29d88ebef6ea 18-Aug-2016 robertphillips <robertphillips@google.com> Revert of SkPDF: cache metrics once. (patchset #4 id:60001 of https://codereview.chromium.org/2253993002/ )

Reason for revert:
because

Original issue's description:
> SkPDF: cache metrics once.
>
> Motivation: drawText can look up unicode mapping at draw time to see
> if ActualText should be used after crrev.com/2084533004 lands.
>
> For each SkTypeface, only call getAdvancedTypefaceMetrics() once per
> document. Cache the result in the SkPDFCanon, indexed by SkFontID.
> Also cache PDF FontDescriptors in the canon, also indexed by SkFontID
> (Type1 fonts only).
>
> Simplify PDF font lookup, map SkFontID+SkGlyphID into a uint64_t. Map
> that uint64_t to SkPDFFonts. Remove SkPDFCanon::findFont(),
> SkPDFCanon::addFont(), SkPDFFont::IsMatch(), and enum SkPDFFont::Match.
>
> SkPDFFont no longer holds on to ref of SkAdvancedTypefaceMetrics.
> Instead, SkPDFFont::GetFontResource() and SkPDFFont::getFontSubset()
> get metrics from canon.
>
> SkPDFFont multybite bool is now a function of type.
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2253993002
>
> Committed: https://skia.googlesource.com/skia/+/0a61270f4ba85d10659fb63a86817b435ec04c94

TBR=bungeman@google.com,halcanary@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2251813006
/external/skia/src/pdf/SkPDFFont.cpp
0a61270f4ba85d10659fb63a86817b435ec04c94 17-Aug-2016 halcanary <halcanary@google.com> SkPDF: cache metrics once.

Motivation: drawText can look up unicode mapping at draw time to see
if ActualText should be used after crrev.com/2084533004 lands.

For each SkTypeface, only call getAdvancedTypefaceMetrics() once per
document. Cache the result in the SkPDFCanon, indexed by SkFontID.
Also cache PDF FontDescriptors in the canon, also indexed by SkFontID
(Type1 fonts only).

Simplify PDF font lookup, map SkFontID+SkGlyphID into a uint64_t. Map
that uint64_t to SkPDFFonts. Remove SkPDFCanon::findFont(),
SkPDFCanon::addFont(), SkPDFFont::IsMatch(), and enum SkPDFFont::Match.

SkPDFFont no longer holds on to ref of SkAdvancedTypefaceMetrics.
Instead, SkPDFFont::GetFontResource() and SkPDFFont::getFontSubset()
get metrics from canon.

SkPDFFont multybite bool is now a function of type.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2253993002

Review-Url: https://codereview.chromium.org/2253993002
/external/skia/src/pdf/SkPDFFont.cpp
86b6eabeae80c3db69226cd1693d7f1c4591d88e 17-Aug-2016 halcanary <halcanary@google.com> SkPDF: pull out SkPDFMakeCIDGlyphWidthsArray.cpp

Extract from inside SkPDFFont.cpp
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2251803002

Review-Url: https://codereview.chromium.org/2251803002
/external/skia/src/pdf/SkPDFFont.cpp
6c80a9d4b06e10a2865731c487a537d34963268a 16-Aug-2016 halcanary <halcanary@google.com> SkPDF: Font names need escaping

NOTRY=true

Review-Url: https://codereview.chromium.org/2250763002
/external/skia/src/pdf/SkPDFFont.cpp
28c6d83c98473a24b8d0b0d279c43fd37ff24055 16-Aug-2016 halcanary <halcanary@google.com> SkPDF: eliminate SkPDFCIDfont class

get_glyph_widths() and set_glyph_widths() combined.

set_glyph_widths() now takes a SkPDFGlyphSet*.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2244173005

Review-Url: https://codereview.chromium.org/2244173005
/external/skia/src/pdf/SkPDFFont.cpp
3287588a467ee579c3947fe13c6add5048b14aa9 16-Aug-2016 halcanary <halcanary@google.com> SkPDF: SkPDFFont class changes

SkPDFFont:
* inline some one-line methdods.
- SkPDFFont::typeface()
- SkPDFFont::fontInfo()
- SkPDFFont::firstGlyphID()
- SkPDFFont::lastGlyphID()
- SkPDFFont::getFontDescriptor()
* de-virtualize some methods:
- SkPDFFont::getType()
- SkPDFFont::multiByteGlyphs()
* Constructor takes more arguments:
fontType, multiByteGlyphs
* re-order fields (pointers before shorts)
* use sk_sp<T> more, T* less

SkAdvancedTypefaceMetrics:
* SkAdvancedTypefaceMetrics::fFont now a uint8_t
* other enumes are sized.
* SkAdvancedTypefaceMetrics::fStyle now big enough.
* remove use of SkTBitOr, replaced with fancy templates

No public API changes.
TBR=reed@google.com

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2246903002

Review-Url: https://codereview.chromium.org/2246903002
/external/skia/src/pdf/SkPDFFont.cpp
4ed2f01cf6f3a63d5185ea5b442549d20ce2ec16 16-Aug-2016 halcanary <halcanary@google.com> SkPDF: unify drawText and drawPosText

Motivation: a later CL will add drawTextBlob() (after
https://crrev.com/2084533004 lands). This CL is designed
with that change in mind. Also fewer redundant lines of
code.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2241683005

Committed: https://skia.googlesource.com/skia/+/6059dc32fe36358175cb81541c91e74a2a7e771a
Review-Url: https://codereview.chromium.org/2241683005
/external/skia/src/pdf/SkPDFFont.cpp
5ba165ee9cd8dc5ea0d10f6a035a3d0cf7c132cd 16-Aug-2016 robertphillips <robertphillips@google.com> Revert of SkPDF: unify drawText and drawPosText (patchset #2 id:40001 of https://codereview.chromium.org/2241683005/ )

Reason for revert:
I believe this is breaking the Google3 roll

Original issue's description:
> SkPDF: unify drawText and drawPosText
>
> Motivation: a later CL will add drawTextBlob() (after
> https://crrev.com/2084533004 lands). This CL is designed
> with that change in mind. Also fewer redundant lines of
> code.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2241683005
>
> Committed: https://skia.googlesource.com/skia/+/6059dc32fe36358175cb81541c91e74a2a7e771a

TBR=bungeman@google.com,halcanary@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2248923002
/external/skia/src/pdf/SkPDFFont.cpp
6059dc32fe36358175cb81541c91e74a2a7e771a 15-Aug-2016 halcanary <halcanary@google.com> SkPDF: unify drawText and drawPosText

Motivation: a later CL will add drawTextBlob() (after
https://crrev.com/2084533004 lands). This CL is designed
with that change in mind. Also fewer redundant lines of
code.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2241683005

Review-Url: https://codereview.chromium.org/2241683005
/external/skia/src/pdf/SkPDFFont.cpp
7e8d5d3519ea2d4c7f158ff9737843e20daad0cb 12-Aug-2016 halcanary <halcanary@google.com> SkPDF: Subset Type3 (fallback) font

Motivation: significant file-size reduction.

Also: SkPDFFont::subsetFont() returns a sk_sp<SkPDFObject>
rather than a SkPDFFont*.

SkPDFType3Font constructor no longer populates font info;
relies on subsetting.

SkPDFFont::Create is easier to read

Also: SkPDFType3Font are scaled by emSize rather than 1000.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2231483002

Committed: https://skia.googlesource.com/skia/+/88b138da99328b04cae9a8ee19c3882b8847a550
Review-Url: https://codereview.chromium.org/2231483002
/external/skia/src/pdf/SkPDFFont.cpp
5bf60adaaf76a102514b420a4acff6083902dabc 11-Aug-2016 halcanary <halcanary@google.com> Revert of SkPDF: Subset Type3 (fallback) font (patchset #8 id:200001 of https://codereview.chromium.org/2231483002/ )

Reason for revert:
internal failing

Original issue's description:
> SkPDF: Subset Type3 (fallback) font
>
> Motivation: significant file-size reduction.
>
> Also: SkPDFFont::subsetFont() returns a sk_sp<SkPDFObject>
> rather than a SkPDFFont*.
>
> SkPDFType3Font constructor no longer populates font info;
> relies on subsetting.
>
> SkPDFFont::Create is easier to read
>
> Also: SkPDFType3Font are scaled by emSize rather than 1000.
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2231483002
>
> Committed: https://skia.googlesource.com/skia/+/88b138da99328b04cae9a8ee19c3882b8847a550

TBR=bungeman@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2232283003
/external/skia/src/pdf/SkPDFFont.cpp
88b138da99328b04cae9a8ee19c3882b8847a550 11-Aug-2016 halcanary <halcanary@google.com> SkPDF: Subset Type3 (fallback) font

Motivation: significant file-size reduction.

Also: SkPDFFont::subsetFont() returns a sk_sp<SkPDFObject>
rather than a SkPDFFont*.

SkPDFType3Font constructor no longer populates font info;
relies on subsetting.

SkPDFFont::Create is easier to read

Also: SkPDFType3Font are scaled by emSize rather than 1000.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2231483002

Review-Url: https://codereview.chromium.org/2231483002
/external/skia/src/pdf/SkPDFFont.cpp
8eccc308c8adcdf26ffc7c4dd538b71f33c6f22b 09-Aug-2016 halcanary <halcanary@google.com> SkPDF: SkPDFFont organization changes.

SkPDFFont:
- SkPDFType1Font::populate() encode advances correctly.
- break out logically independent code into new files:
* SkPDFConvertType1FontStream
* SkPDFMakeToUnicodeCmap
SkPDFFont.cpp is now 380 lines smaller.
Expose `SkPDFAppendCmapSections()` for testing.

SkPDFFontImpl.h
- Fold into SkPDFFont.

SkPDFConvertType1FontStream:
- Now assume given a SkStreamAsset

SkPDFFont:
- AdvanceMetric now hidden in a anonymous namespace.

No public API changes.
TBR=reed@google.com

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2221163002

Review-Url: https://codereview.chromium.org/2221163002
/external/skia/src/pdf/SkPDFFont.cpp
8b1d32c8d017c84828ed65af38cd1f1e7075ce08 08-Aug-2016 halcanary <halcanary@google.com> SkPDF/SkAdvancedTypefaceMetrics: simplify ATM, PDF takes over

No public API changes.
TBR=reed@google.com

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2222523003

Review-Url: https://codereview.chromium.org/2222523003
/external/skia/src/pdf/SkPDFFont.cpp
462d0148a5c9433a1f9c26d947a07ca7f70cf09d 05-Aug-2016 halcanary <halcanary@google.com> SkPDF: Stop using kHAdvance_PerGlyphInfo

SkPDFFont:
- never request kHAdvance_PerGlyphInfo from typeface.
- set_glyph_widths() fn uses a glyph cache to get advances.
- stop expecting vertical advances that are never requested.
- composeAdvanceData() now non-templated
- appendAdvance() one-line function removed

SkPDFDevice:
- use a glyph cache for getting repeated advances.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2219733004

Review-Url: https://codereview.chromium.org/2219733004
/external/skia/src/pdf/SkPDFFont.cpp
38d909ec2875f79952de08f36adfaac5680d2c53 02-Aug-2016 bungeman <bungeman@google.com> Move off SK_SUPPORT_LEGACY_DATA_FACTORIES.

This moves Skia code off of SK_SUPPORT_LEGACY_DATA_FACTORIES.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2206633004

Review-Url: https://codereview.chromium.org/2206633004
/external/skia/src/pdf/SkPDFFont.cpp
fa25106f02f26d7a149cfe57c1d4756372e0755c 29-Jul-2016 halcanary <halcanary@google.com> SkPDF: PDFStream has-a not is-a PDFDict

Motivation:
SkPDFStream and SkPDFSharedStream now work the same.

Also:
- move SkPDFStream into SkPDFTypes (it's a fundamental PDF type).
- minor refactor of SkPDFSharedStream
- SkPDFSharedStream takes unique_ptr to represent ownership

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2190883003

Review-Url: https://codereview.chromium.org/2190883003
/external/skia/src/pdf/SkPDFFont.cpp
fe8f0e0d3126d27fe9fdd5bc4804392492f14e51 27-Jul-2016 halcanary <halcanary@google.com> SkPDF: refactor font subset: fewer copies

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2190643002

Review-Url: https://codereview.chromium.org/2190643002
/external/skia/src/pdf/SkPDFFont.cpp
ac0e00dceca10dc7ce30c5be66001bd6960ebf5c 27-Jul-2016 halcanary <halcanary@google.com> SkPDF: SkPDFStream takes a unique_ptr

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2188623004

Review-Url: https://codereview.chromium.org/2188623004
/external/skia/src/pdf/SkPDFFont.cpp
39f988eb415bd697ce11933ca2a341ae6fbf9030 15-Jul-2016 halcanary <halcanary@google.com> SkPDF: Always give a default advance for glyphs.

Prior to this we assumed the default default was 0. It is
actually 1000, according to the spec.

fixes BUG=skia:5321
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2146403005

Review-Url: https://codereview.chromium.org/2146403005
/external/skia/src/pdf/SkPDFFont.cpp
a76a10b730ae3fb2abb7c06839ca9c5d14df5ca7 07-Jul-2016 halcanary <halcanary@google.com> SkPDF: Fix encoding of unichr outside of basic plane

In ToUnicode table, write unicode codepoints as one or two UTF16BE
values, rather than a single hex, as the standard requires.

Factor out uint16 -> big-endian hex code.

SkUtils is now a namespace.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2120533002

Review-Url: https://codereview.chromium.org/2120533002
/external/skia/src/pdf/SkPDFFont.cpp
3c35fb3310c22eb0141c8f39c5423f7bcd42adff 30-Jun-2016 halcanary <halcanary@google.com> SkPDF: Glyph Useage Map improvements

Instead of having a fFontGlyphUsage on each device and one on each
document, just have the one on the document, and never merge.

Make fGlyphUsage accesible on SkPDFDocument.

Remove SkPDFGlyphSetMap::merge, ::reset, and SkPDFGlyphSet::merge.

SkPDFGlyphSetMap has an TArray of SkPDFGlyphSet, not TDArray of
SkPDFGlyphSet pointers. SkPDFGlyphSet and SkPDFBitset get move
constructors.

All tests produce exactly identical output PDFs.

BUG=skia:5434
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2112943002

Review-Url: https://codereview.chromium.org/2112943002
/external/skia/src/pdf/SkPDFFont.cpp
29ed2ae2daa843c8ef955df34b26e672c67b14f3 29-Jun-2016 halcanary <halcanary@google.com> SkPDF: SkPDFStream takes only SkStreamAsset

This is possible since https://crrev.com/869763002. Later, I'll clean
up the logic and class constructors. For now, I assert everywhere I
expect a SkStreamAsset to be well-behaved (duplcate, hasLength).
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2098393002

Review-Url: https://codereview.chromium.org/2098393002
/external/skia/src/pdf/SkPDFFont.cpp
b8d6af169bf631dcb68ba5a796436434ff78be65 29-Jun-2016 martina.kollarova <martina.kollarova@intel.com> Remove unnecessary includes in src/pdf/

Use forward declaration more.

BUG=None
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2110033002

Review-Url: https://codereview.chromium.org/2110033002
/external/skia/src/pdf/SkPDFFont.cpp
13b9c95295f4c5732e34574789e721a6bc08f7b4 12-May-2016 bungeman <bungeman@google.com> Move SkTypeface to sk_sp.

Committed: https://skia.googlesource.com/skia/+/6296da736fbf40aae881650c239420f64e576c3f
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1933393002

Review-Url: https://codereview.chromium.org/1933393002
/external/skia/src/pdf/SkPDFFont.cpp
9a9a7b29e5e5916a7b6453cd124ca437f14b9da4 12-May-2016 scroggo <scroggo@google.com> Revert of Move SkTypeface to sk_sp. (patchset #5 id:80001 of https://codereview.chromium.org/1933393002/ )

Reason for revert:
fontmgr_iterAndroid failing to draw emoji. E.g. https://gold.skia.org/search2?blame=6296da736fbf40aae881650c239420f64e576c3f&unt=true&head=true&query=source_type%3Dgm

Original issue's description:
> Move SkTypeface to sk_sp.
>
> Committed: https://skia.googlesource.com/skia/+/6296da736fbf40aae881650c239420f64e576c3f

TBR=reed@google.com,fmalita@chromium.org,tomhudson@google.com,bungeman@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/1974783002
/external/skia/src/pdf/SkPDFFont.cpp
6296da736fbf40aae881650c239420f64e576c3f 11-May-2016 bungeman <bungeman@google.com> Move SkTypeface to sk_sp.

Review-Url: https://codereview.chromium.org/1933393002
/external/skia/src/pdf/SkPDFFont.cpp
e20a87517043ec4a30dcc7e711ca49087e8942ff 09-May-2016 halcanary <halcanary@google.com> SkAdvancedTypefaceMetrics: abstract out linked list

+ use SkSinglyLinkedList<T>
+ move SkSinglyLinkedList.h to core
+ remove SkHackyAutoTDelete
+ getAdvanceData() -> setGlyphWidths()
+ finishRange no longer templated
+ remove unused templated functions

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1953153004

Review-Url: https://codereview.chromium.org/1953153004
/external/skia/src/pdf/SkPDFFont.cpp
3243143f25f4ccba632847574cf8e1a8ee0fe0f2 30-Mar-2016 halcanary <halcanary@google.com> SkPDF: SkTypeface::openStream could return nullptr

Speculative fix for hard-to-reproduce bug.

BUG=163892
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1842163002

Review URL: https://codereview.chromium.org/1842163002
/external/skia/src/pdf/SkPDFFont.cpp
b8fb9934a0707e8e5f9e725502974dc2d432a815 28-Mar-2016 halcanary <halcanary@google.com> SkPDF s/SkAutoTDelete/std::unique_ptr/

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1837553002

Review URL: https://codereview.chromium.org/1837553002
/external/skia/src/pdf/SkPDFFont.cpp
6b3eacb0dfaeb3374d410c8c041bd39cd066e1ea 25-Mar-2016 benjaminwagner <benjaminwagner@google.com> Change type of SkGlyph::fAdvance[XY] to float.

BUG=skia:4632
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1737693006

Review URL: https://codereview.chromium.org/1737693006
/external/skia/src/pdf/SkPDFFont.cpp
cc77c12293d1685f5e83d768b30ca9157af1576d 23-Mar-2016 halcanary <halcanary@google.com> SkPDF: Hold page objects, not SkPDFDevices.

Page Contents:
serialize early, at endPage()

SkPDFDocument:
Rather than holding all SkPDFDevices until onClose(), store
fGlyphUseage and array of pages objects.

perform_font_subsetting function removed:
First half moved to onEndPage.
Second half moved to onClose.

create_pdf_page function removed:
Merged into onEndPage.

generate_page_tree:
Refactored to use SkTArray<sk_sp<T>> over SkTDArray<T*>.
(the former is explicit about ownership, the latter is unclear.)

No longer populates a structure of objects to be dumped,
unnecessary since dump is always called after serialization.
Takes ownership of fPages and returns root of tree-ified version.
Less reference churn.

SkPDFGlyphSetMap:
use new-style iterator.

BUG=skia:5087
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1823683005

Review URL: https://codereview.chromium.org/1823683005
/external/skia/src/pdf/SkPDFFont.cpp
bae235eb07cdfeb6dd92efa2b2143fa9e91d9d04 21-Mar-2016 halcanary <halcanary@google.com> SkPDF: add drop() virtual to release resources early.

Call drop() after calling emitObject() on top-level objects. In Debug
mode, assert that each object is emited exactly once by asserting that
emitObject is never called after drop(). Same for addResources().

To make sure that top level objects don't get deleted prematurely,
SkPDFObjNumMap takes a reference.

Motivation: save RAM. Allow even earlier serialization with later
changes.

Also: Switch some SkTDArrays to SkTArrays.

BUG=skia:5087
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1790023003

Review URL: https://codereview.chromium.org/1790023003
/external/skia/src/pdf/SkPDFFont.cpp
18300a3aa7cb6eb55d21bb0450dffa58b6fc062c 16-Mar-2016 mtklein <mtklein@chromium.org> detach -> release

The C++ standard library uses the name "release" for the operation we call "detach".

Rewriting each "detach(" to "release(" brings us a step closer to using standard library types directly (e.g. std::unique_ptr instead of SkAutoTDelete).

This was a fairly blind transformation. There may have been unintentional conversions in here, but it's probably for the best to have everything uniformly say "release".

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1809733002

Review URL: https://codereview.chromium.org/1809733002
/external/skia/src/pdf/SkPDFFont.cpp
e94ea625fbce6979b7ef59255c7598e81d37f546 09-Mar-2016 halcanary <halcanary@google.com> SkPDF: use sk_ref_sp

s/sk_sp<[^>]*>(SkRef(\([^)]*\)))/sk_ref_sp(\1)/

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1777923002

Review URL: https://codereview.chromium.org/1777923002
/external/skia/src/pdf/SkPDFFont.cpp
8103a34300c5de2e85793a96c4738a33fc6eb46d 09-Mar-2016 halcanary <halcanary@google.com> SkPDF: Add sk_sp setters; .release() becomes std::move()

Note to reviewers: Start with changes to SkPDFTypes.h

Many places that had a bare pointer owning a reference are refactored to
use a sk_sp.

There remain several places where a non-owning pointer `T*` should be
replaced with `const sk_sp<T>&` to eliminate the common pattern
`sk_sp<T>(SkRef(x))`.

Committed: https://skia.googlesource.com/skia/+/9904c9212074279380e21f96575078734dbbd308
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1775043002

Review URL: https://codereview.chromium.org/1775043002
/external/skia/src/pdf/SkPDFFont.cpp
51d04d3c17954f9f8629e7d8a9fe870a7b19962f 08-Mar-2016 halcanary <halcanary@google.com> Revert of SkPDF: Add sk_sp setters; .release() becomes std::move() (patchset #2 id:20001 of https://codereview.chromium.org/1775043002/ )

Reason for revert:
https://build.chromium.org/p/client.skia/builders/Linux%20Builder/builds/6405/steps/compile/logs/stdio

Original issue's description:
> SkPDF: Add sk_sp setters; .release() becomes std::move()
>
> Note to reviewers: Start with changes to SkPDFTypes.h
>
> Many places that had a bare pointer owning a reference are refactored to
> use a sk_sp.
>
> There remain several places where a non-owning pointer `T*` should be
> replaced with `const sk_sp<T>&` to eliminate the common pattern
> `sk_sp<T>(SkRef(x))`.
>
> Committed: https://skia.googlesource.com/skia/+/9904c9212074279380e21f96575078734dbbd308

TBR=bungeman@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1775143002
/external/skia/src/pdf/SkPDFFont.cpp
9904c9212074279380e21f96575078734dbbd308 08-Mar-2016 halcanary <halcanary@google.com> SkPDF: Add sk_sp setters; .release() becomes std::move()

Note to reviewers: Start with changes to SkPDFTypes.h

Many places that had a bare pointer owning a reference are refactored to
use a sk_sp.

There remain several places where a non-owning pointer `T*` should be
replaced with `const sk_sp<T>&` to eliminate the common pattern
`sk_sp<T>(SkRef(x))`.

Review URL: https://codereview.chromium.org/1775043002
/external/skia/src/pdf/SkPDFFont.cpp
ece83924384b2e9e8cd422324c44797deb99ec90 08-Mar-2016 halcanary <halcanary@google.com> SkPDF: use sk_make_sp<T> when it makes sense.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1773033002

Review URL: https://codereview.chromium.org/1773033002
/external/skia/src/pdf/SkPDFFont.cpp
48810a023705ffac466adb93efdb3861cf2e197a 07-Mar-2016 halcanary <halcanary@google.com> SkPDF: s/SkAutoTUnref/sk_sp/g

Review URL: https://codereview.chromium.org/1771073002
/external/skia/src/pdf/SkPDFFont.cpp
fcad44bbb1e0384620e7b738a0f5904c940a6861 06-Mar-2016 halcanary <halcanary@google.com> SkPDF: AutoTUnref<T> changes in use

::detach() -> ::release()
::operator T*() -> ::get()

This makes all use of AutoTUnref work the same as sk_sp.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1772493002

Review URL: https://codereview.chromium.org/1772493002
/external/skia/src/pdf/SkPDFFont.cpp
bc348f41a7d51ba2385ca1d2d2ffab3657559d16 06-Jan-2016 benjaminwagner <benjaminwagner@google.com> In Google3 build, use SK_SFNTLY_SUBSETTER define to enable/disable sfntly.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1561753002

Review URL: https://codereview.chromium.org/1561753002
/external/skia/src/pdf/SkPDFFont.cpp
226aee25f426fa12ad16781257490cfd339fb95b 05-Jan-2016 mtklein <mtklein@chromium.org> Also ignore sfntly for Google3/iOS.

It's just complicating their build process for now.

Will follow up by removing sfntly dependency after this rolls.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1559393002

Review URL: https://codereview.chromium.org/1559393002
/external/skia/src/pdf/SkPDFFont.cpp
86ea33e96341ec3de03bcb6aef9a2cfce371df6a 26-Oct-2015 benjaminwagner <benjaminwagner@google.com> Enable BUILD file compilation of skia and dm with --config=android_arm.

Corresponding google3 cl is 105687529.

BUG=skia:

Review URL: https://codereview.chromium.org/1414643002
/external/skia/src/pdf/SkPDFFont.cpp
66a82f3872abf4ebb98b3915b2a9ecc73ad352c5 12-Oct-2015 halcanary <halcanary@google.com> SkPDF: fall back on paths for unembeddable fonts.

Add GM, SkPDFFont::CanEmbedTypeface

BUG=skia:3866

Review URL: https://codereview.chromium.org/1401763002
/external/skia/src/pdf/SkPDFFont.cpp
96fcdcc219d2a0d3579719b84b28bede76efba64 27-Aug-2015 halcanary <halcanary@google.com> Style Change: NULL->nullptr
DOCS_PREVIEW= https://skia.org/?cl=1316233002

Review URL: https://codereview.chromium.org/1316233002
/external/skia/src/pdf/SkPDFFont.cpp
725c62054354dc0c7fb699bcd69687ec78083ae8 20-Aug-2015 halcanary <halcanary@google.com> SkPDF: Memory improvements for PDF Streams

ΔMEM = -15%
ΔCPU = -7%

BUG=skia:3030

Review URL: https://codereview.chromium.org/1227913008
/external/skia/src/pdf/SkPDFFont.cpp
99fe82260633fcf5d92cca38d12ef0937ecca61c 20-Aug-2015 bungeman <bungeman@google.com> Use static_assert instead of SK_COMPILE_ASSERT.

Now that static_assert is allowed, there is no need to use a non-
standard compile time assertion

Review URL: https://codereview.chromium.org/1306443004
/external/skia/src/pdf/SkPDFFont.cpp
a060eba0836f98902ca078d5f9fc6191ba0c0a52 19-Aug-2015 halcanary <halcanary@google.com> SkPDF: Simplify PDFStream / emitObject() const

Compress SkPDFStream's data on setData(), not emitObject(); no longer stateful.

SkPDFObject::emitObject is now const. This makes it easier to reason about state.

Minimal performance gains.

Review URL: https://codereview.chromium.org/1304493002
/external/skia/src/pdf/SkPDFFont.cpp
8e0c1500a78f450115ce1a8de438d66e2e892cdc 07-Jul-2015 robertphillips <robertphillips@google.com> Propagate SkSurfaceProps when known

This CL just closes the loop on some low hanging fruit w.r.t. propagating surface properties.

Review URL: https://codereview.chromium.org/1214853025
/external/skia/src/pdf/SkPDFFont.cpp
6b7f34e34cc0ce397ce5e4ddc0c244f372b4f840 17-Jun-2015 reed <reed@google.com> simplify release-proc for SkData, removing unneeded size param

request https://codereview.chromium.org/1184953005 to land first

BUG=skia:

Review URL: https://codereview.chromium.org/1193553002
/external/skia/src/pdf/SkPDFFont.cpp
41868fe5625fc3bd70daa3f461c881b5db6a9265 20-May-2015 bungeman <bungeman@google.com> Font variations.

Multiple Master and TrueType fonts support variation axes.
This implements back-end support for axes on platforms which
support it.

Committed: https://skia.googlesource.com/skia/+/05773ed30920c0214d1433c07cf6360a05476c97

Committed: https://skia.googlesource.com/skia/+/3489ee0f4fa34f124f9de090d12bdc2107d52aa9

Review URL: https://codereview.chromium.org/1027373002
/external/skia/src/pdf/SkPDFFont.cpp
7be0ce0ab123bbad8ec22b67b8593f1bdd5179e0 18-May-2015 halcanary <halcanary@google.com> SkPDF: Add Sfntly to DEPS, gyp

Note: this can be disabled via:
GYP_DEFINES='skia_pdf_use_sfntly=0

Warning: dm is 34% slower and uses 9% more memory. This is
okay.

Motivation: We want to test this code path in DM, since it is
always used by Chromium and Android.

BUG=skia:3563

Committed: https://skia.googlesource.com/skia/+/6a53b04e26749ea61f690ece408f2a1c0a5ad5bb

Review URL: https://codereview.chromium.org/1134683006
/external/skia/src/pdf/SkPDFFont.cpp
9bedfc23fe01bed5ea939f860d64e57e6333abe7 18-May-2015 halcanary <halcanary@google.com> Revert of SkPDF: Add Sfntly to DEPS, gyp, SkUserConfig (patchset #7 id:570001 of https://codereview.chromium.org/1134683006/)

Reason for revert:
break cros build

Original issue's description:
> SkPDF: Add Sfntly to DEPS, gyp
>
> Note: this can be disabled via:
> GYP_DEFINES='skia_pdf_use_sfntly=0
>
> Warning: dm is 34% slower and uses 9% more memory. This is
> okay.
>
> Motivation: We want to test this code path in DM, since it is
> always used by Chromium and Android.
>
> BUG=skia:3563
>
> Committed: https://skia.googlesource.com/skia/+/6a53b04e26749ea61f690ece408f2a1c0a5ad5bb

TBR=reed@google.com,mtklein@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:3563

Review URL: https://codereview.chromium.org/1128353004
/external/skia/src/pdf/SkPDFFont.cpp
6a53b04e26749ea61f690ece408f2a1c0a5ad5bb 18-May-2015 halcanary <halcanary@google.com> SkPDF: Add Sfntly to DEPS, gyp

Note: this can be disabled via:
GYP_DEFINES='skia_pdf_use_sfntly=0

Warning: dm is 34% slower and uses 9% more memory. This is
okay.

Motivation: We want to test this code path in DM, since it is
always used by Chromium and Android.

BUG=skia:3563

Review URL: https://codereview.chromium.org/1134683006
/external/skia/src/pdf/SkPDFFont.cpp
465706820d0d373f76ab4831c286115ee0d86b7a 15-May-2015 robertphillips <robertphillips@google.com> Revert of Font variations. (patchset #26 id:500001 of https://codereview.chromium.org/1027373002/)

Reason for revert:
Appears to be breaking Linux ARM bots:

FAILED:
/usr/local/google/home/mosaic-role/slave/repo_clients/chromium_tot/chromium/src/../../prebuilt/toolchain/armv7a/bin/armv7a-cros-linux-gnueabi-g++
... -o obj/third_party/skia/src/ports/skia_library.SkFontHost_FreeType.o
../../third_party/skia/src/ports/SkFontHost_FreeType.cpp:37:31: fatal error:
freetype/ftmm.h: No such file or directory
#include FT_MULTIPLE_MASTERS_H
^
compilation terminated.

Original issue's description:
> Font variations.
>
> Multiple Master and TrueType fonts support variation axes.
> This implements back-end support for axes on platforms which
> support it.
>
> Committed: https://skia.googlesource.com/skia/+/05773ed30920c0214d1433c07cf6360a05476c97
>
> Committed: https://skia.googlesource.com/skia/+/3489ee0f4fa34f124f9de090d12bdc2107d52aa9

TBR=reed@google.com,mtklein@google.com,djsollen@google.com,halcanary@google.com,bungeman@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1139123008
/external/skia/src/pdf/SkPDFFont.cpp
3489ee0f4fa34f124f9de090d12bdc2107d52aa9 14-May-2015 bungeman <bungeman@google.com> Font variations.

Multiple Master and TrueType fonts support variation axes.
This implements back-end support for axes on platforms which
support it.

Committed: https://skia.googlesource.com/skia/+/05773ed30920c0214d1433c07cf6360a05476c97

Review URL: https://codereview.chromium.org/1027373002
/external/skia/src/pdf/SkPDFFont.cpp
5ae1312c9faa25531c07e591b4dff6804020f121 13-May-2015 bungeman <bungeman@google.com> Revert of Font variations. (patchset #21 id:400001 of https://codereview.chromium.org/1027373002/)

Reason for revert:
Mac failing to build due to CFNumberType in Chromium Canary.

Original issue's description:
> Font variations.
>
> Multiple Master and TrueType fonts support variation axes.
> This implements back-end support for axes on platforms which
> support it.
>
> Committed: https://skia.googlesource.com/skia/+/05773ed30920c0214d1433c07cf6360a05476c97

TBR=reed@google.com,mtklein@google.com,djsollen@google.com,halcanary@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1128913008
/external/skia/src/pdf/SkPDFFont.cpp
05773ed30920c0214d1433c07cf6360a05476c97 13-May-2015 bungeman <bungeman@google.com> Font variations.

Multiple Master and TrueType fonts support variation axes.
This implements back-end support for axes on platforms which
support it.

Review URL: https://codereview.chromium.org/1027373002
/external/skia/src/pdf/SkPDFFont.cpp
d9950091efab9083692b728a45d84f42fa66e5f2 12-May-2015 reed <reed@google.com> PerGlyphInfo is on SkTypeface

BUG=skia:
NOTRY=True
NOTREECHECKS=True
TBR=

Review URL: https://codereview.chromium.org/1128023004
/external/skia/src/pdf/SkPDFFont.cpp
1ebf0d2edc48f886521e6f03af78ef5da24c7982 12-May-2015 reed <reed@google.com> fix reference to _PerGlyphInfo

BUG=skia:
TBR=bungeman@google.com
NOTRY=True
NOTREECHECKS=True

Review URL: https://codereview.chromium.org/1136283004
/external/skia/src/pdf/SkPDFFont.cpp
39a9a5069b25aa8b9529118cfd0ece5f412fb56b 12-May-2015 reed <reed@google.com> Make SkAdvancedTypefaceMetrics private.

Review URL: https://codereview.chromium.org/1129283003
/external/skia/src/pdf/SkPDFFont.cpp
bc4696b9176e05940a7c2d6778276cdbc55ccd61 06-May-2015 halcanary <halcanary@google.com> SkPDF: Move utility fns to SkPDFUtils

BUG=skia:3585

Review URL: https://codereview.chromium.org/1124193003
/external/skia/src/pdf/SkPDFFont.cpp
bf51cfdbd9e41a2e9e2d16dc8d97ac74d9dd84da 05-May-2015 halcanary <halcanary@google.com> SkPDF: clean up uses of deprecated calls in SkPDFFont

BUG=skia:3585

Review URL: https://codereview.chromium.org/1110533002
/external/skia/src/pdf/SkPDFFont.cpp
130444fdaf737c5931a934018ab50b0c91a3499e 25-Apr-2015 halcanary <halcanary@google.com> SkPDF: Refactor SkPDFObject heiararchy.

Flatten and use a tagged union type

Δmemory ~= -2.4% ± 0.5%
Δtime ~= -1.2% ± 0.2%

BUG=skia:3585

Review URL: https://codereview.chromium.org/1069103003
/external/skia/src/pdf/SkPDFFont.cpp
37c46cad21632cfc1411b08d73af37a1fffe2944 31-Mar-2015 halcanary <halcanary@google.com> SkPDF: Factor SkPDFCatalog into SkPDFObjNumMap and SkPDFSubstituteMap

Motivation: Keep separate features separate. Also, future
linearization work will need to have several objNumMap
objects share a substituteMap. Also "catalog" has a
specific meaning in PDF. This catalog did not map to that
catalog.

- Modify SkPDFObject::emitObject and SkPDFObject::addResources
interface to requiore SkPDFObjNumMap and SkPDFSubstituteMap.
- SkPDFObjNumMap const in SkPDFObject::emitObject.
- Remove SkPDFCatalog.cpp/.h
- Modify SkDocument_PDF.cpp to use new functions
- Fold in SkPDFStream::populate
- Fold in SkPDFBitmap::emitDict
- Move SkPDFObjNumMap and SkPDFSubstituteMap to SkPDFTypes.h
- Note (via assert) that SkPDFArray & SkPDFDict don't need to
check substitutes.
- Remove extra space from SkPDFDict serialization.
- SkPDFBitmap SkPDFType0Font SkPDFGraphicState SkPDFStream
updated to new interface.
- PDFPrimitivesTest updated for new interface.

BUG=skia:3585

Review URL: https://codereview.chromium.org/1049753002
/external/skia/src/pdf/SkPDFFont.cpp
2e3f9d8a9309686eeb4c76ccfde5800da87a68b3 27-Feb-2015 halcanary <halcanary@google.com> PDF: Canon now owns a reference to all interned objects

Add SkPDFCanon::reset function to unref all objects.

No longer possible to remove object from canon

Motivation: this doesn't change these object's lifetime, (they will
still be fully unrefed when SkDocument::close() is called, but we no
longer have to remove them from the array when their destructor is
called.

Review URL: https://codereview.chromium.org/966863002
/external/skia/src/pdf/SkPDFFont.cpp
792c80f5a7b66e75d42664ccb298f31962c6654c 20-Feb-2015 halcanary <halcanary@google.com> PDF: Now threadsafe!

The PDF canvas is now just as threadsafe as any other Skia canvas.

DM updated to thread PDF tests.

SkDocument_PDF now owns SkPDFCanon, and pointers to that canon are
passed around to all classes that need access to the canon.

BUG=skia:2683

Review URL: https://codereview.chromium.org/944643002
/external/skia/src/pdf/SkPDFFont.cpp
d1371a6019189820653aaf20f72ee8f5d0ee3fef 17-Feb-2015 mtklein <mtklein@chromium.org> Upstream support for sfntly in Google3

See cr/86110021.

BUG=skia:

Review URL: https://codereview.chromium.org/913143007
/external/skia/src/pdf/SkPDFFont.cpp
bf799cd228282431e6311900dd383083f8af7164 10-Feb-2015 halcanary <halcanary@google.com> Simplify reference management in SkPDF

Prior to this change, SkPDFObject subclasses were required
to track their resources separately from the document
structure. (An object has a resource if it depends, via an
indirect reference, on another object). This led to a lot
of extra code to duplicate effort. I replace the
getResources() function with the much simpler addResources()
function. I only define a non-trivial addResources() method
on arrays, dictionaries, and indirect object references.
All other specialized classes simply rely on their parent
class's implementation.

SkPDFObject::addResources() works by recursively walking the
directed graph of object (direct and indirect) references
and adding resources to a set. It doesn't matter that there
are closed loops in the graph, since we check the set before
walking down a branch.

- Add SkPDFObject::addResources() virtual function, with
four implementations
- Remove SkPDFObject::getResources() virtual function and
all implementations.
- Remove SkPDFObject::GetResourcesHelper()
- Remove SkPDFObject::AddResourceHelper()
- In SkPDFCatalog::findObjectIndex(), add an object to the
catalog if it doesn't exist yet.
- SkPDFCatalog::setSubstitute() no longer sets up resources
- SkPDFDocument.cpp no longer needs the Streamer object
- SkPDFDocument.cpp calls fDocCatalog->addResources to build
the resource list.
- SkPDFFont::addResource() removed
- All SkPDF-::fResource sets removed (they are redundant).
- removed SkPDFImage::addSMask() function
- SkPDFResourceDict::getReferencedResources() removed.

Motivation: this removes quite a bit of code and makes the
objects slightly slimmer in memory. Most importantly, this
will lead the way towards removing SkPDFObject's inheritance
from SkRefCnt, which will greatly simplify everything.

Testing: I usually test changes to the PDF backend by
comparing checksums of PDF files rendered from GMs and SKPs
before and after the change. This change both re-orders and
re-numbers the indirect PDF objects. I used the qpdf
program to normalize the PDFs and then compared the
normalized outputs from before and after the change; they
matched.

Review URL: https://codereview.chromium.org/870333002
/external/skia/src/pdf/SkPDFFont.cpp
a1193e4b0e34a7e4e1bd33e9708d7341679f8321 21-Jan-2015 scroggo <scroggo@google.com> Make SkStream *not* ref counted.

SkStream is a stateful object, so it does not make sense for it to have
multiple owners. Make SkStream inherit directly from SkNoncopyable.

Update methods which previously called SkStream::ref() (e.g.
SkImageDecoder::buildTileIndex() and SkFrontBufferedStream::Create(),
which required the existing owners to call SkStream::unref()) to take
ownership of their SkStream parameters and delete when done (including
on failure).

Switch all SkAutoTUnref<SkStream>s to SkAutoTDelete<SkStream>s. In some
cases this means heap allocating streams that were previously stack
allocated.

Respect ownership rules of SkTypeface::CreateFromStream() and
SkImageDecoder::buildTileIndex().

Update the comments for exceptional methods which do not affect the
ownership of their SkStream parameters (e.g.
SkPicture::CreateFromStream() and SkTypeface::Deserialize()) to be
explicit about ownership.

Remove test_stream_life, which tested that buildTileIndex() behaved
correctly when SkStream was a ref counted object. The test does not
make sense now that it is not.

In SkPDFStream, remove the SkMemoryStream member. Instead of using it,
create a new SkMemoryStream to pass to fDataStream (which is now an
SkAutoTDelete).

Make other pdf rasterizers behave like SkPDFDocumentToBitmap.

SkPDFDocumentToBitmap delete the SkStream, so do the same in the
following pdf rasterizers:

SkPopplerRasterizePDF
SkNativeRasterizePDF
SkNoRasterizePDF

Requires a change to Android, which currently treats SkStreams as ref
counted objects.

Review URL: https://codereview.chromium.org/849103004
/external/skia/src/pdf/SkPDFFont.cpp
fb62b3d423fa34c672df42f47017dbef087d19e9 21-Jan-2015 halcanary <halcanary@google.com> SkPDFCanon

SkPDFCanon's fields and methods will eventually become part of
SkPDFDocument/SkDocument_PDF. For now, it exists as a singleton to
preflight that transition. This replaces three global arrays in
SkPDFFont, SkPDFShader, and SkPDFGraphicsContext. This code is still
thread-unsafe (http://skbug.com/2683), but moving this functionality
into SkPDFDocument will fix that.

This CL does not change pdf output from either GMs or SKPs.

This change also simplifies some code around the SkPDFCanon methods.

BUG=skia:2683

Review URL: https://codereview.chromium.org/842253003
/external/skia/src/pdf/SkPDFFont.cpp
4fc48af0d7bec93a911d32330f251386a8adec98 12-Jan-2015 halcanary <halcanary@google.com> Change function signature of SkPDFObject::emitObject.

Replace virutal SkPDFObject::emitObject(s, c, true) with non-virtual
SkPDFObject::emitIndirectObject(s, c), since none of the subclasses do
(or should do) anything different.

Replace object->emitObject(s, c, false) with object->emitObject(s, c)

This is one step in simplifying the SkPDFObject interface to allow for
the next step in refactoring.

Review URL: https://codereview.chromium.org/827733004
/external/skia/src/pdf/SkPDFFont.cpp
1348dfd5df187847e991dbf6658f493c6351e1d8 18-Dec-2014 tfarina <tfarina@chromium.org> Cleanup: Remove a bunch of SkFontHost.h includes (unused).

Nobody that is including SkFontHost is using SkFontHost API, so lets
remove this includes, since the API per se is deprecated.

BUG=None
R=reed@google.com

Review URL: https://codereview.chromium.org/803733006
/external/skia/src/pdf/SkPDFFont.cpp
9880607151ca7c2dc6b1a4b9756938bd71913ab5 13-Dec-2014 bsalomon <bsalomon@google.com> Even more win64 warning fixes

Review URL: https://codereview.chromium.org/800993002
/external/skia/src/pdf/SkPDFFont.cpp
22edc8310cd57ab02155bfa6b2ddaf830556bcaf 03-Oct-2014 bungeman <bungeman@google.com> Fix int16_t for glyphs, const glyphs, and clarify glyph loop.

Several places in the PDF code are using int16_t for glyphs. With
newer NotoSans fonts, all possible glyph ids are being used, so this
can lead to problems.

The PDF glyphs from text code returns the text for the glyphs if the
encoding is for glyphs. However, it returns this using an unsafe const
cast which is hiding possible bugs and preventing correct use of const
in other places.

The way the glyph loop in SkPDFDevice::drawPosText is written uses a
'--i' in the loop, which makes it appear this can loop forever. I don't
believe it can, but it is an unecessary code folding. We should also at
least assert the forward progress correctness here.

Review URL: https://codereview.chromium.org/626613002
/external/skia/src/pdf/SkPDFFont.cpp
33a30503d76fdd989358cedd78445ba96bb809dd 11-Sep-2014 reed <reed@google.com> SkData can allocate room for its contents in the same block

BUG=skia:
R=bungeman@google.com, mtklein@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/560653004
/external/skia/src/pdf/SkPDFFont.cpp
7ba2828aa6687f9d12f4fa0b0a2ef9a9dc2efa68 28-Aug-2014 djsollen <djsollen@google.com> Fix memory leak in SkPDFType1Font

BUG=skia:2880
R=bungeman@google.com

Author: djsollen@google.com

Review URL: https://codereview.chromium.org/514313003
/external/skia/src/pdf/SkPDFFont.cpp
d6aeb6dc8fe21066f1a2c4813a4256a3acd3edf5 25-Jul-2014 bungeman <bungeman@google.com> Fix thread unsafe mutex initialization.

BUG=skia:2779
R=robertphillips@google.com, mtklein@google.com, reed@android.com, bsalomon@google.com

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/419113002
/external/skia/src/pdf/SkPDFFont.cpp
fb747e2c745896dd94425ff690483ae3838e88fe 12-Jul-2014 halcanary <halcanary@google.com> Make SkPDFFont::fFontInfo a const pointer.

BUG=skia:2742
R=djsollen@google.com, scroggo@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/383063007
/external/skia/src/pdf/SkPDFFont.cpp
67ec1f8eecfb48bc0a6ba04c0057f103c1c9696f 27-Jun-2014 halcanary <halcanary@google.com> Switch SkPDFStream's internal storage from SkStream to SkData

Motivation: This makes SkPDFStream thread-safe for two threads
serializing it at once, since a SkStream has an internal position.

Updated SkPDFFont, SkPDFGraphicState, and SkPDFPage's use of
SkPDFStream to use the SkData constructor rather than the SkStream
constructor (saving a memcpy).

BUG=skia:2683

Committed: https://skia.googlesource.com/skia/+/c1dfa14b645ae274780f026dd86c9b633fbdad06

R=mtklein@google.com, djsollen@google.com, rmistry@google.com, robertphillips@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/340783013
/external/skia/src/pdf/SkPDFFont.cpp
e1c55869f37bf7c5f365fddc38207dc3ec336b6c 26-Jun-2014 rmistry <rmistry@google.com> Revert of Switch SkPDFStream's internal storage from SkStream to SkData (https://codereview.chromium.org/340783013/)

Reason for revert:
Causes canary failures

Original issue's description:
> Switch SkPDFStream's internal storage from SkStream to SkData
>
> Motivation: This makes SkPDFStream thread-safe for two threads
> serializing it at once, since a SkStream has an internal position.
>
> Updated SkPDFFont, SkPDFGraphicState, and SkPDFPage's use of
> SkPDFStream to use the SkData constructor rather than the SkStream
> constructor (saving a memcpy).
>
> BUG=skia:2683
>
> Committed: https://skia.googlesource.com/skia/+/c1dfa14b645ae274780f026dd86c9b633fbdad06

R=mtklein@google.com, djsollen@google.com, halcanary@google.com
TBR=djsollen@google.com, halcanary@google.com, mtklein@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2683

Author: rmistry@google.com

Review URL: https://codereview.chromium.org/354043005
/external/skia/src/pdf/SkPDFFont.cpp
c1dfa14b645ae274780f026dd86c9b633fbdad06 26-Jun-2014 halcanary <halcanary@google.com> Switch SkPDFStream's internal storage from SkStream to SkData

Motivation: This makes SkPDFStream thread-safe for two threads
serializing it at once, since a SkStream has an internal position.

Updated SkPDFFont, SkPDFGraphicState, and SkPDFPage's use of
SkPDFStream to use the SkData constructor rather than the SkStream
constructor (saving a memcpy).

BUG=skia:2683
R=mtklein@google.com, djsollen@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/340783013
/external/skia/src/pdf/SkPDFFont.cpp
24480bc71ef6c754030cb3f98672da1c8fb3a63b 20-Jun-2014 halcanary <halcanary@google.com> Use SkMutex::assertHeld in SkPDFFont and SkPDFShader.

R=mtklein@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/348113002
/external/skia/src/pdf/SkPDFFont.cpp
0f9bad01b0e7ad592ffb342dcf1d238b15329be1 19-Jun-2014 vandebo <vandebo@chromium.org> [PDF] Fix font embedding restrictions.

Stop using restricted font outlines and honor don't subset restriction.

Resubmit of r12600.

R=halcanary@google.com, bungeman@google.com, reed@google.com

Author: vandebo@chromium.org

Review URL: https://codereview.chromium.org/334443002
/external/skia/src/pdf/SkPDFFont.cpp
aec406650cbfa4ef65d83db5ff4f82572e8e098f 18-Apr-2014 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> fix int/size_t warnings

patch from issue 239933002

BUG=skia:
R=bungeman@google.com

Review URL: https://codereview.chromium.org/242113010

git-svn-id: http://skia.googlecode.com/svn/trunk@14259 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
4da3bfc5b2a44a4904286683d772c584bfa09787 12-Dec-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Fix font width generation when glyph 0 is used.

Using glyph 0 caused gid 0 to be in the subset list twice, which violated an assumption in the code. Added an assert for the assumption and updated the code to not insert gid 0 into the subset list twice.

BUG=skia:1889
R=bungeman@google.com

Author: vandebo@chromium.org

Review URL: https://codereview.chromium.org/113093004

git-svn-id: http://skia.googlecode.com/svn/trunk@12632 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
1236d8e37c96339865832ceef569340283201e37 11-Dec-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Fix bug in ToUnicode table generation for Type 3 fonts.

True glyphIDs where being using in the Type3 ToUnicode table instead of IDs of 1-255. This causes poppler to complain about each entry.

BUG:skia:1565

R=bungeman@google.com

Author: vandebo@chromium.org

Review URL: https://codereview.chromium.org/112053005

git-svn-id: http://skia.googlecode.com/svn/trunk@12625 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
5f209e64057e607e260c9bb4fee02d16c5f35f98 10-Dec-2013 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert "[PDF] Fix font embedding restrictions."

This reverts r12600 and r12601, likely causing crash on Mac.

Review URL: https://codereview.chromium.org/111893002

git-svn-id: http://skia.googlecode.com/svn/trunk@12604 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
47fb2b9c67c2c4c464e8eb05e9b7877cfb1636aa 10-Dec-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Fix font embedding restrictions.

Stop using restricted font outlines and honor don't subset restriction.

R=reed@google.com, bungeman@google.com

Author: vandebo@chromium.org

Review URL: https://codereview.chromium.org/107863002

git-svn-id: http://skia.googlecode.com/svn/trunk@12600 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
456610717bbabd4f3315d2aea3a99f7e03eeda12 05-Dec-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix refcounting bug for Type1 font usage with more than 255 characters.

R=bungeman@google.com

Author: vandebo@chromium.org

Review URL: https://codereview.chromium.org/103423003

git-svn-id: http://skia.googlecode.com/svn/trunk@12520 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
1f1b4aa06a4a8f3f98d30d0ae74a091b44e7feea 11-Oct-2013 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix double ref issue in SkPDFFont ctor

https://codereview.chromium.org/26799003/



git-svn-id: http://skia.googlecode.com/svn/trunk@11724 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
2262c588023f1641d2bf1ee8a38f6055973b1a17 19-Sep-2013 skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Sanitizing source files in Housekeeper-Nightly

git-svn-id: http://skia.googlecode.com/svn/trunk@11375 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
26d2e046cd3e11cb61d1b0b3ace304a6dc8c995b 18-Sep-2013 edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> pdf: write only ToUnicode mappings needed by the font, trimming anything out of [firstChar, lastChar] interval.

R=vandebo@chromium.org

Review URL: https://codereview.chromium.org/23519006

git-svn-id: http://skia.googlecode.com/svn/trunk@11360 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
938ea62176f435a1d5899499d414d1c1e6705482 05-Sep-2013 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Rewind the font stream if font subsetting fails.

R=edisonn@google.com

Review URL: https://codereview.chromium.org/23654012

git-svn-id: http://skia.googlecode.com/svn/trunk@11116 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
3720fda4ebfc5a77cd1601992cae416d72e244b1 10-Jul-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> ARM Skia NEON patches - 09 - Bugfix





Misc: fix a PDF warning/bug on ARM

char is unsigned by default on ARM, so the (curNibble < 0) test is
always false, probably leading to a bug.

BUG=
R=djsollen@google.com, edisonn@google.com

Author: kevin.petit.arm@gmail.com

Review URL: https://chromiumcodereview.appspot.com/18365005

git-svn-id: http://skia.googlecode.com/svn/trunk@9954 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
6addb1930013ebb2f984045141650fd7afcfa90f 02-Apr-2013 edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> resubmit https://code.google.com/p/skia/source/detail?r=7883 (in the meantime we
added capability to collect minidump and callstack if buildbot fails with heap
coruption in windows, and a NPE bug was fixed in SkPDFDocument, when document was destroyed without ever beeing used and a field was NULL + a few minor conflicts have been resolved)

git-svn-id: http://skia.googlecode.com/svn/trunk@8487 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
acef3c408216f7ef41bad1532f7946dc067f2bae 20-Mar-2013 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Reverting r8233 (Use SkSet in PDF)



git-svn-id: http://skia.googlecode.com/svn/trunk@8255 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
66bedbb02dbd252f46c1fad862d0561a0bb3f94b 19-Mar-2013 edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> resubmit https://code.google.com/p/skia/source/detail?r=7883 (in the meantime we added capability to collect minidump and callstack if buildbot fails with heap coruption in windows. a few minor conflicts have been resolved)
Review URL: https://codereview.chromium.org/12840004

git-svn-id: http://skia.googlecode.com/svn/trunk@8233 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
fed86bdb8b9f037439bbfa7cdbd53a581dbc5985 14-Mar-2013 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> move most of SkFontHost to private (preceeding making it all private)

In this change, have to accomodate PDF wanting to call openStream and advancedMetrics
Review URL: https://codereview.chromium.org/12739006

git-svn-id: http://skia.googlecode.com/svn/trunk@8156 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
dcf9c19d38d366a9f27ad0d8b5bda327c5edb164 13-Mar-2013 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Always set the symbolic Flag for Fonts.

This should fix Chrome bug 124572

Review URL: https://codereview.appspot.com/7631045

git-svn-id: http://skia.googlecode.com/svn/trunk@8136 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
e2e8113baa69b5d1a0bae9652a095c1eb44b3a53 05-Mar-2013 sugoi@google.com <sugoi@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> PDF : Unused parameters cleanup

I removed unused parameters in the PDFs wherever it was trivial to do so. A few constructors had to change signature in the process to reflect the changes.
Review URL: https://codereview.appspot.com/7390056

git-svn-id: http://skia.googlecode.com/svn/trunk@7987 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
aa537d4bdb2384cdcd0644a02a2ab7fb0ecdd3b3 28-Feb-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Make SkTDArray accessors const-friendly.

This change creates const and non-const versions of SkTDArray::begin(), end(), operator[]() and getAt(). This will keep us from inadvertently changing a const SkTDArray, which the previous signatures allowed.

Review URL: https://chromiumcodereview.appspot.com/12315131

git-svn-id: http://skia.googlecode.com/svn/trunk@7902 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
5bd26d32ab85d09dccabbdc6dd944ef36ac32423 28-Feb-2013 edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> revert r7892

git-svn-id: http://skia.googlecode.com/svn/trunk@7896 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
194b7cdb5024719aeb7e2878f69b8f4b144aa9c4 27-Feb-2013 edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> resubmit after fixing assert issue: https://codereview.appspot.com/6744050

git-svn-id: http://skia.googlecode.com/svn/trunk@7892 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
d1c53aae59ee44377be8bc0cc15e54d46aa530ce 27-Feb-2013 edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert r7883

git-svn-id: http://skia.googlecode.com/svn/trunk@7884 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
676aef05ab1b8e913032648470ff483185e92b51 27-Feb-2013 edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Use SkSet to fix issue when pdf generates an exp number of resources.

The problem fixed - http://code.google.com/p/skia/issues/detail?id=940 - is that getResources will recursively obtain all child resource recursively without checking for duplicates.

If we have lots of duplicates, then we try to build a very large vector (exponential with the number of nodes usually) and sooner or later we end up using too much memory and crash.

A possible solution could have been to make sure resources do not have duplicates, but that requirement is impractical, and it this leaves the solution fragile, if there is any issue in the tree, we crash.

When we emit the pdf, the large number of duplicates is not an issue, because SkPDFCatalog::addObject will deal with duplicates.

I have run the gm with --config pdf, and the images are 100% same bits, while the pdfs have the same size but some very small changes, the order of some objects.
Review URL: https://codereview.appspot.com/6744050

git-svn-id: http://skia.googlecode.com/svn/trunk@7883 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
532470f34dbe9fc0b8b71e3917eca8894feaf336 22-Jan-2013 bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Expose geometry and gamma on device.
https://codereview.appspot.com/6499101/


git-svn-id: http://skia.googlecode.com/svn/trunk@7317 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
d96d17b9c113ac694138224249ff2ce643e961dd 04-Jan-2013 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Remove SkRefPtr

(resubmit of https://codereview.appspot.com/7030059/)
TBR=junov@google.com

Review URL: https://codereview.appspot.com/7030065

git-svn-id: http://skia.googlecode.com/svn/trunk@7030 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
6eb549e8ca3d88d7536859fd5aa3343fc3011f2f 04-Jan-2013 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert "Remove SkRefPtr" - r7021

samplecode/ still needs to be updated.

Review URL: https://codereview.appspot.com/7032048

git-svn-id: http://skia.googlecode.com/svn/trunk@7022 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
e8a76ae8edc4f90456f9d8f90e56bf97f2657f3a 04-Jan-2013 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Remove SkRefPtr

Review URL: https://codereview.appspot.com/7030059

git-svn-id: http://skia.googlecode.com/svn/trunk@7021 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
1e34ff7030c95a96c3cd5940de9b4dda4e1cef86 24-Oct-2012 skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Sanitizing source files in Skia_Periodic_House_Keeping

git-svn-id: http://skia.googlecode.com/svn/trunk@6067 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
022e857abc84a43dba0ab93be8680af9dd6f8bf7 23-Oct-2012 edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Catch callers who pass invalid glyph ids and improve SkPdfFont desructor.

git-svn-id: http://skia.googlecode.com/svn/trunk@6066 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
d6176b0dcacb124539e0cfd051e6d93a9782f020 23-Aug-2012 rmistry@google.com <rmistry@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/)

This CL is part II of IV (I broke down the 1280 files into 4 CLs).
Review URL: https://codereview.appspot.com/6474054

git-svn-id: http://skia.googlecode.com/svn/trunk@5263 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
1445a0d53b0793a2cc05c20e4ba74528f028cd8e 06-Jun-2012 caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> fix warnings on Mac in src/pdf

Fix these class of warnings:
- unused functions
- unused locals
- sign mismatch
- missing function prototypes
- missing newline at end of file
- 64 to 32 bit truncation

The changes prefer to link in dead code in the debug build
with 'if (false)' than to comment it out, but trivial cases
are commented out or sometimes deleted if it appears to be
a copy/paste error.
Review URL: https://codereview.appspot.com/6299047

git-svn-id: http://skia.googlecode.com/svn/trunk@4178 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
683001ce0de70c859ea5e5353245b18cadbefc45 09-May-2012 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Ensure that filling single line paths (with no area) does not draw anything.

Add a test to a gm to confirm the new behavior.

Fixes http://crbug.com/123072

Review URL: https://codereview.appspot.com/6137060

git-svn-id: http://skia.googlecode.com/svn/trunk@3884 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
610f716b00f214e4899a102c1bbc1d6a323e114e 14-Mar-2012 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix four memory leaks uncovered by valgrinding gm tests.

All are triggered by PDF code.
Two are missing unref's on SkData.
One is a missing unref on a SkAdvancedTypefaceMetrics.
The last is missing destruction of SkClipStack internal state.

BUG=526

Review URL: https://codereview.appspot.com/5824049

git-svn-id: http://skia.googlecode.com/svn/trunk@3386 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
1771cbf43d9a1334e3d870c635b4215bb888dd98 26-Jan-2012 digit@google.com <digit@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> posix: Avoid static initializers in static/global mutexes

This patch removes static initializers related to static and
global mutexes from the final library's machine code when
building on a pthread-capable system.

We use PTHREAD_MUTEX_INITIALIZER to perform POD-style
initialization. You need a line like the following to declare
a global mutex with it:

SkBaseMutex gMutex = { PTHREAD_MUTEX_INITIALIZER };

We introduce the SK_DECLARE_STATIC_MUTEX and SK_DECLARE_GLOBAL_MUTEX
macros to be able to declare static/global mutexes in the source tree
uniformly.

SkMutex is now defined as a sub-class of SkBaseMutex, with standard
construction/destruction semantics. This is useful if the mutex
object is a member of another C++ class, or allocated dynamically.

We also modify a few places to refer to SkBaseMutex instead of a
SkMutex, where it makes sense. Generally speaking, client code
should hold and use pointers to SkBaseMutex whenever they can
now.

We defined a new built-time macro named SK_USE_POSIX_THREADS
to indicate that we're using a pthread-based SkThread.h
interface. The macro will also be used in future patches
to implement other helper thread synchronization classes.

Finally, we inline the acquire() and release() functions in the
case of Posix to improve performance a bit.

Running: 'bench -repeat 10 -match mutex' on an Android device or
a 2.4GHz Xeon Linux desktop shows the following improvements:

Before After

Galaxy Nexus 1.64 1.45
Nexus S 1.47 1.16
Xoom 1.86 1.66
Xeon 0.36 0.31

This removes 5 static mutex initializers from the library
Review URL: https://codereview.appspot.com/5501066

git-svn-id: http://skia.googlecode.com/svn/trunk@3091 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
cadbcb8e536f89babb4e165bfdca18384e97d582 06-Jan-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Towards enabling -Werror in skia on Linux

Review URL: http://codereview.appspot.com/5516044/



git-svn-id: http://skia.googlecode.com/svn/trunk@2983 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
9ad3599a3a17f124a96979ad5dcba8ad4a107160 03-Jan-2012 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix ToUnicode generation bug.

Code from arthurhsu@chromium.org Original CL: http://codereview.appspot.com/5492061/

BUG=Chromium:104062

Review URL: http://codereview.appspot.com/5498064

git-svn-id: http://skia.googlecode.com/svn/trunk@2944 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
083be07f8f592f87cff9d82c9e75734c54ce3b5c 02-Nov-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Add debug assert to detect failure of GDI cache hack.

If we start hitting this check, then it's likely that something has regressed in WebKit.

Original CL from arthurhsu@chromium.org: http://codereview.appspot.com/5322063/

Review URL: http://codereview.appspot.com/5320062

git-svn-id: http://skia.googlecode.com/svn/trunk@2581 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
918352f86e939fe042495aad4f5ff33c4ecec9ed 30-Oct-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> PDF: Fix bug in weak pointer pattern.

For Canonicalized objects, only remove an object from the canonical list if it is the canonical object and not if it is an instance equal to the canonical object.

BUG=381
TBR=reed@google.com

Review URL: http://codereview.appspot.com/5330058

git-svn-id: http://skia.googlecode.com/svn/trunk@2559 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
b3b465567db95e4ffa70aa5b5b06a6aa43b379a8 18-Oct-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Handle failure of GetAdvancedTypefaceMetrics gracefully until we can figure out why it is failing.

Code from arthurhsu@chromium.org. Original CL: http://codereview.appspot.com/5276057/

Review URL: http://codereview.appspot.com/5274051

git-svn-id: http://skia.googlecode.com/svn/trunk@2480 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
17b78946096265d80215a6c946286ecaa35ea7ed 26-Aug-2011 epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> rolling back the experimental rollbacks in r2178-2179

git-svn-id: http://skia.googlecode.com/svn/trunk@2180 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
5f226572b3b6e1a6fea11f5f3c862a47158f66fe 26-Aug-2011 epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> rolling tree back to its state as of r2169 to see if that fixes Windows buildbots

git-svn-id: http://skia.googlecode.com/svn/trunk@2179 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
513909f9a2f11e385be96ec5455dcbecfd5d32d7 25-Aug-2011 tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Remove compiler warnings (Linux clang, mostly).
Fix indentation.
Remove unnecessary virtual destructor.
codereview.appspot.com/4965043/



git-svn-id: http://skia.googlecode.com/svn/trunk@2171 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
769fa6a013baca6d7404e2bf096a34a7e3635fa5 20-Aug-2011 ctguil@chromium.org <ctguil@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> No effect cleanup in pdf code.
Review URL: http://codereview.appspot.com/4927042

git-svn-id: http://skia.googlecode.com/svn/trunk@2146 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
37ad8fb72ff1b3faac93b01ead2c79e1a06fc172 18-Aug-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Subset font advance data (W array).

Patch by arthurhsu@chromium.org. Original CL:
http://codereview.appspot.com/4830068
http://codereview.appspot.com/4905051/

Review URL: http://codereview.appspot.com/4911042

git-svn-id: http://skia.googlecode.com/svn/trunk@2134 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
7b13aca86f7c68322a1e84f5ca646f7dc9cade6b 17-Aug-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert "Improve generation of glyph advance array." This reverts commit r2126

gm segfaults in font id retrieval.

TBR=arthurhsu@chromium.org

Review URL: http://codereview.appspot.com/4901049

git-svn-id: http://skia.googlecode.com/svn/trunk@2128 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
e7f3300f4250cbe308651f59c992edf6b779a24d 17-Aug-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Improve generation of glyph advance array.

Review URL: http://codereview.appspot.com/4830068

git-svn-id: http://skia.googlecode.com/svn/trunk@2126 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
a5c7234e81748f76cbeede40e619351146e5286a 16-Aug-2011 ctguil@chromium.org <ctguil@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Address lint issues in pdf directories.
Review URL: http://codereview.appspot.com/4887042

git-svn-id: http://skia.googlecode.com/svn/trunk@2117 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
04c643b7739cf7e618d9996c3fd1514eee4b27c0 09-Aug-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Use bfrange to shrink ToUnicode table.

Patch from Arthur Hsu. Original CL: http://codereview.appspot.com/4844043/
BUG=258

Review URL: http://codereview.appspot.com/4808083

git-svn-id: http://skia.googlecode.com/svn/trunk@2075 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976e 28-Jul-2011 epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Automatic update of all copyright notices to reflect new license terms.

I have manually examined all of these diffs and restored a few files that
seem to require manual adjustment.

The following files still need to be modified manually, in a separate CL:

android_sample/SampleApp/AndroidManifest.xml
android_sample/SampleApp/res/layout/layout.xml
android_sample/SampleApp/res/menu/sample.xml
android_sample/SampleApp/res/values/strings.xml
android_sample/SampleApp/src/com/skia/sampleapp/SampleApp.java
android_sample/SampleApp/src/com/skia/sampleapp/SampleView.java
experimental/CiCarbonSampleMain.c
experimental/CocoaDebugger/main.m
experimental/FileReaderApp/main.m
experimental/SimpleCocoaApp/main.m
experimental/iOSSampleApp/Shared/SkAlertPrompt.h
experimental/iOSSampleApp/Shared/SkAlertPrompt.m
experimental/iOSSampleApp/SkiOSSampleApp-Base.xcconfig
experimental/iOSSampleApp/SkiOSSampleApp-Debug.xcconfig
experimental/iOSSampleApp/SkiOSSampleApp-Release.xcconfig
gpu/src/android/GrGLDefaultInterface_android.cpp
gyp/common.gypi
gyp_skia
include/ports/SkHarfBuzzFont.h
include/views/SkOSWindow_wxwidgets.h
make.bat
make.py
src/opts/memset.arm.S
src/opts/memset16_neon.S
src/opts/memset32_neon.S
src/opts/opts_check_arm.cpp
src/ports/SkDebug_brew.cpp
src/ports/SkMemory_brew.cpp
src/ports/SkOSFile_brew.cpp
src/ports/SkXMLParser_empty.cpp
src/utils/ios/SkImageDecoder_iOS.mm
src/utils/ios/SkOSFile_iOS.mm
src/utils/ios/SkStream_NSData.mm
tests/FillPathTest.cpp
Review URL: http://codereview.appspot.com/4816058

git-svn-id: http://skia.googlecode.com/svn/trunk@1982 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
17e66e2d341ab684eec7841fd383af85bb4aa625 27-Jul-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Improve efficiency of glyph id collection during font subsetting.

Patch from Arthur Hsu, original CL: http://codereview.appspot.com/4828044/

Review URL: http://codereview.appspot.com/4798057

git-svn-id: http://skia.googlecode.com/svn/trunk@1978 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
93225ff5d5872faada54a073423e802e8e721323 27-Jul-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Fix mem leak in font subsetting.

Original CL: http://codereview.appspot.com/4809053/

Review URL: http://codereview.appspot.com/4825052

git-svn-id: http://skia.googlecode.com/svn/trunk@1977 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
1f1658985586b30c913dbc935f17ce1aabcdf7b5 26-Jul-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Add font subsetting using the sfntly library.

Patch from Arthur Hsu, original CL: http://codereview.chromium.org/7513003/

Review URL: http://codereview.appspot.com/4828041

git-svn-id: http://skia.googlecode.com/svn/trunk@1957 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
9859428e71c6041928e6dd741ae3284017e78e81 26-Jul-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Refactor SkPDFFont to enable font/cmap subsetting.

Patch from Arthur Hsu, original CL: http://codereview.appspot.com/4633050/

Committed: http://code.google.com/p/skia/source/detail?r=1943
Reverted: http://code.google.com/p/skia/source/detail?r=1944

Review URL: http://codereview.appspot.com/4811049

git-svn-id: http://skia.googlecode.com/svn/trunk@1956 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
31dcee7b84ac8a50fe8269a39ac0431b01da48d1 23-Jul-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert "[PDF] Refactor SkPDFFont to enable font/cmap subsetting."

The PDF xref table is corrupt with this change. Revert until we figure it out.

Review URL: http://codereview.appspot.com/4803049

git-svn-id: http://skia.googlecode.com/svn/trunk@1944 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
6504cfdfc035f0a2cb854be9df352159873b9d62 23-Jul-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Refactor SkPDFFont to enable font/cmap subsetting.

Patch from Arthur Hsu, original CL: http://codereview.appspot.com/4633050/

Review URL: http://codereview.appspot.com/4811049

git-svn-id: http://skia.googlecode.com/svn/trunk@1943 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
421d6443fbd3a913dfa32b6492c4a2969bc6314b 20-Jul-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Make stream compression optional on a per device basis.

There are a lot of small pieces to make this change work:
- SkPDFDocument (and SkPDFCatalog) take flags to disable compression (and font embedding - not implemented yet, can disable font subsetting for now).
- SkPDFStream now defers compression until the size/emit step.
- Classes that *had* a stream (because they didn't know the stream size at construction time) now *are* streams to make the substitution work correctly.
- The SkPDFShader implementation got pulled apart into two classes, one that is a SkPDFDict, and one that is a SkPDFStream (making the common ancestor SkPDFObject).
- Added helper methods in SkPDFObject for children that have simple resource lists.
- Added an iterator to SkPDFDict so that a substitute SkPDFStream can get a copy of the stream dictionary.
- Change SkPDFDocument to have a pointer to an SkPDFCatalog to remove a new circular header reference.

Review URL: http://codereview.appspot.com/4700045

git-svn-id: http://skia.googlecode.com/svn/trunk@1911 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
f6c3ebdeb135dcdb9af225bd7af77f1fe1f92787 20-Jul-2011 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> fix Capitalization of static methods



git-svn-id: http://skia.googlecode.com/svn/trunk@1910 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
c789cf1c6f3947283aeb34acb5a22e6204f8f6f5 20-Jul-2011 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> helpers for append and insert when the value is a POD.
reduces code-size and perf: fewer refs/unrefs



git-svn-id: http://skia.googlecode.com/svn/trunk@1909 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
8a85d0c4938173476d037d7af0ee3b9436a1234e 24-Jun-2011 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> replace detach/getStream apis on dynamicwstream with SkData

http://codereview.appspot.com/4657046/



git-svn-id: http://skia.googlecode.com/svn/trunk@1714 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
73322074658e19ff14591236d9b5485910a2c7b7 21-Jun-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix some problems detected by coverity.

- Uninitialized class member in GSCanonicalEntry and SkPDFDocument.
- Incorrect sign extension in SkPDFFont.
- Dead code in SkPDFUtils.

CID=16262,16272,16273,16275

Review URL: http://codereview.appspot.com/4659041

git-svn-id: http://skia.googlecode.com/svn/trunk@1668 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
f0ec2666d9a3f0f1662f0d63b5147628c49648aa 29-May-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Add plumbing and accessors so that Chrome can record the font types used in a PDF.

- Add a font type accessor to SkPDFFont.
- Plumb font resource retrivial up to SkPDFPage.

Review URL: http://codereview.appspot.com/4547069

git-svn-id: http://skia.googlecode.com/svn/trunk@1444 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
6744d498fcbbbcf503ec80c4d43dd8f118a88597 09-May-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Add a ToUnicode mapping for fonts.

This makes text in PDFs searchable and copy&paste-able.

Code from arthurhsu@chromium.org. Original review: http://codereview.appspot.com/4428082/

Review URL: http://codereview.appspot.com/4525042

git-svn-id: http://skia.googlecode.com/svn/trunk@1280 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
ee5ee582430196ee3a9b9473bf865e060515996c 28-Apr-2011 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> fix warnings about possibly-uninitialized-variables



git-svn-id: http://skia.googlecode.com/svn/trunk@1208 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
75f97e452e8f2ee55cd2b283df7d7734f48bc2bf 12-Apr-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Generalize the flip origin argument to the PDF device constructor.

The argument still has a default value that does what most users will want, but provides more flexibility.
Chrome will use this change to support an initial translation of the origin to simulate a margin and to scale the entire content (needed on Windows).

When landing to Chrome, this will need http://codereview.chromium.org/6820038

Review URL: http://codereview.appspot.com/4373052

git-svn-id: http://skia.googlecode.com/svn/trunk@1111 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
325cb9aa17b94258b362082eb3a799524f4345f3 30-Mar-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Improve the SkAdvancedTypefaceMetrics interface w.r.t. vertical advances.

Add a template function to type safe-combine bits of a bit field.

Review URL: http://codereview.appspot.com/4313053

git-svn-id: http://skia.googlecode.com/svn/trunk@1020 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
cae5fba82e687d674b076b10cdc8aba46e1ac3b3 28-Mar-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Store content streams in an SkStream instead of an SkString (64k size limit).

Review URL: http://codereview.appspot.com/4272070

git-svn-id: http://skia.googlecode.com/svn/trunk@1011 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
ce11b26e828cef680928a68ac3fc6df5e81263c4 21-Mar-2011 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> convert fixed->scalar directly, since we know that the
glyph's advance is already base-1000



git-svn-id: http://skia.googlecode.com/svn/trunk@973 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
3f0dcf96c332b1b0cb9b63043d16607e8702259b 18-Mar-2011 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> fix scalar math to work with float and fixed



git-svn-id: http://skia.googlecode.com/svn/trunk@962 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
f77e27deb95ff6fd6e6e30dcd3f6bf1862c394e1 10-Mar-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Use Type3 fonts for platforms that don't yet support SkFontHost::GetAdvancedTypefaceMetrics.

Review URL: http://codereview.appspot.com/4273041

git-svn-id: http://skia.googlecode.com/svn/trunk@922 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
5b073680ecba631da68e33d0d2f28f10a07110ce 08-Mar-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Enable compiling the PDF backend by default in the makefile.

Use SKIA_PDF_SUPPORT=false to disable the PDF backend.

Review URL: http://codereview.appspot.com/4267046

git-svn-id: http://skia.googlecode.com/svn/trunk@906 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
9db86bb9cd1b77be0afc504ccc07026e4282d7e7 04-Mar-2011 ctguil@chromium.org <ctguil@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> PDF Type3 Support.


git-svn-id: http://skia.googlecode.com/svn/trunk@892 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
0129410fbe4b88a0632fb7aa5185610b30e69852 28-Feb-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Fix broken encoding conversion code for non-multibyte fonts.

Review URL: http://codereview.appspot.com/4245044

git-svn-id: http://skia.googlecode.com/svn/trunk@863 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
c48b2b330f8bf0e01381e27ca36f48ef5c7d8d5f 02-Feb-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Cleanup SkPDFTypfaceInfo and make it more generic.

Renamed to SkAdvancedTypefaceMetrics.
Include Em size and return all metrics in unscaled font units.
Make retrieval of advances optional.
Reorder SkAdvancedTypefaceMetrics to be somewhat logical.
Change the types of fields in SkAdvancedTypefaceMetrics to their minimum required size.

Review URL: http://codereview.appspot.com/4121049

git-svn-id: http://skia.googlecode.com/svn/trunk@752 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
f7c157610ff85f7323f5e213b62478dcc66edbec 01-Feb-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Clean up ref counting.

Return ref'd objs where possible enabling removal of many SkRefPtr<> variables.

Review URL: http://codereview.appspot.com/4029051

git-svn-id: http://skia.googlecode.com/svn/trunk@750 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
2a22e10ab2946c5590cd2a258427ce3ccfca9bfa 25-Jan-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Add Truetype and Type 1 font embedding support

Sorry this is such a large CL. It was very exploratory for me to make this
work.

- Add an interface to SkFontHost to retrieve font information and provide NULL implementations on all platforms except Linux.
- Segment large Type 1 fonts into fonts with shared resources with 255 glyphs each.
- Convert the various Type 1 formats to the form PDF wants.
- Update font as we draw text instead of as part of the graphical state.
- Remove built-in font support, we can't really use it.

Other changes I can pull out to a separate CL if you like.

- Add SkTScopedPtr class.
- Fix double free of resources.
- Fix bug in resource unique-ifying code.
- Don't print anything for any empty clip path.
- Fix copy paste error - MiterLimit.
- Fix sign extension bug in SkPDFString
- Fix FlateTest rename that was missed on a previous commit.

Review URL: http://codereview.appspot.com/4082042

git-svn-id: http://skia.googlecode.com/svn/trunk@728 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp
28be72b63e457c680c192a34fb9f58e1c693363f 11-Nov-2010 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> PDF: Add text support with a font framework (font embedding to come).

Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.

Review URL: http://codereview.appspot.com/2946041

git-svn-id: http://skia.googlecode.com/svn/trunk@624 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFFont.cpp