[ft-paint] Implement FT_COLR_PAINTFORMAT_ROTATE

pull/3938/head
Behdad Esfahbod 2 years ago
parent 16598e024b
commit ddbe4e52ec
  1. 20
      src/hb-ft-colr.hh

@ -188,7 +188,25 @@ _hb_ft_paint (FT_OpaquePaint opaque_paint,
paint_funcs->pop_transform (paint_data);
}
break;
case FT_COLR_PAINTFORMAT_ROTATE: break;
case FT_COLR_PAINTFORMAT_ROTATE:
{
float a = paint.u.rotate.angle / 65536.f;
float cc = cosf (a * (float) M_PI);
float ss = sinf (a * (float) M_PI);
paint_funcs->push_transform (paint_data,
1.f, 0.f, 0.f, 1.f,
-paint.u.rotate.center_x / 65536.f,
-paint.u.rotate.center_y / 65536.f);
paint_funcs->push_transform (paint_data, cc, ss, -ss, cc, 0., 0.);
paint_funcs->push_transform (paint_data,
1.f, 0.f, 0.f, 1.f,
+paint.u.rotate.center_x / 65536.f,
+paint.u.rotate.center_y / 65536.f);
paint_recurse (paint.u.rotate.paint);
paint_funcs->pop_transform (paint_data);
paint_funcs->pop_transform (paint_data);
paint_funcs->pop_transform (paint_data);
}
case FT_COLR_PAINTFORMAT_SKEW: break;
case FT_COLR_PAINTFORMAT_COMPOSITE:
{

Loading…
Cancel
Save