Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Unified Diff: third_party/freetype/src/base/ftbbox.c

Issue 1413673003: Update bundled freetype to 2.6.1 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: DEPS for corpus Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/freetype/src/base/ftbase.c ('k') | third_party/freetype/src/base/ftbdf.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/freetype/src/base/ftbbox.c
diff --git a/third_party/freetype/src/base/ftbbox.c b/third_party/freetype/src/base/ftbbox.c
index c775d5c8cf0f7133db97fd35ebda16373b41fb1d..10df98de6ad27c3785a69c68a743dad322b2a684 100644
--- a/third_party/freetype/src/base/ftbbox.c
+++ b/third_party/freetype/src/base/ftbbox.c
@@ -4,7 +4,7 @@
/* */
/* FreeType bbox computation (body). */
/* */
-/* Copyright 1996-2002, 2004, 2006, 2010, 2013, 2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
@@ -42,22 +42,22 @@
} TBBox_Rec;
-#define FT_UPDATE_BBOX(p, bbox) \
- FT_BEGIN_STMNT \
- if ( p->x < bbox.xMin ) \
- bbox.xMin = p->x; \
- if ( p->x > bbox.xMax ) \
- bbox.xMax = p->x; \
- if ( p->y < bbox.yMin ) \
- bbox.yMin = p->y; \
- if ( p->y > bbox.yMax ) \
- bbox.yMax = p->y; \
+#define FT_UPDATE_BBOX( p, bbox ) \
+ FT_BEGIN_STMNT \
+ if ( p->x < bbox.xMin ) \
+ bbox.xMin = p->x; \
+ if ( p->x > bbox.xMax ) \
+ bbox.xMax = p->x; \
+ if ( p->y < bbox.yMin ) \
+ bbox.yMin = p->y; \
+ if ( p->y > bbox.yMax ) \
+ bbox.yMax = p->y; \
FT_END_STMNT
-#define CHECK_X( p, bbox ) \
+#define CHECK_X( p, bbox ) \
( p->x < bbox.xMin || p->x > bbox.xMax )
-#define CHECK_Y( p, bbox ) \
+#define CHECK_Y( p, bbox ) \
( p->y < bbox.yMin || p->y > bbox.yMax )
@@ -255,6 +255,7 @@
FT_Pos peak = 0;
FT_Int shift;
+
/* This function finds a peak of a cubic segment if it is above 0 */
/* using iterative bisection of the segment, or returns 0. */
/* The fixed-point arithmetic of bisection is inherently stable */
@@ -264,8 +265,10 @@
/* It is called with either q2 or q3 positive, which is necessary */
/* for the peak to exist and avoids undefined FT_MSB. */
- shift = 27 -
- FT_MSB( FT_ABS( q1 ) | FT_ABS( q2 ) | FT_ABS( q3 ) | FT_ABS( q4 ) );
+ shift = 27 - FT_MSB( (FT_UInt32)( FT_ABS( q1 ) |
+ FT_ABS( q2 ) |
+ FT_ABS( q3 ) |
+ FT_ABS( q4 ) ) );
if ( shift > 0 )
{
@@ -419,7 +422,8 @@
return 0;
}
-FT_DEFINE_OUTLINE_FUNCS(bbox_interface,
+
+ FT_DEFINE_OUTLINE_FUNCS(bbox_interface,
(FT_Outline_MoveTo_Func) BBox_Move_To,
(FT_Outline_LineTo_Func) BBox_Line_To,
(FT_Outline_ConicTo_Func)BBox_Conic_To,
@@ -427,14 +431,17 @@ FT_DEFINE_OUTLINE_FUNCS(bbox_interface,
0, 0
)
+
/* documentation is in ftbbox.h */
FT_EXPORT_DEF( FT_Error )
FT_Outline_Get_BBox( FT_Outline* outline,
FT_BBox *abbox )
{
- FT_BBox cbox = { 0x7FFFFFFF, 0x7FFFFFFF, -0x7FFFFFFF, -0x7FFFFFFF };
- FT_BBox bbox = { 0x7FFFFFFF, 0x7FFFFFFF, -0x7FFFFFFF, -0x7FFFFFFF };
+ FT_BBox cbox = { 0x7FFFFFFFL, 0x7FFFFFFFL,
+ -0x7FFFFFFFL, -0x7FFFFFFFL };
+ FT_BBox bbox = { 0x7FFFFFFFL, 0x7FFFFFFFL,
+ -0x7FFFFFFFL, -0x7FFFFFFFL };
FT_Vector* vec;
FT_UShort n;
« no previous file with comments | « third_party/freetype/src/base/ftbase.c ('k') | third_party/freetype/src/base/ftbdf.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698