Don't call `ft_fseek' every time when executing `ft_fread'.
* src/base/ftstream.c (FT_Stream_Seek), src/base/ftsystem.c (ft_ansi_stream_io): Implement it.
This commit is contained in:
parent
2b6a3f0be9
commit
efaf5abcf8
|
@ -1,3 +1,10 @@
|
|||
2009-08-03 suyu0925@gmail.com
|
||||
|
||||
Don't call `ft_fseek' every time when executing `ft_fread'.
|
||||
|
||||
* src/base/ftstream.c (FT_Stream_Seek), src/base/ftsystem.c
|
||||
(ft_ansi_stream_io): Implement it.
|
||||
|
||||
2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
|
||||
|
||||
sfnt: Cast a charcode to 32-bit in cmap format 14 parser.
|
||||
|
|
|
@ -60,8 +60,6 @@
|
|||
FT_Error error = FT_Err_Ok;
|
||||
|
||||
|
||||
stream->pos = pos;
|
||||
|
||||
if ( stream->read )
|
||||
{
|
||||
if ( stream->read( stream, pos, 0, 0 ) )
|
||||
|
@ -83,6 +81,9 @@
|
|||
error = FT_Err_Invalid_Stream_Operation;
|
||||
}
|
||||
|
||||
if ( !error )
|
||||
stream->pos = pos;
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* ANSI-specific FreeType low-level system interface (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2006, 2008 by */
|
||||
/* Copyright 1996-2001, 2002, 2006, 2008, 2009 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -205,6 +205,7 @@
|
|||
|
||||
file = STREAM_FILE( stream );
|
||||
|
||||
if ( stream->pos != offset )
|
||||
ft_fseek( file, offset, SEEK_SET );
|
||||
|
||||
return (unsigned long)ft_fread( buffer, 1, count, file );
|
||||
|
|
Loading…
Reference in New Issue