skia2/include
mtklein 0c263fa9f8 Deduplicate typefaces across sub-pictures
Old flow to serialize a picture:
   1) serialize picture ops
   2) serialize all sub pictures recursively
   3) flatten the rest of this picture into a buffer, deduping flattenable factories and typefaces as we go
   4) serialize the factories and typefaces
   5) serialize the bytes from 3)

This allows the data in step 5) to refer to the deduplicated factories and typefaces from step 4).  But, each sub picture in step 2) is completely siloed, so they can't dedup with the parent picture or each other.

New flow:
   1) serialize picture ops
   2) flatten the rest of this picture into a buffer, deduping flattenable factories and typefaces as we go
   3) dummy-serialize sub pictures into /dev/null, with the effect of adding any new typefaces to our dedup set
   4) serialize the factories and typefaces
   5) serialize the bytes from 2)
   6) serialize all sub pictures recursively, with perfect deduplication because of step 3).

Now all typefaces in the top-level picture and all sub pictures recursively should end up deduplicated in the top-level typeface set.

Decoding changes are similar: we just thread through the top-level typefaces to the sub pictures.  What's convenient / surprising is that this new code correctly reads old pictures if we just have each picture prefer its local typeface set over the top-level one: old pictures always just use their own typefaces, and new pictures always use the top-level ones.

BUG=skia:4092

Review URL: https://codereview.chromium.org/1233953004
2015-08-18 08:29:59 -07:00
..
animator Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
c C API: add radial, sweep, and two-point conical gradient shaders 2015-08-12 07:37:34 -07:00
codec SkScaledCodec class 2015-08-14 07:44:46 -07:00
config remove SkInstCnt 2015-06-26 11:45:03 -07:00
core Deduplicate typefaces across sub-pictures 2015-08-18 08:29:59 -07:00
device/xps C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
effects Remove SK_LEGACY_SKPOINT3_CTORS flag 2015-08-06 07:08:31 -07:00
gpu Made isEqual in GrFragmentProcessor recursive 2015-08-18 07:39:33 -07:00
images remove SkInstCnt 2015-06-26 11:45:03 -07:00
pathops Revert of Revert of remove SK_SUPPORT_LEGACY_PATHOP_ENUMS (patchset #1 id:1 of https://codereview.chromium.org/1203983003/) 2015-06-26 10:23:07 -07:00
pipe Fixing leaky handling of SkImage in SkDeferredCanvas. 2015-06-02 11:47:45 -07:00
ports Clean up a few includes, introduce iwyu. 2015-07-29 11:49:40 -07:00
private Revert[8] "move some public headers into private" 2015-08-17 18:29:48 -07:00
svg Revert[8] "move some public headers into private" 2015-08-17 18:29:48 -07:00
utils SkPaintFilterCanvas should inherit the target canvas state 2015-08-17 08:05:13 -07:00
views Remove SK_BUILD_FOR SDL, BREW, and PALM. 2015-07-29 13:37:27 -07:00
xml Fix up -Winconsistent-missing-override 2015-07-13 06:18:39 -07:00