< prev index next >

src/java.desktop/share/native/libfreetype/src/base/ftstroke.c

Print this page

        

@@ -1,40 +1,35 @@
-/***************************************************************************/
-/*                                                                         */
-/*  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>
 #include FT_STROKER_H
 #include FT_TRIGONOMETRY_H
 #include FT_OUTLINE_H
 #include FT_INTERNAL_MEMORY_H
 #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
+  /* allocated  in `ftglyph.c'                                     */
   FT_CALLBACK_TABLE const FT_Glyph_Class  ft_outline_glyph_class;
-#endif
 
 
   /* documentation is in ftstroke.h */
 
   FT_EXPORT_DEF( FT_StrokerBorder )

@@ -370,10 +365,11 @@
     {
       /* copy the last point to the start of this sub-path, since */
       /* it contains the `adjusted' starting coordinates          */
       border->num_points    = --count;
       border->points[start] = border->points[count];
+      border->tags[start]   = border->tags[count];
 
       if ( reverse )
       {
         /* reverse the points */
         {

@@ -434,12 +430,12 @@
       /* move last point */
       border->points[border->num_points - 1] = *to;
     }
     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;
 
       /* add one point */

@@ -2304,21 +2300,16 @@
                    FT_Bool      destroy )
   {
     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;
 
     {
       FT_Glyph  copy;
 

@@ -2384,21 +2375,16 @@
                          FT_Bool      destroy )
   {
     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;
 
     {
       FT_Glyph  copy;
 
< prev index next >