Bug 1515629 - Update Graphite2 to version 1.3.13. r=jfkthame
authorRyan VanderMeulen <ryanvm@gmail.com>
Mon, 31 Dec 2018 15:56:58 +0000
changeset 509299 9f5be1d14edcdeca0e0d0c6bee0f8b11db05add4
parent 509298 cc4bb8c7fa92e8a4f44377c253160cea4ab66c97
child 509300 c6e2a237b5940a7e607bc5fc19b73045692e0d7b
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs1515629
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1515629 - Update Graphite2 to version 1.3.13. r=jfkthame Differential Revision: https://phabricator.services.mozilla.com/D15095
gfx/graphite2/README.md
gfx/graphite2/README.mozilla
gfx/graphite2/include/graphite2/Font.h
gfx/graphite2/src/CMakeLists.txt
gfx/graphite2/src/Collider.cpp
gfx/graphite2/src/GlyphCache.cpp
gfx/graphite2/src/inc/TtfTypes.h
--- a/gfx/graphite2/README.md
+++ b/gfx/graphite2/README.md
@@ -1,15 +1,15 @@
 # Graphite engine
 
 ## Project CI status
 | OS      | Intel 64 bit | Intel 32 bit | Arm 32 bit |
 |---------|:------------:|:------------:|:----------:|
 | Linux   | [![Build Status](http://build.palaso.org/app/rest/builds/buildType:bt124/statusIcon)](http://build.palaso.org/viewType.html?buildTypeId=bt124&guest=1) | [![Build Status](http://build.palaso.org/app/rest/builds/buildType:bt123/statusIcon)](http://build.palaso.org/viewType.html?buildTypeId=bt123&guest=1) | [![Build Status](http://build.palaso.org/app/rest/builds/buildType:Graphite_Linux32bitArm/statusIcon)](http://build.palaso.org/viewType.html?buildTypeId=Graphite_Linux32bitArm&guest=1) |
-| Windows | [![Build Status](http://build.palaso.org/app/rest/builds/buildType:Graphite_Windows64bitProduction/statusIcon)](http://build.palaso.org/viewType.html?buildTypeId=Graphite_Windows64bitProduction&guest=1) | [![Build Status](http://build.palaso.org/app/rest/builds/buildType:bt91/statusIcon)](http://build.palaso.org/viewType.html?buildTypeId=bt91&guest=1)| |
+| Windows | [![Build Status](http://build.palaso.org/app/rest/builds/buildType:Graphite_Windows64bit/statusIcon)](http://build.palaso.org/viewType.html?buildTypeId=Graphite_Windows64bit&guest=1) | [![Build Status](http://build.palaso.org/app/rest/builds/buildType:bt91/statusIcon)](http://build.palaso.org/viewType.html?buildTypeId=bt91&guest=1)| |
 
 ## What is Graphite?
 
 Graphite is a system that can be used to create “smart fonts” capable of displaying writing systems with various complex behaviors. A smart font contains not only letter shapes but also additional instructions indicating how to combine and position the letters in complex ways.
 
 Graphite was primarily developed to provide the flexibility needed for minority languages which often need to be written according to slightly different rules than well-known languages that use the same script.
 
 Examples of complex script behaviors Graphite can handle include:
--- a/gfx/graphite2/README.mozilla
+++ b/gfx/graphite2/README.mozilla
@@ -1,3 +1,3 @@
-This directory contains the Graphite2 library release 1.3.12 from
-https://github.com/silnrsi/graphite/releases/download/1.3.12/graphite2-minimal-1.3.12.tgz
+This directory contains the Graphite2 library release 1.3.13 from
+https://github.com/silnrsi/graphite/releases/download/1.3.13/graphite2-minimal-1.3.13.tgz
 See ./gfx/graphite2/moz-gr-update.sh for update procedure.
--- a/gfx/graphite2/include/graphite2/Font.h
+++ b/gfx/graphite2/include/graphite2/Font.h
@@ -25,17 +25,17 @@
     either version 2 of the License or (at your option) any later version.
 */
 #pragma once
 
 #include "graphite2/Types.h"
 
 #define GR2_VERSION_MAJOR   1
 #define GR2_VERSION_MINOR   3
-#define GR2_VERSION_BUGFIX  12
+#define GR2_VERSION_BUGFIX  13
 
 #ifdef __cplusplus
 extern "C"
 {
 #endif
 
 typedef struct gr_face          gr_face;
 typedef struct gr_font          gr_font;
--- a/gfx/graphite2/src/CMakeLists.txt
+++ b/gfx/graphite2/src/CMakeLists.txt
@@ -33,31 +33,31 @@ set(GRAPHITE_SO_VERSION ${GRAPHITE_API_C
 include(TestBigEndian)
 
 include_directories(${PROJECT_SOURCE_DIR})
 
 set(FILEFACE FileFace.cpp)
 if (GRAPHITE2_NFILEFACE)
     add_definitions(-DGRAPHITE2_NFILEFACE)
     set(FILEFACE)
-endif (GRAPHITE2_NFILEFACE)
+endif()
 
 set(TRACING json.cpp)
 if (GRAPHITE2_NTRACING)
     add_definitions(-DGRAPHITE2_NTRACING)
     set(TRACING)
-endif (GRAPHITE2_NTRACING)
+endif()
 
 if (GRAPHITE2_TELEMETRY)
     add_definitions(-DGRAPHITE2_TELEMETRY)
-endif (GRAPHITE2_TELEMETRY)
+endif()
 
 if (NOT BUILD_SHARED_LIBS)
     add_definitions(-DGRAPHITE2_STATIC)
-endif (NOT BUILD_SHARED_LIBS)
+endif()
 
 set(GRAPHITE_HEADERS
     ../include/graphite2/Font.h
     ../include/graphite2/Segment.h
     ../include/graphite2/Types.h
     ../include/graphite2/Log.h
     )
 
@@ -104,53 +104,53 @@ set_target_properties(graphite2 PROPERTI
 
 if  (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
     set_target_properties(graphite2 PROPERTIES
         COMPILE_FLAGS   "-Wall -Wextra -Wno-unknown-pragmas -Wendif-labels -Wshadow -Wctor-dtor-privacy -Wnon-virtual-dtor -fno-rtti -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden"
         LINK_FLAGS      "-nodefaultlibs ${GRAPHITE_LINK_FLAGS}"
         LINKER_LANGUAGE C)
     if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86|i.86")
         add_definitions(-mfpmath=sse -msse2)
-    endif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86|i.86")
+    endif()
     if (CMAKE_COMPILER_IS_GNUCXX)
         add_definitions(-Wdouble-promotion)
-    endif (CMAKE_COMPILER_IS_GNUCXX)
+    endif()
     message(STATUS "Compiler ID is: ${CMAKE_CXX_COMPILER_ID}")
     if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
         add_definitions(-Wimplicit-fallthrough -Wshorten-64-to-32)
-    endif (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
+    endif()
     if (${CMAKE_CXX_COMPILER} MATCHES  ".*mingw.*")
         target_link_libraries(graphite2 kernel32 msvcr90 mingw32 gcc user32)
     else (${CMAKE_CXX_COMPILER} MATCHES  ".*mingw.*")
         if (GRAPHITE2_SANITIZERS)
             target_link_libraries(graphite2 c gcc_s)
         else ()
             target_link_libraries(graphite2 c gcc)
         endif ()
-    endif (${CMAKE_CXX_COMPILER} MATCHES  ".*mingw.*")
+    endif()
     include(Graphite)
     if (BUILD_SHARED_LIBS)
         nolib_test(stdc++ $<TARGET_SONAME_FILE:graphite2>)
     endif ()
     set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "")
     CREATE_LIBTOOL_FILE(graphite2 "/lib${LIB_SUFFIX}")
-endif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+endif()
 
 if  (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
     set_target_properties(graphite2 PROPERTIES
         COMPILE_FLAGS   "-Wall -Wextra -Wno-unknown-pragmas -Wimplicit-fallthrough -Wendif-labels -Wshadow -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -fno-rtti -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden -mfpmath=sse -msse2"
         LINK_FLAGS      "-nodefaultlibs"
         LINKER_LANGUAGE C)
     target_link_libraries(graphite2 c)
     include(Graphite)
     nolib_test(stdc++ $<TARGET_SONAME_FILE:graphite2>)
     set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "")
     CREATE_LIBTOOL_FILE(graphite2 "/lib${LIB_SUFFIX}")
-endif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
+endif()
 
 if  (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
     set_target_properties(graphite2 PROPERTIES
         COMPILE_DEFINITIONS "_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;UNICODE;GRAPHITE2_EXPORTING")
-endif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+endif()
 
 
 install(TARGETS graphite2 EXPORT graphite2 LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX} PUBLIC_HEADER DESTINATION include/graphite2 RUNTIME DESTINATION bin)
 install(EXPORT graphite2 DESTINATION share/graphite2 NAMESPACE gr2_)
--- a/gfx/graphite2/src/Collider.cpp
+++ b/gfx/graphite2/src/Collider.cpp
@@ -988,17 +988,17 @@ bool KernCollider::mergeSlot(Segment *se
                 _nearEdges[i] = m * rtl;
             }
 #endif
         }
         else
             nooverlap = false;
     }
     if (nooverlap)
-        _mingap = max(_mingap, _xbound + currSpace + _margin - x);
+        _mingap = max(_mingap, _xbound - rtl * (currSpace + _margin + x));
     if (collides && !nooverlap)
         _hit = true;
     return collides | nooverlap;   // note that true is not a necessarily reliable value
 
 }   // end of KernCollider::mergeSlot
 
 
 // Return the amount to kern by.
--- a/gfx/graphite2/src/GlyphCache.cpp
+++ b/gfx/graphite2/src/GlyphCache.cpp
@@ -159,16 +159,20 @@ GlyphCache::GlyphCache(const Face & face
             if (!currbox)
             {
                 free(boxes);
                 _boxes[0] = 0;
             }
         }
         delete _glyph_loader;
         _glyph_loader = 0;
+	// coverity[leaked_storage : FALSE] - calling read_glyph on index 0 saved
+	// glyphs as _glyphs[0]. Setting _glyph_loader to nullptr here flags that
+	// the dtor needs to call delete[] on _glyphs[0] to release what was allocated
+	// as glyphs
     }
 
     if (_glyphs && glyph(0) == 0)
     {
         free(_glyphs);
         _glyphs = 0;
         if (_boxes)
         {
--- a/gfx/graphite2/src/inc/TtfTypes.h
+++ b/gfx/graphite2/src/inc/TtfTypes.h
@@ -74,17 +74,17 @@ enum
     OneFix = 1<<16
 };
 
 //**********************************************************************************************
 //  Table declarations
 //**********************************************************************************************
 namespace Sfnt
 {
-#pragma pack(1) // We need this or the structure members aren't aligned
+#pragma pack(push,1) // We need this or the structure members aren't aligned
                         // correctly.  Fortunately this form of pragma is supposed
                         // to be recognised by VS C++ too (at least according to
                         // MSDN).
 
     struct OffsetSubTable
     {
         uint32  scaler_type;
         uint16  num_tables,
@@ -407,13 +407,13 @@ namespace Sfnt
             HaveInstructions = 0x100,
             UseMyMetrics    = 0x200,
             OverlapCompund  = 0x400,
             ScaledOffset    = 0x800,
             UnscaledOffset  = 0x1000
         };
     };
 
-#pragma pack()
+#pragma pack(pop)
 } // end of namespace Sfnt
 
 } // end of namespace TtfUtil
 } // end of namespace graphite2