summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authornikitalita <69168929+nikitalita@users.noreply.github.com>2022-10-16 22:27:23 -0700
committernikitalita <69168929+nikitalita@users.noreply.github.com>2022-10-16 22:29:26 -0700
commit21341ddaed0469baa8f24b4c2fae76275cce59e0 (patch)
tree42d33322be571fcd7e5bdca991f61f186c2422c2 /modules
parent0d28820c816fa66b66a98cc6c9df25ff74cbb19f (diff)
Speed up `find_texture_pos_for_glyph()`
Diffstat (limited to 'modules')
-rw-r--r--modules/text_server_adv/text_server_adv.cpp4
-rw-r--r--modules/text_server_fb/text_server_fb.cpp3
2 files changed, 4 insertions, 3 deletions
diff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp
index eb398f77c7..3e09c7e42e 100644
--- a/modules/text_server_adv/text_server_adv.cpp
+++ b/modules/text_server_adv/text_server_adv.cpp
@@ -810,12 +810,12 @@ _FORCE_INLINE_ TextServerAdvanced::FontTexturePosition TextServerAdvanced::find_
ret.y = 0x7fffffff;
ret.x = 0;
+ const int *ct_offsets_ptr = ct.offsets.ptr();
for (int j = 0; j < ct.texture_w - mw; j++) {
int max_y = 0;
-
for (int k = j; k < j + mw; k++) {
- int y = ct.offsets[k];
+ int y = ct_offsets_ptr[k];
if (y > max_y) {
max_y = y;
}
diff --git a/modules/text_server_fb/text_server_fb.cpp b/modules/text_server_fb/text_server_fb.cpp
index 13c997c981..82b781adab 100644
--- a/modules/text_server_fb/text_server_fb.cpp
+++ b/modules/text_server_fb/text_server_fb.cpp
@@ -233,12 +233,13 @@ _FORCE_INLINE_ TextServerFallback::FontTexturePosition TextServerFallback::find_
ret.y = 0x7fffffff;
ret.x = 0;
+ const int *ct_offsets_ptr = ct.offsets.ptr();
for (int j = 0; j < ct.texture_w - mw; j++) {
int max_y = 0;
for (int k = j; k < j + mw; k++) {
- int y = ct.offsets[k];
+ int y = ct_offsets_ptr[k];
if (y > max_y) {
max_y = y;
}