Skip to content

Commit e19730b

Browse files
committed
Cache-friendler blending loops in FontFreeType::getGlyphBitmapByIndex.
1 parent 42d59d2 commit e19730b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/2d/FontFreeType.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -545,9 +545,9 @@ unsigned char* FontFreeType::getGlyphBitmapByIndex(unsigned int glyphIndex,
545545

546546
auto px = outlineMinX - blendImageMinX;
547547
auto py = blendImageMaxY - outlineMaxY;
548-
for (int x = 0; x < outlineWidth; ++x)
548+
for (int y = 0; y < outlineHeight; ++y)
549549
{
550-
for (int y = 0; y < outlineHeight; ++y)
550+
for (int x = 0; x < outlineWidth; ++x)
551551
{
552552
index = px + x + ((py + y) * blendWidth);
553553
index2 = x + (y * outlineWidth);
@@ -557,9 +557,9 @@ unsigned char* FontFreeType::getGlyphBitmapByIndex(unsigned int glyphIndex,
557557

558558
px = glyphMinX - blendImageMinX;
559559
py = blendImageMaxY - glyphMaxY;
560-
for (int x = 0; x < outWidth; ++x)
560+
for (int y = 0; y < outHeight; ++y)
561561
{
562-
for (int y = 0; y < outHeight; ++y)
562+
for (int x = 0; x < outWidth; ++x)
563563
{
564564
index = px + x + ((y + py) * blendWidth);
565565
index2 = x + (y * outWidth);

0 commit comments

Comments
 (0)