Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-02-15 02:22:47 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-02-15 02:22:56 +0300
commit12728d43f83e48db74470ec32d252967f8d46757 (patch)
tree2f3e2c8ef04ab974432691e0ecd06f8daf20e68d
parent635ab9d1dded4d4975bd4486718fde19e8e901ca (diff)
Revert "Fix T73763: Laggy with nodes Editor + International Fonts"
This reverts commit a21f5ec56245f7f1fbede4aa3c140a582c3a6a1b.
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c6
-rw-r--r--source/blender/editors/interface/view2d.c3
2 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index ba464c76bd1..535366b78fa 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -265,9 +265,11 @@ static void blf_glyph_cache_texture(FontBLF *font, GlyphCacheBLF *gc)
gc->p2_height = font->tex_size_max;
}
+ unsigned char *pixels = MEM_callocN((size_t)gc->p2_width * (size_t)gc->p2_height,
+ "BLF texture init");
GPUTexture *tex = GPU_texture_create_nD(
- gc->p2_width, gc->p2_height, 0, 2, NULL, GPU_R8, GPU_DATA_UNSIGNED_BYTE, 0, false, error);
-
+ gc->p2_width, gc->p2_height, 0, 2, pixels, GPU_R8, GPU_DATA_UNSIGNED_BYTE, 0, false, error);
+ MEM_freeN(pixels);
gc->textures[gc->texture_current] = tex;
GPU_texture_bind(tex, 0);
GPU_texture_wrap_mode(tex, false);
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 3ee4d6a085e..517d8ca51a3 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -1123,8 +1123,7 @@ void UI_view2d_zoom_cache_reset(void)
/* While scaling we can accumulate fonts at many sizes (~20 or so).
* Not an issue with embedded font, but can use over 500Mb with i18n ones! See [#38244]. */
- /* note: This can be very bad for performance.
- * Only some views draw text, we could check for this case to avoid clearning cache. */
+ /* note: only some views draw text, we could check for this case to avoid clearning cache */
BLF_cache_clear();
}