src/java.desktop/share/native/libfreetype/src/base/ftstroke.c
changeset 54876 da3834261f0c
parent 49234 3375a8039fde
--- a/src/java.desktop/share/native/libfreetype/src/base/ftstroke.c	Wed May 08 22:59:20 2019 -0700
+++ b/src/java.desktop/share/native/libfreetype/src/base/ftstroke.c	Thu May 09 16:09:39 2019 -0700
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ftstroke.c                                                             */
-/*                                                                         */
-/*    FreeType path stroker (body).                                        */
-/*                                                                         */
-/*  Copyright 2002-2018 by                                                 */
-/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
-/*                                                                         */
-/*  This file is part of the FreeType project, and may only be used,       */
-/*  modified, and distributed under the terms of the FreeType project      */
-/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftstroke.c
+ *
+ *   FreeType path stroker (body).
+ *
+ * Copyright (C) 2002-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT.  By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
 
 
 #include <ft2build.h>
@@ -24,15 +24,10 @@
 #include FT_INTERNAL_DEBUG_H
 #include FT_INTERNAL_OBJECTS_H
 
-#include "basepic.h"
-
-
-  /* declare an extern to access `ft_outline_glyph_class' globally     */
-  /* allocated  in `ftglyph.c', and use the FT_OUTLINE_GLYPH_CLASS_GET */
-  /* macro to access it when FT_CONFIG_OPTION_PIC is defined           */
-#ifndef FT_CONFIG_OPTION_PIC
+
+  /* declare an extern to access `ft_outline_glyph_class' globally */
+  /* allocated  in `ftglyph.c'                                     */
   FT_CALLBACK_TABLE const FT_Glyph_Class  ft_outline_glyph_class;
-#endif
 
 
   /* documentation is in ftstroke.h */
@@ -372,6 +367,7 @@
       /* it contains the `adjusted' starting coordinates          */
       border->num_points    = --count;
       border->points[start] = border->points[count];
+      border->tags[start]   = border->tags[count];
 
       if ( reverse )
       {
@@ -436,8 +432,8 @@
     }
     else
     {
-      /* don't add zero-length lineto */
-      if ( border->num_points > 0                                          &&
+      /* don't add zero-length lineto, but always add moveto */
+      if ( border->num_points > (FT_UInt)border->start                     &&
            FT_IS_SMALL( border->points[border->num_points - 1].x - to->x ) &&
            FT_IS_SMALL( border->points[border->num_points - 1].y - to->y ) )
         return error;
@@ -2087,8 +2083,8 @@
   /* documentation is in ftstroke.h */
 
   /*
-   *  The following is very similar to FT_Outline_Decompose, except
-   *  that we do support opened paths, and do not scale the outline.
+   * The following is very similar to FT_Outline_Decompose, except
+   * that we do support opened paths, and do not scale the outline.
    */
   FT_EXPORT_DEF( FT_Error )
   FT_Stroker_ParseOutline( FT_Stroker   stroker,
@@ -2306,17 +2302,12 @@
     FT_Error  error = FT_ERR( Invalid_Argument );
     FT_Glyph  glyph = NULL;
 
-    /* for FT_OUTLINE_GLYPH_CLASS_GET (in PIC mode) */
-    FT_Library  library = stroker->library;
-
-    FT_UNUSED( library );
-
 
     if ( !pglyph )
       goto Exit;
 
     glyph = *pglyph;
-    if ( !glyph || glyph->clazz != FT_OUTLINE_GLYPH_CLASS_GET )
+    if ( !glyph || glyph->clazz != &ft_outline_glyph_class )
       goto Exit;
 
     {
@@ -2386,17 +2377,12 @@
     FT_Error  error = FT_ERR( Invalid_Argument );
     FT_Glyph  glyph = NULL;
 
-    /* for FT_OUTLINE_GLYPH_CLASS_GET (in PIC mode) */
-    FT_Library  library = stroker->library;
-
-    FT_UNUSED( library );
-
 
     if ( !pglyph )
       goto Exit;
 
     glyph = *pglyph;
-    if ( !glyph || glyph->clazz != FT_OUTLINE_GLYPH_CLASS_GET )
+    if ( !glyph || glyph->clazz != &ft_outline_glyph_class )
       goto Exit;
 
     {