Henri Verbeet hverbeet@codeweavers.com wrote:
+static void d2d_point_lerp(D2D1_POINT_2F *out,
const D2D1_POINT_2F *a, const D2D1_POINT_2F *b, float t)
+{
- out->x = a->x * (1.0f - t) + b->x * t;
- out->y = a->y * (1.0f - t) + b->y * t;
+}
According to my investigation of a better bilinear blending (lerp) implementation the above formula is better to explicitely simplify to
out->x = a->x + (b->x - a->x) * t; out->y = a->y + (b->y - a->y) * t;
or even better to avoid floating point operations at all by replacing them either by fixed point math or a mmx/sse helper, which is able to considerably (x10) improve performance.