@@ -888,7 +888,7 @@ struct hb_ot_apply_context_t :
888
888
}
889
889
};
890
890
891
- enum class hb_ot_lookup_cache_op_t
891
+ enum class hb_ot_subtable_cache_op_t
892
892
{
893
893
CREATE,
894
894
ENTER,
@@ -920,22 +920,22 @@ struct hb_accelerate_subtables_context_t :
920
920
921
921
template <typename T>
922
922
static inline auto cache_func_ (void *p,
923
- hb_ot_lookup_cache_op_t op,
923
+ hb_ot_subtable_cache_op_t op,
924
924
hb_priority<1 >) HB_RETURN (void *, T::cache_func (p, op) )
925
925
template <typename T=void>
926
926
static inline void * cache_func_ (void *p,
927
- hb_ot_lookup_cache_op_t op HB_UNUSED,
927
+ hb_ot_subtable_cache_op_t op HB_UNUSED,
928
928
hb_priority<0 >) { return (void *) false ; }
929
929
template <typename Type>
930
930
static inline void * cache_func_to (void *p,
931
- hb_ot_lookup_cache_op_t op)
931
+ hb_ot_subtable_cache_op_t op)
932
932
{
933
933
return cache_func_<Type> (p, op, hb_prioritize);
934
934
}
935
935
#endif
936
936
937
937
typedef bool (*hb_apply_func_t ) (const void *obj, hb_ot_apply_context_t *c);
938
- typedef void * (*hb_cache_func_t ) (void *p, hb_ot_lookup_cache_op_t op);
938
+ typedef void * (*hb_cache_func_t ) (void *p, hb_ot_subtable_cache_op_t op);
939
939
940
940
struct hb_applicable_t
941
941
{
@@ -972,11 +972,11 @@ struct hb_accelerate_subtables_context_t :
972
972
}
973
973
bool cache_enter (hb_ot_apply_context_t *c) const
974
974
{
975
- return (bool ) cache_func (c, hb_ot_lookup_cache_op_t ::ENTER);
975
+ return (bool ) cache_func (c, hb_ot_subtable_cache_op_t ::ENTER);
976
976
}
977
977
void cache_leave (hb_ot_apply_context_t *c) const
978
978
{
979
- cache_func (c, hb_ot_lookup_cache_op_t ::LEAVE);
979
+ cache_func (c, hb_ot_subtable_cache_op_t ::LEAVE);
980
980
}
981
981
#endif
982
982
@@ -1021,10 +1021,10 @@ struct hb_accelerate_subtables_context_t :
1021
1021
* and we allocate the cache opportunity to the costliest subtable.
1022
1022
*/
1023
1023
unsigned cost = cache_cost (obj, hb_prioritize);
1024
- if (cost > cache_user_cost )
1024
+ if (cost > subtable_cache_user_cost )
1025
1025
{
1026
- cache_user_idx = i - 1 ;
1027
- cache_user_cost = cost;
1026
+ subtable_cache_user_idx = i - 1 ;
1027
+ subtable_cache_user_cost = cost;
1028
1028
}
1029
1029
#endif
1030
1030
@@ -1039,8 +1039,8 @@ struct hb_accelerate_subtables_context_t :
1039
1039
unsigned i = 0 ;
1040
1040
1041
1041
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
1042
- unsigned cache_user_idx = (unsigned ) -1 ;
1043
- unsigned cache_user_cost = 0 ;
1042
+ unsigned subtable_cache_user_idx = (unsigned ) -1 ;
1043
+ unsigned subtable_cache_user_cost = 0 ;
1044
1044
#endif
1045
1045
};
1046
1046
@@ -2623,13 +2623,13 @@ struct ContextFormat2_5
2623
2623
unsigned c = (this +classDef).cost () * ruleSet.len ;
2624
2624
return c >= 4 ? c : 0 ;
2625
2625
}
2626
- static void * cache_func (void *p, hb_ot_lookup_cache_op_t op)
2626
+ static void * cache_func (void *p, hb_ot_subtable_cache_op_t op)
2627
2627
{
2628
2628
switch (op)
2629
2629
{
2630
- case hb_ot_lookup_cache_op_t ::CREATE:
2630
+ case hb_ot_subtable_cache_op_t ::CREATE:
2631
2631
return (void *) true ;
2632
- case hb_ot_lookup_cache_op_t ::ENTER:
2632
+ case hb_ot_subtable_cache_op_t ::ENTER:
2633
2633
{
2634
2634
hb_ot_apply_context_t *c = (hb_ot_apply_context_t *) p;
2635
2635
if (!HB_BUFFER_TRY_ALLOCATE_VAR (c->buffer , syllable))
@@ -2641,14 +2641,14 @@ struct ContextFormat2_5
2641
2641
c->new_syllables = 255 ;
2642
2642
return (void *) true ;
2643
2643
}
2644
- case hb_ot_lookup_cache_op_t ::LEAVE:
2644
+ case hb_ot_subtable_cache_op_t ::LEAVE:
2645
2645
{
2646
2646
hb_ot_apply_context_t *c = (hb_ot_apply_context_t *) p;
2647
2647
c->new_syllables = (unsigned ) -1 ;
2648
2648
HB_BUFFER_DEALLOCATE_VAR (c->buffer , syllable);
2649
2649
return nullptr ;
2650
2650
}
2651
- case hb_ot_lookup_cache_op_t ::DESTROY:
2651
+ case hb_ot_subtable_cache_op_t ::DESTROY:
2652
2652
return nullptr ;
2653
2653
}
2654
2654
return nullptr ;
@@ -3873,13 +3873,13 @@ struct ChainContextFormat2_5
3873
3873
{
3874
3874
return (this +lookaheadClassDef).cost () * ruleSet.len ;
3875
3875
}
3876
- static void * cache_func (void *p, hb_ot_lookup_cache_op_t op)
3876
+ static void * cache_func (void *p, hb_ot_subtable_cache_op_t op)
3877
3877
{
3878
3878
switch (op)
3879
3879
{
3880
- case hb_ot_lookup_cache_op_t ::CREATE:
3880
+ case hb_ot_subtable_cache_op_t ::CREATE:
3881
3881
return (void *) true ;
3882
- case hb_ot_lookup_cache_op_t ::ENTER:
3882
+ case hb_ot_subtable_cache_op_t ::ENTER:
3883
3883
{
3884
3884
hb_ot_apply_context_t *c = (hb_ot_apply_context_t *) p;
3885
3885
if (!HB_BUFFER_TRY_ALLOCATE_VAR (c->buffer , syllable))
@@ -3891,14 +3891,14 @@ struct ChainContextFormat2_5
3891
3891
c->new_syllables = 255 ;
3892
3892
return (void *) true ;
3893
3893
}
3894
- case hb_ot_lookup_cache_op_t ::LEAVE:
3894
+ case hb_ot_subtable_cache_op_t ::LEAVE:
3895
3895
{
3896
3896
hb_ot_apply_context_t *c = (hb_ot_apply_context_t *) p;
3897
3897
c->new_syllables = (unsigned ) -1 ;
3898
3898
HB_BUFFER_DEALLOCATE_VAR (c->buffer , syllable);
3899
3899
return nullptr ;
3900
3900
}
3901
- case hb_ot_lookup_cache_op_t ::DESTROY:
3901
+ case hb_ot_subtable_cache_op_t ::DESTROY:
3902
3902
return nullptr ;
3903
3903
}
3904
3904
return nullptr ;
@@ -4427,20 +4427,20 @@ struct hb_ot_layout_lookup_accelerator_t
4427
4427
thiz->digest .union_ (subtable.digest );
4428
4428
4429
4429
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
4430
- if (c_accelerate_subtables.cache_user_cost < 4 )
4431
- c_accelerate_subtables.cache_user_idx = (unsigned ) -1 ;
4430
+ if (c_accelerate_subtables.subtable_cache_user_cost < 4 )
4431
+ c_accelerate_subtables.subtable_cache_user_idx = (unsigned ) -1 ;
4432
4432
4433
- thiz->cache_user_idx = c_accelerate_subtables.cache_user_idx ;
4433
+ thiz->subtable_cache_user_idx = c_accelerate_subtables.subtable_cache_user_idx ;
4434
4434
4435
- if (thiz->cache_user_idx != (unsigned ) -1 )
4435
+ if (thiz->subtable_cache_user_idx != (unsigned ) -1 )
4436
4436
{
4437
- thiz->cache = thiz->subtables [thiz->cache_user_idx ].cache_func (nullptr , hb_ot_lookup_cache_op_t ::CREATE);
4438
- if (!thiz->cache )
4439
- thiz->cache_user_idx = (unsigned ) -1 ;
4437
+ thiz->subtable_cache = thiz->subtables [thiz->subtable_cache_user_idx ].cache_func (nullptr , hb_ot_subtable_cache_op_t ::CREATE);
4438
+ if (!thiz->subtable_cache )
4439
+ thiz->subtable_cache_user_idx = (unsigned ) -1 ;
4440
4440
}
4441
4441
4442
4442
for (unsigned i = 0 ; i < count; i++)
4443
- if (i != thiz->cache_user_idx )
4443
+ if (i != thiz->subtable_cache_user_idx )
4444
4444
thiz->subtables [i].apply_cached_func = thiz->subtables [i].apply_func ;
4445
4445
#endif
4446
4446
@@ -4450,10 +4450,10 @@ struct hb_ot_layout_lookup_accelerator_t
4450
4450
void fini ()
4451
4451
{
4452
4452
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
4453
- if (cache )
4453
+ if (subtable_cache )
4454
4454
{
4455
- assert (cache_user_idx != (unsigned ) -1 );
4456
- subtables[cache_user_idx ].cache_func (cache, hb_ot_lookup_cache_op_t ::DESTROY);
4455
+ assert (subtable_cache_user_idx != (unsigned ) -1 );
4456
+ subtables[subtable_cache_user_idx ].cache_func (subtable_cache, hb_ot_subtable_cache_op_t ::DESTROY);
4457
4457
}
4458
4458
#endif
4459
4459
}
@@ -4491,26 +4491,26 @@ struct hb_ot_layout_lookup_accelerator_t
4491
4491
bool cache_enter (hb_ot_apply_context_t *c) const
4492
4492
{
4493
4493
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
4494
- return cache_user_idx != (unsigned ) -1 &&
4495
- subtables[cache_user_idx ].cache_enter (c);
4494
+ return subtable_cache_user_idx != (unsigned ) -1 &&
4495
+ subtables[subtable_cache_user_idx ].cache_enter (c);
4496
4496
#else
4497
4497
return false ;
4498
4498
#endif
4499
4499
}
4500
4500
void cache_leave (hb_ot_apply_context_t *c) const
4501
4501
{
4502
4502
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
4503
- subtables[cache_user_idx ].cache_leave (c);
4503
+ subtables[subtable_cache_user_idx ].cache_leave (c);
4504
4504
#endif
4505
4505
}
4506
4506
4507
4507
4508
4508
hb_set_digest_t digest;
4509
4509
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
4510
4510
public:
4511
- void *cache = nullptr ;
4511
+ void *subtable_cache = nullptr ;
4512
4512
private:
4513
- unsigned cache_user_idx = (unsigned ) -1 ;
4513
+ unsigned subtable_cache_user_idx = (unsigned ) -1 ;
4514
4514
#endif
4515
4515
private:
4516
4516
hb_accelerate_subtables_context_t ::hb_applicable_t subtables[HB_VAR_ARRAY];
0 commit comments