[Bf-blender-cvs] [f44d3e83cc0] blender2.8: UI: Perf: Add BLF batching for File browser and UI blocks.
Clément Foucault
noreply at git.blender.org
Fri Mar 30 23:34:08 CEST 2018
Commit: f44d3e83cc0333415ba0038550f436cb93f36914
Author: Clément Foucault
Date: Fri Mar 30 21:09:24 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBf44d3e83cc0333415ba0038550f436cb93f36914
UI: Perf: Add BLF batching for File browser and UI blocks.
This batch together most of the calls that can be batch together.
===================================================================
M source/blender/editors/interface/interface.c
M source/blender/editors/space_file/file_draw.c
===================================================================
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index d6385276b1a..3fe0cdd5d4f 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -1426,6 +1426,8 @@ void UI_block_draw(const bContext *C, uiBlock *block)
else if (block->panel)
ui_draw_aligned_panel(&style, block, &rect, UI_panel_category_is_visible(ar));
+ BLF_batching_start();
+
/* widgets */
for (but = block->buttons.first; but; but = but->next) {
if (!(but->flag & (UI_HIDDEN | UI_SCROLLED))) {
@@ -1437,6 +1439,8 @@ void UI_block_draw(const bContext *C, uiBlock *block)
ui_draw_but(C, ar, &style, but, &rect);
}
}
+
+ BLF_batching_end();
/* restore matrix */
gpuPopProjectionMatrix();
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 4bf377ddc1a..35e1558ef94 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -52,6 +52,8 @@
#include "BLT_translation.h"
+#include "BLF_api.h"
+
#include "IMB_imbuf_types.h"
#include "DNA_userdef_types.h"
@@ -607,6 +609,8 @@ void file_draw_list(const bContext *C, ARegion *ar)
}
}
+ BLF_batching_start();
+
for (i = offset; (i < numfiles) && (i < offset + numfiles_layout); i++) {
unsigned int file_selflag;
char path[FILE_MAX_LIBEXTRA];
@@ -736,6 +740,8 @@ void file_draw_list(const bContext *C, ARegion *ar)
}
}
+ BLF_batching_end();
+
UI_block_end(C, block);
UI_block_draw(C, block);
More information about the Bf-blender-cvs
mailing list