[Bf-blender-cvs] [114973584d4] master: Cleanup: better comments and naming for redraw flags

Brecht Van Lommel noreply at git.blender.org
Sun Jun 2 12:50:25 CEST 2019


Commit: 114973584d49daa2020345970b696878ebc49cf7
Author: Brecht Van Lommel
Date:   Sun Jun 2 02:09:12 2019 +0200
Branches: master
https://developer.blender.org/rB114973584d49daa2020345970b696878ebc49cf7

Cleanup: better comments and naming for redraw flags

===================================================================

M	source/blender/editors/interface/interface_region_popup.c
M	source/blender/makesdna/DNA_screen_types.h

===================================================================

diff --git a/source/blender/editors/interface/interface_region_popup.c b/source/blender/editors/interface/interface_region_popup.c
index bd87439ca9e..f3e18cc2f24 100644
--- a/source/blender/editors/interface/interface_region_popup.c
+++ b/source/blender/editors/interface/interface_region_popup.c
@@ -375,12 +375,12 @@ static void ui_block_region_refresh(const bContext *C, ARegion *ar)
   ARegion *ctx_region = CTX_wm_region(C);
   uiBlock *block;
 
-  if (ar->do_draw & RGN_DRAW_REFRESH_UI) {
+  if (ar->do_draw & RGN_REFRESH_UI) {
     ScrArea *handle_ctx_area;
     ARegion *handle_ctx_region;
     uiBlock *block_next;
 
-    ar->do_draw &= ~RGN_DRAW_REFRESH_UI;
+    ar->do_draw &= ~RGN_REFRESH_UI;
     for (block = ar->uiblocks.first; block; block = block_next) {
       block_next = block->next;
       uiPopupBlockHandle *handle = block->handle;
@@ -772,7 +772,7 @@ uiPopupBlockHandle *ui_popup_block_create(bContext *C,
   handle->ctx_area = CTX_wm_area(C);
   handle->ctx_region = CTX_wm_region(C);
 
-  /* store vars to refresh popup (RGN_DRAW_REFRESH_UI) */
+  /* store vars to refresh popup (RGN_REFRESH_UI) */
   handle->popup_create_vars.create_func = create_func;
   handle->popup_create_vars.handle_create_func = handle_create_func;
   handle->popup_create_vars.arg = arg;
diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h
index f5c2a518ef6..8ac73d3ae7a 100644
--- a/source/blender/makesdna/DNA_screen_types.h
+++ b/source/blender/makesdna/DNA_screen_types.h
@@ -640,10 +640,19 @@ enum {
 };
 
 /** #ARegion.do_draw */
-#define RGN_DRAW 1
-#define RGN_DRAW_PARTIAL 2
-#define RGN_DRAWING 4
-#define RGN_DRAW_REFRESH_UI 8 /* re-create uiBlock's where possible */
-#define RGN_DRAW_NO_REBUILD 16
+enum {
+  /* Region must be fully redrawn. */
+  RGN_DRAW = 1,
+  /* Redraw only part of region, for sculpting and painting to get smoother
+   * stroke painting on heavy meshes. */
+  RGN_DRAW_PARTIAL = 2,
+  /* For outliner, to do faster redraw without rebuilding outliner tree. */
+  RGN_DRAW_NO_REBUILD = 4,
+
+  /* Set while region is being drawn. */
+  RGN_DRAWING = 8,
+  /* For popups, to refresh UI layout along with drawing. */
+  RGN_REFRESH_UI = 16,
+};
 
 #endif /* __DNA_SCREEN_TYPES_H__ */



More information about the Bf-blender-cvs mailing list