summaryrefslogtreecommitdiffstats
path: root/src/raster
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
commita38fc482eeeb2c1929803c233835369dcf1b8781 (patch)
tree73115efff0a679d5d62e2150a35d135651175ec7 /src/raster
parentf463818dd9146e11105c0572fb119e757eb47768 (diff)
downloadandroid_external_freetype-a38fc482eeeb2c1929803c233835369dcf1b8781.tar.gz
android_external_freetype-a38fc482eeeb2c1929803c233835369dcf1b8781.tar.bz2
android_external_freetype-a38fc482eeeb2c1929803c233835369dcf1b8781.zip
Initial Contribution
Diffstat (limited to 'src/raster')
-rw-r--r--src/raster/Jamfile29
-rw-r--r--src/raster/ftraster.c31
-rw-r--r--src/raster/module.mk23
-rw-r--r--src/raster/rules.mk69
4 files changed, 22 insertions, 130 deletions
diff --git a/src/raster/Jamfile b/src/raster/Jamfile
deleted file mode 100644
index f6e4251..0000000
--- a/src/raster/Jamfile
+++ /dev/null
@@ -1,29 +0,0 @@
-# FreeType 2 src/raster Jamfile
-#
-# Copyright 2001 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.
-
-SubDir FT2_TOP $(FT2_SRC_DIR) raster ;
-
-{
- local _sources ;
-
- if $(FT2_MULTI)
- {
- _sources = ftraster ftrend1 ;
- }
- else
- {
- _sources = raster ;
- }
-
- Library $(FT2_LIB) : $(_sources).c ;
-}
-
-# end of src/raster Jamfile
diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c
index 4cfca4e..86d77d4 100644
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType glyph rasterizer (body). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2005, 2007 by */
+/* Copyright 1996-2001, 2002, 2003, 2005, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -144,9 +144,7 @@
/* undefine FT_RASTER_OPTION_ANTI_ALIASING if you do not want to support */
/* 5-levels anti-aliasing */
-#ifdef FT_CONFIG_OPTION_5_GRAY_LEVELS
-#define FT_RASTER_OPTION_ANTI_ALIASING
-#endif
+#undef FT_RASTER_OPTION_ANTI_ALIASING
/* The size of the two-lines intermediate bitmap used */
/* for anti-aliasing, in bytes. */
@@ -543,6 +541,8 @@
#endif /* FT_STATIC_RASTER */
+#ifdef FT_RASTER_OPTION_ANTI_ALIASING
+
static const char count_table[256] =
{
0 , 1 , 1 , 2 , 1 , 2 , 2 , 3 , 1 , 2 , 2 , 3 , 2 , 3 , 3 , 4,
@@ -562,6 +562,8 @@ static const char count_table[256] =
3 , 4 , 4 , 5 , 4 , 5 , 5 , 6 , 4 , 5 , 5 , 6 , 5 , 6 , 6 , 7,
4 , 5 , 5 , 6 , 5 , 6 , 6 , 7 , 5 , 6 , 6 , 7 , 6 , 7 , 7 , 8 };
+#endif /* FT_RASTER_OPTION_ANTI_ALIASING */
+
/*************************************************************************/
@@ -3172,8 +3174,6 @@ static const char count_table[256] =
static void
ft_black_init( PRaster raster )
{
- FT_UNUSED( raster );
-
#ifdef FT_RASTER_OPTION_ANTI_ALIASING
FT_UInt n;
@@ -3184,6 +3184,8 @@ static const char count_table[256] =
raster->gray_width = RASTER_GRAY_LINES / 2;
+#else
+ FT_UNUSED( raster );
#endif
}
@@ -3319,14 +3321,18 @@ static const char count_table[256] =
if ( !raster || !raster->buffer || !raster->buffer_size )
return Raster_Err_Not_Ini;
+ if ( !outline )
+ return Raster_Err_Invalid;
+
/* return immediately if the outline is empty */
if ( outline->n_points == 0 || outline->n_contours <= 0 )
return Raster_Err_None;
- if ( !outline || !outline->contours || !outline->points )
+ if ( !outline->contours || !outline->points )
return Raster_Err_Invalid;
- if ( outline->n_points != outline->contours[outline->n_contours - 1] + 1 )
+ if ( outline->n_points !=
+ outline->contours[outline->n_contours - 1] + 1 )
return Raster_Err_Invalid;
worker = raster->worker;
@@ -3335,7 +3341,14 @@ static const char count_table[256] =
if ( params->flags & FT_RASTER_FLAG_DIRECT )
return Raster_Err_Unsupported;
- if ( !target_map || !target_map->buffer )
+ if ( !target_map )
+ return Raster_Err_Invalid;
+
+ /* nothing to do */
+ if ( !target_map->width || !target_map->rows )
+ return Raster_Err_None;
+
+ if ( !target_map->buffer )
return Raster_Err_Invalid;
ras.outline = *outline;
diff --git a/src/raster/module.mk b/src/raster/module.mk
deleted file mode 100644
index 59c737b..0000000
--- a/src/raster/module.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# FreeType 2 renderer module definition
-#
-
-
-# Copyright 1996-2000, 2006 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.
-
-
-FTMODULE_H_COMMANDS += RASTER_MODULE
-
-define RASTER_MODULE
-$(OPEN_DRIVER)ft_raster1_renderer_class$(CLOSE_DRIVER)
-$(ECHO_DRIVER)raster $(ECHO_DRIVER_DESC)monochrome bitmap renderer$(ECHO_DRIVER_DONE)
-endef
-
-# EOF
diff --git a/src/raster/rules.mk b/src/raster/rules.mk
deleted file mode 100644
index 0dc8782..0000000
--- a/src/raster/rules.mk
+++ /dev/null
@@ -1,69 +0,0 @@
-#
-# FreeType 2 renderer module build rules
-#
-
-
-# Copyright 1996-2000, 2001, 2003 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.
-
-
-# raster driver directory
-#
-RASTER_DIR := $(SRC_DIR)/raster
-
-# compilation flags for the driver
-#
-RASTER_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(RASTER_DIR))
-
-
-# raster driver sources (i.e., C files)
-#
-RASTER_DRV_SRC := $(RASTER_DIR)/ftraster.c \
- $(RASTER_DIR)/ftrend1.c
-
-
-# raster driver headers
-#
-RASTER_DRV_H := $(RASTER_DRV_SRC:%.c=%.h) \
- $(RASTER_DIR)/rasterrs.h
-
-
-# raster driver object(s)
-#
-# RASTER_DRV_OBJ_M is used during `multi' builds.
-# RASTER_DRV_OBJ_S is used during `single' builds.
-#
-RASTER_DRV_OBJ_M := $(RASTER_DRV_SRC:$(RASTER_DIR)/%.c=$(OBJ_DIR)/%.$O)
-RASTER_DRV_OBJ_S := $(OBJ_DIR)/raster.$O
-
-# raster driver source file for single build
-#
-RASTER_DRV_SRC_S := $(RASTER_DIR)/raster.c
-
-
-# raster driver - single object
-#
-$(RASTER_DRV_OBJ_S): $(RASTER_DRV_SRC_S) $(RASTER_DRV_SRC) \
- $(FREETYPE_H) $(RASTER_DRV_H)
- $(RASTER_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(RASTER_DRV_SRC_S))
-
-
-# raster driver - multiple objects
-#
-$(OBJ_DIR)/%.$O: $(RASTER_DIR)/%.c $(FREETYPE_H) $(RASTER_DRV_H)
- $(RASTER_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
-
-
-# update main driver object lists
-#
-DRV_OBJS_S += $(RASTER_DRV_OBJ_S)
-DRV_OBJS_M += $(RASTER_DRV_OBJ_M)
-
-
-# EOF