mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-26 01:11:25 +01:00
[hvgl] Micro-optimize transformations
This commit is contained in:
1 parent
6010b089a1
commit
07a15ec794
2 files changed
+7
-4
No files matched your search
@@ -328,9 +328,9 @@ PartShape::get_path_at (const struct hvgl &hvgl,
|
||||
|
||||
double x1 = segment[SEGMENT_POINT_OFF_CURVE_X];
|
||||
double y1 = segment[SEGMENT_POINT_OFF_CURVE_Y];
|
||||
transform.transform_point (x1, y1);
|
||||
double x2 = next_segment[SEGMENT_POINT_ON_CURVE_X];
|
||||
double y2 = next_segment[SEGMENT_POINT_ON_CURVE_Y];
|
||||
transform.transform_point (x1, y1);
|
||||
transform.transform_point (x2, y2);
|
||||
draw_session.quadratic_to ((float) x1, (float) y1, (float) x2, (float) y2);
|
||||
}
|
||||
|
||||
+6
-3
@@ -134,6 +134,7 @@ struct hb_transform_t
|
||||
};
|
||||
}
|
||||
|
||||
HB_ALWAYS_INLINE
|
||||
void transform_distance (Float &dx, Float &dy) const
|
||||
{
|
||||
Float new_x = xx * dx + xy * dy;
|
||||
@@ -142,11 +143,13 @@ struct hb_transform_t
|
||||
dy = new_y;
|
||||
}
|
||||
|
||||
HB_ALWAYS_INLINE
|
||||
void transform_point (Float &x, Float &y) const
|
||||
{
|
||||
transform_distance (x, y);
|
||||
x += x0;
|
||||
y += y0;
|
||||
Float new_x = x0 + xx * x + xy * y;
|
||||
Float new_y = y0 + yx * x + yy * y;
|
||||
x = new_x;
|
||||
y = new_y;
|
||||
}
|
||||
|
||||
void transform_extents (hb_extents_t<Float> &extents) const
|
||||
|
||||
Reference in new issue
Block a user