1. 08 4月, 2016 1 次提交
    • R
      Avoid copying of font table data · aaa4e347
      Raph Levien 提交于
      The hb_font_t object holds on to tables of font data, acquired through
      the MinikinFont::GetTable interface, which is based on copying data
      into caller-owned buffers. Now that we're caching lots of hb_font_t's,
      the cost of these buffers is significant.
      
      This patch moves to a different interface, inspired by HarfBuzz's
      hb_reference_table API, where the font can provide a pointer to the
      actual font data (which will often be mmap'ed, so it doesn't even
      consume physical RAM).
      
      Bug: 27860101
      Change-Id: Id766ab16a8d342bf7322a90e076e801271d527d4
      aaa4e347
  2. 12 2月, 2016 1 次提交
  3. 08 2月, 2016 1 次提交
  4. 04 2月, 2016 1 次提交
    • S
      Improve Paint.hasGlyph performance by caching hb_font_t · 89e80237
      Seigo Nonaka 提交于
      It turned out that hb_font_t creation is not a lightweight operation.
      Especially, Paint.hasGlyph creates hb_font_t for all existing fonts
      every time. To improve the performance, cache hb_font_t instead
      of hb_face_t.
      
      Note that to calculate horizontal advance, MinikinPaint needs to be
      associated with hb_font_t by calling hb_font_set_funcs. With this patch,
      hb_font_set_funcs may be called multiple times for the same hb_font_t
      object. However this is not an issue since MinikinPaint is unique
      during layout.
      
      Bug: 26784699
      
      Change-Id: I516498ae9f0127d700fc9829327e9789845a1416
      89e80237
  5. 21 1月, 2016 1 次提交
  6. 05 1月, 2016 1 次提交
    • S
      Save all kind of script tags into FontLanguage. · 198b46f1
      Seigo Nonaka 提交于
      This is 2nd attempt of I8df992a6851021903478972601a9a5c9424b100c.
      
      The main purpose of this CL is expanding FontLanguage to be able to
      save full script tag. Previously, FontLangauge kept only limited script
      tags. With this CL, FontLanguage keeps all script tags.
      
      This CL contains the following changes:
      - FontLanguage changes:
      -- Moved to private directory not to be instantiated outside of Minikin.
      -- Removed bool(), bits(), FontLanguage(uint32_t) methods which are no
         longer used.
      -- Change the FontLanguage internal data structure.
      -- Introduces script match logic.
      
      - FontLanguages changes:
      -- Moved to private directory not to be instantiated outside of Minikin.
      -- This is now std::vector<FontLanguage>
      
      - FontLanguageListCache changes:
      -- Now FontLanguageListCache::getId through
         FontStyle::registerLanguageList is the only way to instantiate the
         FontLanguage.
      -- Normalize input to be BCP47 compliant identifier by ICU.
      
      Bug: 26168983
      Change-Id: I431b3f361a7635497c05b85e8ecbeb48d9aef63e
      198b46f1
  7. 22 12月, 2015 2 次提交
    • B
      Revert "Save all kind of script tags into FontLanguage." · 6c4c098c
      Bart Sears 提交于
      This reverts commit 5e995fb8.
      
      Change-Id: I761e0e41906742fbe3d3ac34170af3101e18042a
      6c4c098c
    • S
      Save all kind of script tags into FontLanguage. · 5e995fb8
      Seigo Nonaka 提交于
      The main purpose of this CL is expanding FontLanguage to be able to
      save full script tag. Previously, FontLangauge kept only limited script
      tags. With this CL, FontLanguage keeps all script tags.
      
      This CL contains the following changes:
      - FontLanguage changes:
      -- Moved to private directory not to be instantiated outside of Minikin.
      -- Removed bool(), bits(), FontLanguage(uint32_t) methods which are no
         longer used.
      -- Change the FontLanguage internal data structure.
      -- Introduces script match logic.
      
      - FontLanguages changes:
      -- Moved to private directory not to be instantiated outside of Minikin.
      -- This is now std::vector<FontLanguage>
      
      - FontLanguageListCache changes:
      -- Now FontLanguageListCache::getId through
         FontStyle::registerLanguageList is the only way to instantiate the
         FontLanguage.
      -- Normalize input to be BCP47 compliant identifier by ICU.
      
      Bug: 26168983
      Change-Id: I8df992a6851021903478972601a9a5c9424b100c
      5e995fb8
  8. 09 12月, 2015 1 次提交
    • S
      Introduce FontLanguageListCache. · 6d9dcd2c
      Seigo Nonaka 提交于
      FontLanguageListCache is an intentionally leaky singleton and its
      internal cache won't be purged.
      
      BUG: 25122318
      
      Change-Id: I272097e979fe44b83fd86822235350e12eda8f51
      6d9dcd2c
  9. 28 10月, 2015 2 次提交
    • S
      Add -Werror -Wall -Wextra to compiler option. · bae34768
      Seigo Nonaka 提交于
      This is 2nd trial of I30a0914a4633bd93eb60957cdf378770f04d8428
      
      - To suppress noisy unused parameter warnings, comment out unused
        arguments.
      - Add -Werror for suppressing further warning.
      - Add -Wall -Wextra for safety.
      - Use "z" prefix for format string of size_t.
      
      Verified that compile succeeded on all arm,arm64,mips,x86,x86_64.
      
      Change-Id: I7ad208464486b8a35da53929cb1cfe541ed0052f
      bae34768
    • B
      Revert "Add -Werror -Wall -Wextra to compiler option." · b4c79918
      Bart Sears 提交于
      This reverts commit 63635cff.
      
      Change-Id: I2b4b10e8afedc85dbe2d07f3e47315652b65cd14
      b4c79918
  10. 27 10月, 2015 1 次提交
    • S
      Add -Werror -Wall -Wextra to compiler option. · 63635cff
      Seigo Nonaka 提交于
      - To suppress noisy unused parameter warnings, comment out unused
        arguments.
      - Add -Werror for suppressing further warning.
      - Add -Wall -Wextra for safety.
      
      Change-Id: I30a0914a4633bd93eb60957cdf378770f04d8428
      63635cff
  11. 12 10月, 2015 1 次提交
    • S
      Introduce FontFamily::hasVariationSelector · 0f2a025d
      Seigo Nonaka 提交于
      This CL introduces new method hasVariationSelector into FontFamily but it
      is not used in production code. So no behavior changes are expected.
      
      This CL contains the following changes:
      - Introduce hasVariationSelector which returns true if the corresponding
        font has a glyph for a code point and variation selector pair.
      - Introduce purgeHbFontCache since hb_face_t won't be released by
        keeping hb_font_t.
      - Introduce unit tests with self-built font.
      
      Change-Id: I659a6d03d9ec446b409e1fba2758452abb9f44fa
      0f2a025d
  12. 30 9月, 2015 2 次提交
    • S
      Extract hb_face_t object cache mechanism from Layout.cpp. · fb0d3969
      Seigo Nonaka 提交于
      This CL does following things:
      - Extract hb_face_t object cache mechanism from Layout.cpp to be able to
        use it from other cpp file, especially from FontFamily.cpp.
        To address Bug 11256006 and Bug 17759267, need to touch
        hb_face_t from FontFamily.
      - Make hb_face_t cache mechanism thread-safe.
      - Add unit tests for HbFaceCache test cases.
      
      Bug: 11256006
      Bug: 17759267
      Change-Id: Ic183634ef34326793bd9a32167236611d0af34d6
      fb0d3969
    • K
      Refactoring: Introduce helper class to iterate runs. · 6292e1a9
      Keisuke Kuroyanagi 提交于
      This doesn't change current behavior. It's a preparation
      for the following CLs.
      
      Bug: 22408712
      Change-Id: Ic018422254aa3904655f499194caad74f0c0fc5d
      6292e1a9
  13. 11 9月, 2015 1 次提交
    • S
      Resolve glyph ID by HarfBuzz function. · 2a79f59e
      Seigo Nonaka 提交于
      Currently codepoint to glyph ID resolution is done through MinikinFont
      interface. To support variation selector, use HarfBuzz API instead of
      calling this interface since one of its implementation Skia doesn't
      support variation selector.
      
      On the other hand, we don't want to get glyph horizontal advance values
      by HarfBuzz since HarfBuzz doesn't return correct values when the hinting
      is active.
      
      Thus, use ot_font as a parent font and override
      glyph_h_advance/glyph_h_origin functions as is.
      
      With this change, MinikinFont::GetGlyph is no longer necessary but not
      removing in this CL for easy reverting since removing interface requires
      multi-repository commit.
      
      This is a base work of b/11256006 and this patch doesn't provide any
      user visible changes.
      
      Bug: 11256006
      Change-Id: I061172c0b674bb649ce8bc013ffecf38708bdc41
      2a79f59e
  14. 29 8月, 2015 1 次提交
    • S
      Update word breaker to be aware tone mark and variation selector. · 4e3adc6f
      Seigo Nonaka 提交于
      This CL does:
      1. Move the getNextWordBreak/getPrevWordBreak function to a separate source file.
      2. Adding "ForCache" suffix for function name for making clear these function is
         for layout cache.
      3. Introduce unit tests for them.
      
      Bug: 11256006
      Change-Id: I4138751a4570915f1a0d6c8921f89700f8ec7f35
      4e3adc6f
  15. 12 8月, 2015 1 次提交
  16. 10 7月, 2015 1 次提交
    • R
      Add HyphenEdit to layout cache · 6c4d167b
      Raph Levien 提交于
      We bypass the word layout cache for "complex" cases, which includes
      things like OpenType features. We were counting a hyphen edit as such
      a case, but the problem is that we measure a _lot_ of these when
      doing layout with hyphenation.
      
      This patch adds plumbing for hyphen edits to the layout cache, so
      that word fragments with hyphens can be cached as well.
      
      Bug: 22378829
      
      Change-Id: Idba4df4faa14f48a5faccc8a7a7955a36c19ef27
      6c4d167b
  17. 30 6月, 2015 1 次提交
    • R
      Fix logspam and incorrect cluster offset · 91425f05
      Raph Levien 提交于
      An incorrect cluster offset calculation was causing a lot of log
      messages to appear. Separately, a confusion between #if and #ifdef was
      causing unintended logging of line breaks. This patch fixes both.
      
      Bug: 22178333
      Change-Id: I2b3673ed66c784f5082fd127a8dc10bd3df6ed79
      91425f05
  18. 27 6月, 2015 1 次提交
    • R
      Disable letterspacing for connected scripts · e8721b2d
      Raph Levien 提交于
      The appearance of letterspacing with scripts with cursive connections
      is poor, so we simply disable letterspacing for those scripts. There
      may be some cases where some form of letterspacing is desirable, but
      this gives the highest likelihood that the final result will be good
      without requiring additional work from clients.
      
      Bug: 21935803
      Change-Id: Ie25266249ac3a2605aa89ef5132e8edbe3a06d35
      e8721b2d
  19. 13 6月, 2015 1 次提交
    • R
      Use ASCII HYPHEN-MINUS when there's no HYPHEN in the font. · f997dd21
      Roozbeh Pournader 提交于
      Previously, we just assumed the font in use had a U+2010 HYPHEN
      character, resulting in a tofu (or an empty space) being shown when
      U+2010 was not supported in the font used to render the hyphenated
      word.
      
      Now we try to fallback to U+002D HYPHEN-MINUS, which has a very good
      chance of being available in at least any Latin font.
      
      We still show a tofu when neither character is supported, to
      intentionally alert that something is missing.
      
      Bug: 20497913
      Bug: 21088552
      Bug: 21570828
      Change-Id: Iff69bbc38836c03495e9124502b5207c39270da2
      f997dd21
  20. 28 4月, 2015 1 次提交
    • J
      Move Bitmap to a different namespace · 8920e817
      John Reck 提交于
      namespace naming collision. Move minikin's
      Bitmap out of android:: and into minikin::
      
      Change-Id: I5ae3925f81b848dc79576429ab55243b96f7fed2
      8920e817
  21. 27 3月, 2015 1 次提交
    • R
      Add LineBreaker to Minikin · 01f52661
      Raph Levien 提交于
      This patch adds a LineBreaker class to Minikin, which will be used for
      computing line breaks in StaticLayout. The version in this patch
      contains basically the same functionality that existed before, but
      hopefully better performance and an interface that's suitable for more
      sophisticated paragraph layout.
      
      Note that this version contains a high quality strategy, which mostly
      works but doesn't respect varying line width.
      
      Change-Id: I02485d58b1e52856296a72cdd4efd963bc572933
      01f52661
  22. 13 3月, 2015 1 次提交
    • R
      HyphenEdit in support of hyphenation · d692d6a9
      Raph Levien 提交于
      Adds a "HyphenEdit" field to the Minikin Paint object, which represents
      an edit to the text to add a hyphen (and, in the future, other edits to
      support nonstandard hyphenation).
      
      Change-Id: Ib4ee690b0fe2137e1d1e2c9251e5526b274ec3a7
      d692d6a9
  23. 26 2月, 2015 1 次提交
    • R
      Disable HarfBuzz's fallback to compatibility decompositions · 0bbff3a9
      Roozbeh Pournader 提交于
      Previously, HarfBuzz's default fallback to compatibility
      decompositions resulted in Mathematical Alphanumeric Symbols getting
      rendered as normal letters and digits when there was no font
      available to render them. This patch disables that fallback, to
      ensure they are displayed as tofus.
      
      Based on a patch by Behdad Esfahbod.
      
      Bug: 19202569
      Change-Id: I357f172302448d4ab0b24efc86119f1977b5996b
      0bbff3a9
  24. 04 12月, 2014 1 次提交
  25. 12 11月, 2014 1 次提交
  26. 04 9月, 2014 1 次提交
    • R
      Snap advance widths to integers · 6740536e
      Raph Levien 提交于
      Fractional advance widths were causing subtle problems with text
      positioning when the same text was drawn with different spans in the
      hwui renderer. Quantizing the coordinates on layout (as opposed to
      waiting until the renderer draws the glyphs) solves the problem.
      
      This patch also fixes a discrepancy between x position and advance
      widths when letterspacing.
      
      Bug: 17347779
      Change-Id: Ia705944047408c2839d5ad078eefd6bbec446872
      6740536e
  27. 22 8月, 2014 3 次提交
    • B
      Allocate font vector on stack · 56c7fb8c
      Behdad Esfahbod 提交于
      This reduces another allocation (last one?) we were doing when
      fulfilling shaping requests from the cache.
      
      Bug: 17111260
      Change-Id: Ieb8ae1ccfcaacedb257e1e9263777f10623aaf98
      56c7fb8c
    • B
      Fix Layout initialization in the skipCache path · 6da7796c
      Behdad Esfahbod 提交于
      C++ local var initialization always tricks me.  Previously, Layout
      didn't have a constructor, which meant that defining it on the stack
      left mAdvance uninitialized.  This was not an issue when we were doing
      "new Layout()", since that invokes zero-initialization, but was an
      issue for the skipCache path that was allocating layout on stack by
      just "Layout l" instead of "Layout l = Layout()".  To avoid surprises,
      add a constructors that clears everything.
      
      Also adds reset() method to reset the layout for reuse.
      
      Change-Id: I3e02f00da9dd7d360abe13f63c310f6882292d0a
      6da7796c
    • B
      Speed up cache lookup · 288c9159
      Behdad Esfahbod 提交于
      Avoid copying the string for cache lookup.
      
      Bug: 17111260
      Change-Id: Ic220bfc991fc6b3dada197304aabdf72a8941bd7
      288c9159
  28. 31 7月, 2014 1 次提交
  29. 30 7月, 2014 2 次提交
  30. 26 7月, 2014 1 次提交
    • B
      Don't get stuck on invalid UTF-16 · b8208bc1
      Behdad Esfahbod 提交于
      Replaces invalid unicode with replacement character U+FFFD and always
      makes forward progress.
      
      Bug: 15849380
      
      Change-Id: Ic59ef6c64b0f5c4450bcae61597adcc269d6e7c5
      b8208bc1
  31. 25 7月, 2014 2 次提交
    • B
      Towards CSS removal · a5bb9119
      Behdad Esfahbod 提交于
      Extract language from FontStyle during shaping.  Don't attach CSS
      to LayoutContext.
      
      Change-Id: Ie621d3415410178d0d15fa7b810eb8e412342ab6
      a5bb9119
    • B
      Remove deprecated API · f0a1e5b2
      Behdad Esfahbod 提交于
      It has been unused outside minikin.
      
      Change-Id: Iaa2237767d81c77f90d0264e633375e601dd72f1
      f0a1e5b2
  32. 26 7月, 2014 1 次提交
  33. 23 7月, 2014 1 次提交