[Libreoffice-commits] core.git: vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Sep 12 12:15:37 UTC 2018


 vcl/source/gdi/CommonSalLayout.cxx |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

New commits:
commit 2523e10b5856bebd534385f4beec0386e2c800fa
Author:     Khaled Hosny <khaledhosny at eglug.org>
AuthorDate: Tue Sep 11 15:03:13 2018 +0200
Commit:     Khaled Hosny <khaledhosny at eglug.org>
CommitDate: Wed Sep 12 14:15:15 2018 +0200

    Simplify HarfBuzz shaping call
    
    We were using a shape plan explicitely to report which shaper HarfBuzz
    ended up using, but the logging was dropped in:
    
    commit 919d5ac6b02e85126b3938c31daf4a891d3b2d90
    Author: Khaled Hosny <khaledhosny at eglug.org>
    Date:   Sat Mar 4 05:06:47 2017 +0200
    
        Make vcl.harfbuzz logging less verbose
    
        Change-Id: I9b93c11e34ca880e9a60fb0fce49777c274568e6
    
    So simplify the call and use the simpler hb_shape_full (which does the
    same thing this code was doing).
    
    Change-Id: I9122280869fb84a212fcf28cd8f2d58259a6b6bf
    Reviewed-on: https://gerrit.libreoffice.org/60327
    Tested-by: Jenkins
    Reviewed-by: Khaled Hosny <khaledhosny at eglug.org>

diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx
index e4312847d72b..b1bd43fdf801 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -277,7 +277,6 @@ bool GenericSalLayout::LayoutText(ImplLayoutArgs& rArgs, const SalLayoutGlyphs*
     }
 
     hb_font_t *pHbFont = mpFont->GetHbFont();
-    hb_face_t* pHbFace = hb_font_get_face(pHbFont);
 
     int nGlyphCapacity = 2 * (rArgs.mnEndCharPos - rArgs.mnMinCharPos);
     m_GlyphItems.reserve(nGlyphCapacity);
@@ -438,14 +437,9 @@ bool GenericSalLayout::LayoutText(ImplLayoutArgs& rArgs, const SalLayoutGlyphs*
             // but there is no harm in always including it, HarfBuzz will
             // ignore unavailable shapers.
             const char*const pHbShapers[] = { "graphite2", "coretext_aat", "ot", "fallback", nullptr };
-            hb_segment_properties_t aHbProps;
-            hb_buffer_get_segment_properties(pHbBuffer, &aHbProps);
-            hb_shape_plan_t* pHbPlan = hb_shape_plan_create_cached(pHbFace, &aHbProps, maFeatures.data(), maFeatures.size(), pHbShapers);
-            bool ok = hb_shape_plan_execute(pHbPlan, pHbFont, pHbBuffer, maFeatures.data(), maFeatures.size());
+            bool ok = hb_shape_full(pHbFont, pHbBuffer, maFeatures.data(), maFeatures.size(), pHbShapers);
             assert(ok);
             (void) ok;
-            hb_buffer_set_content_type(pHbBuffer, HB_BUFFER_CONTENT_TYPE_GLYPHS);
-            hb_shape_plan_destroy(pHbPlan);
 
             int nRunGlyphCount = hb_buffer_get_length(pHbBuffer);
             hb_glyph_info_t *pHbGlyphInfos = hb_buffer_get_glyph_infos(pHbBuffer, nullptr);


More information about the Libreoffice-commits mailing list