@@ -13,7 +13,7 @@ namespace OT {
1313
1414struct hb_transforming_pen_context_t
1515{
16- hb_transform_t transform;
16+ hb_transform_t <> transform;
1717 hb_draw_funcs_t *dfuncs;
1818 void *data;
1919 hb_draw_state_t *st;
@@ -130,9 +130,9 @@ hb_ubytes_t
130130VarComponent::get_path_at (const hb_varc_context_t &c,
131131 hb_codepoint_t parent_gid,
132132 hb_array_t <const int > coords,
133- hb_transform_t total_transform,
133+ hb_transform_t <> total_transform,
134134 hb_ubytes_t total_record,
135- VarRegionList:: cache_t *cache) const
135+ hb_scalar_cache_t *cache) const
136136{
137137 const unsigned char *end = total_record.arrayZ + total_record.length ;
138138 const unsigned char *record = total_record.arrayZ ;
@@ -216,7 +216,7 @@ VarComponent::get_path_at (const hb_varc_context_t &c,
216216 * limit on the max number of coords for now. */
217217 if ((flags & (unsigned ) flags_t ::RESET_UNSPECIFIED_AXES) ||
218218 coords.length > HB_VAR_COMPOSITE_MAX_AXES)
219- component_coords = hb_array< int > (c.font ->coords , c.font ->num_coords );
219+ component_coords = hb_array (c.font ->coords , c.font ->num_coords );
220220
221221 // Transform
222222
@@ -226,28 +226,28 @@ VarComponent::get_path_at (const hb_varc_context_t &c,
226226
227227#define PROCESS_TRANSFORM_COMPONENTS \
228228 HB_STMT_START { \
229- PROCESS_TRANSFORM_COMPONENT (FWORD, HAVE_TRANSLATE_X, translateX); \
230- PROCESS_TRANSFORM_COMPONENT (FWORD, HAVE_TRANSLATE_Y, translateY); \
231- PROCESS_TRANSFORM_COMPONENT (F4DOT12, HAVE_ROTATION, rotation); \
232- PROCESS_TRANSFORM_COMPONENT (F6DOT10, HAVE_SCALE_X, scaleX); \
233- PROCESS_TRANSFORM_COMPONENT (F6DOT10, HAVE_SCALE_Y, scaleY); \
234- PROCESS_TRANSFORM_COMPONENT (F4DOT12, HAVE_SKEW_X, skewX); \
235- PROCESS_TRANSFORM_COMPONENT (F4DOT12, HAVE_SKEW_Y, skewY); \
236- PROCESS_TRANSFORM_COMPONENT (FWORD, HAVE_TCENTER_X, tCenterX); \
237- PROCESS_TRANSFORM_COMPONENT (FWORD, HAVE_TCENTER_Y, tCenterY); \
229+ PROCESS_TRANSFORM_COMPONENT (FWORD, 1 . 0f , HAVE_TRANSLATE_X, translateX); \
230+ PROCESS_TRANSFORM_COMPONENT (FWORD, 1 . 0f , HAVE_TRANSLATE_Y, translateY); \
231+ PROCESS_TRANSFORM_COMPONENT (F4DOT12, HB_PI, HAVE_ROTATION, rotation); \
232+ PROCESS_TRANSFORM_COMPONENT (F6DOT10, 1 . 0f , HAVE_SCALE_X, scaleX); \
233+ PROCESS_TRANSFORM_COMPONENT (F6DOT10, 1 . 0f , HAVE_SCALE_Y, scaleY); \
234+ PROCESS_TRANSFORM_COMPONENT (F4DOT12, HB_PI, HAVE_SKEW_X, skewX); \
235+ PROCESS_TRANSFORM_COMPONENT (F4DOT12, HB_PI, HAVE_SKEW_Y, skewY); \
236+ PROCESS_TRANSFORM_COMPONENT (FWORD, 1 . 0f , HAVE_TCENTER_X, tCenterX); \
237+ PROCESS_TRANSFORM_COMPONENT (FWORD, 1 . 0f , HAVE_TCENTER_Y, tCenterY); \
238238 } HB_STMT_END
239239
240- hb_transform_decomposed_t transform;
240+ hb_transform_decomposed_t <> transform;
241241
242242 // Read transform components
243- #define PROCESS_TRANSFORM_COMPONENT (type, flag, name ) \
243+ #define PROCESS_TRANSFORM_COMPONENT (type, mult, flag, name ) \
244244 if (flags & (unsigned ) flags_t ::flag) \
245245 { \
246246 static_assert (type::static_size == HBINT16::static_size, " " ); \
247247 if (unlikely (unsigned (end - record) < HBINT16::static_size)) \
248248 return hb_ubytes_t (); \
249249 hb_barrier (); \
250- transform.name = * (const HBINT16 *) record; \
250+ transform.name = mult * * (const HBINT16 *) record; \
251251 record += HBINT16::static_size; \
252252 }
253253 PROCESS_TRANSFORM_COMPONENTS;
@@ -279,22 +279,22 @@ VarComponent::get_path_at (const hb_varc_context_t &c,
279279 {
280280 float transformValues[9 ];
281281 unsigned numTransformValues = 0 ;
282- #define PROCESS_TRANSFORM_COMPONENT (type, flag, name ) \
282+ #define PROCESS_TRANSFORM_COMPONENT (type, mult, flag, name ) \
283283 if (flags & (unsigned ) flags_t ::flag) \
284- transformValues[numTransformValues++] = transform.name ;
284+ transformValues[numTransformValues++] = transform.name / mult ;
285285 PROCESS_TRANSFORM_COMPONENTS;
286286#undef PROCESS_TRANSFORM_COMPONENT
287287 varStore.get_delta (transformVarIdx, coords, hb_array (transformValues, numTransformValues), cache);
288288 numTransformValues = 0 ;
289- #define PROCESS_TRANSFORM_COMPONENT (type, flag, name ) \
289+ #define PROCESS_TRANSFORM_COMPONENT (type, mult, flag, name ) \
290290 if (flags & (unsigned ) flags_t ::flag) \
291- transform.name = transformValues[numTransformValues++];
291+ transform.name = transformValues[numTransformValues++] * mult ;
292292 PROCESS_TRANSFORM_COMPONENTS;
293293#undef PROCESS_TRANSFORM_COMPONENT
294294 }
295295
296296 // Divide them by their divisors
297- #define PROCESS_TRANSFORM_COMPONENT (type, flag, name ) \
297+ #define PROCESS_TRANSFORM_COMPONENT (type, mult, flag, name ) \
298298 if (flags & (unsigned ) flags_t ::flag) \
299299 { \
300300 HBINT16 int_v; \
334334VARC::get_path_at (const hb_varc_context_t &c,
335335 hb_codepoint_t glyph,
336336 hb_array_t <const int > coords,
337- hb_transform_t transform,
337+ hb_transform_t <> transform,
338338 hb_codepoint_t parent_glyph,
339- VarRegionList:: cache_t *parent_cache) const
339+ hb_scalar_cache_t *parent_cache) const
340340{
341341 // Don't recurse on the same glyph.
342342 unsigned idx = glyph == parent_glyph ?
@@ -372,7 +372,7 @@ VARC::get_path_at (const hb_varc_context_t &c,
372372#endif
373373 return false ;
374374
375- hb_extents_t comp_extents (glyph_extents);
375+ hb_extents_t <> comp_extents (glyph_extents);
376376 transform.transform_extents (comp_extents);
377377 c.extents ->union_ (comp_extents);
378378 }
@@ -392,10 +392,10 @@ VARC::get_path_at (const hb_varc_context_t &c,
392392
393393 hb_ubytes_t record = (this +glyphRecords)[idx];
394394
395- VarRegionList:: cache_t static_cache[ sizeof ( void *) * 16 ] ;
396- VarRegionList:: cache_t *cache = parent_cache ?
395+ hb_scalar_cache_t static_cache;
396+ hb_scalar_cache_t *cache = parent_cache ?
397397 parent_cache :
398- (this +varStore).create_cache (hb_array ( static_cache) );
398+ (this +varStore).create_cache (& static_cache);
399399
400400 transform.scale (c.font ->x_multf , c.font ->y_multf );
401401
@@ -406,7 +406,7 @@ VARC::get_path_at (const hb_varc_context_t &c,
406406 cache);
407407
408408 if (cache != parent_cache)
409- (this +varStore).destroy_cache (cache, hb_array ( static_cache) );
409+ (this +varStore).destroy_cache (cache, & static_cache);
410410
411411 return true ;
412412}
0 commit comments