[Bf-blender-cvs] [194979e9294] master: Cleanup: Improve naming of immediate mode buffer draw functions
Julian Eisel
noreply at git.blender.org
Mon Jan 17 18:26:54 CET 2022
Commit: 194979e92947524c6257a38ae7bee4b20dc61d9e
Author: Julian Eisel
Date: Mon Jan 17 18:13:54 2022 +0100
Branches: master
https://developer.blender.org/rB194979e92947524c6257a38ae7bee4b20dc61d9e
Cleanup: Improve naming of immediate mode buffer draw functions
Followup to the previous commit. Jeroen and I agreed the old naming was
confusing.
===================================================================
M source/blender/editors/include/BIF_glutil.h
M source/blender/editors/interface/interface_draw.c
M source/blender/editors/mask/mask_draw.c
M source/blender/editors/render/render_preview.cc
M source/blender/editors/screen/glutil.c
M source/blender/editors/space_file/file_draw.c
M source/blender/editors/space_node/node_draw.cc
M source/blender/windowmanager/intern/wm_dragdrop.c
M source/blender/windowmanager/intern/wm_gesture.c
===================================================================
diff --git a/source/blender/editors/include/BIF_glutil.h b/source/blender/editors/include/BIF_glutil.h
index 8546c3eae89..e8d5bc4c868 100644
--- a/source/blender/editors/include/BIF_glutil.h
+++ b/source/blender/editors/include/BIF_glutil.h
@@ -55,7 +55,7 @@ typedef struct IMMDrawPixelsTexState {
IMMDrawPixelsTexState immDrawPixelsTexSetup(int builtin);
/**
- * Unlike the other `immDrawPixelsTex` functions, this doesn't do tiled drawing, but draws into a
+ * Unlike the `immDrawPixelsTexTiled` functions, this doesn't do tiled drawing, but draws into a
* full texture.
*
* Use the currently bound shader.
@@ -98,45 +98,45 @@ void immDrawPixelsTexScaledFullSize(const IMMDrawPixelsTexState *state,
* model-view and projection matrices are assumed to define a
* 1-to-1 mapping to screen space.
*/
-void immDrawPixelsTex(IMMDrawPixelsTexState *state,
- float x,
- float y,
- int img_w,
- int img_h,
- eGPUTextureFormat gpu_format,
- bool use_filter,
- void *rect,
- float xzoom,
- float yzoom,
- const float color[4]);
-void immDrawPixelsTex_clipping(IMMDrawPixelsTexState *state,
- float x,
- float y,
- int img_w,
- int img_h,
- eGPUTextureFormat gpu_format,
- bool use_filter,
- void *rect,
- float clip_min_x,
- float clip_min_y,
- float clip_max_x,
- float clip_max_y,
- float xzoom,
- float yzoom,
- const float color[4]);
-void immDrawPixelsTexScaled(IMMDrawPixelsTexState *state,
- float x,
- float y,
- int img_w,
- int img_h,
- eGPUTextureFormat gpu_format,
- bool use_filter,
- void *rect,
- float scaleX,
- float scaleY,
- float xzoom,
- float yzoom,
- const float color[4]);
+void immDrawPixelsTexTiled(IMMDrawPixelsTexState *state,
+ float x,
+ float y,
+ int img_w,
+ int img_h,
+ eGPUTextureFormat gpu_format,
+ bool use_filter,
+ void *rect,
+ float xzoom,
+ float yzoom,
+ const float color[4]);
+void immDrawPixelsTexTiled_clipping(IMMDrawPixelsTexState *state,
+ float x,
+ float y,
+ int img_w,
+ int img_h,
+ eGPUTextureFormat gpu_format,
+ bool use_filter,
+ void *rect,
+ float clip_min_x,
+ float clip_min_y,
+ float clip_max_x,
+ float clip_max_y,
+ float xzoom,
+ float yzoom,
+ const float color[4]);
+void immDrawPixelsTexTiled_scaling(IMMDrawPixelsTexState *state,
+ float x,
+ float y,
+ int img_w,
+ int img_h,
+ eGPUTextureFormat gpu_format,
+ bool use_filter,
+ void *rect,
+ float scaleX,
+ float scaleY,
+ float xzoom,
+ float yzoom,
+ const float color[4]);
/**
* Use the currently bound shader.
*
@@ -151,23 +151,23 @@ void immDrawPixelsTexScaled(IMMDrawPixelsTexState *state,
* Be also aware that this function unbinds the shader when
* it's finished.
*/
-void immDrawPixelsTexScaled_clipping(IMMDrawPixelsTexState *state,
- float x,
- float y,
- int img_w,
- int img_h,
- eGPUTextureFormat gpu_format,
- bool use_filter,
- void *rect,
- float scaleX,
- float scaleY,
- float clip_min_x,
- float clip_min_y,
- float clip_max_x,
- float clip_max_y,
- float xzoom,
- float yzoom,
- const float color[4]);
+void immDrawPixelsTexTiled_scaling_clipping(IMMDrawPixelsTexState *state,
+ float x,
+ float y,
+ int img_w,
+ int img_h,
+ eGPUTextureFormat gpu_format,
+ bool use_filter,
+ void *rect,
+ float scaleX,
+ float scaleY,
+ float clip_min_x,
+ float clip_min_y,
+ float clip_max_x,
+ float clip_max_y,
+ float xzoom,
+ float yzoom,
+ const float color[4]);
/* Image buffer drawing functions, with display transform
*
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index f2fa375aa09..f7492e56b62 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -325,17 +325,17 @@ void ui_draw_but_IMAGE(ARegion *UNUSED(region),
}
IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_COLOR);
- immDrawPixelsTex(&state,
- (float)rect->xmin,
- (float)rect->ymin,
- ibuf->x,
- ibuf->y,
- GPU_RGBA8,
- false,
- ibuf->rect,
- 1.0f,
- 1.0f,
- col);
+ immDrawPixelsTexTiled(&state,
+ (float)rect->xmin,
+ (float)rect->ymin,
+ ibuf->x,
+ ibuf->y,
+ GPU_RGBA8,
+ false,
+ ibuf->rect,
+ 1.0f,
+ 1.0f,
+ col);
GPU_blend(GPU_BLEND_NONE);
@@ -2135,17 +2135,17 @@ void ui_draw_but_TRACKPREVIEW(ARegion *UNUSED(region),
}
IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_COLOR);
- immDrawPixelsTex(&state,
- rect.xmin,
- rect.ymin + 1,
- drawibuf->x,
- drawibuf->y,
- GPU_RGBA8,
- true,
- drawibuf->rect,
- 1.0f,
- 1.0f,
- NULL);
+ immDrawPixelsTexTiled(&state,
+ rect.xmin,
+ rect.ymin + 1,
+ drawibuf->x,
+ drawibuf->y,
+ GPU_RGBA8,
+ true,
+ drawibuf->rect,
+ 1.0f,
+ 1.0f,
+ NULL);
/* draw cross for pixel position */
GPU_matrix_translate_2f(rect.xmin + scopes->track_pos[0], rect.ymin + scopes->track_pos[1]);
diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c
index dcd5b90bc04..0e207df7f94 100644
--- a/source/blender/editors/mask/mask_draw.c
+++ b/source/blender/editors/mask/mask_draw.c
@@ -768,7 +768,8 @@ void ED_mask_draw_region(
IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR);
GPU_shader_uniform_vector(
state.shader, GPU_shader_get_uniform(state.shader, "shuffle"), 4, 1, red);
- immDrawPixelsTex(&state, 0.0f, 0.0f, width, height, GPU_R16F, false, buffer, 1.0f, 1.0f, NULL);
+ immDrawPixelsTexTiled(
+ &state, 0.0f, 0.0f, width, height, GPU_R16F, false, buffer, 1.0f, 1.0f, NULL);
GPU_matrix_pop();
diff --git a/source/blender/editors/render/render_preview.cc b/source/blender/editors/render/render_preview.cc
index 4f94927533b..79c3b2f7ac6 100644
--- a/source/blender/editors/render/render_preview.cc
+++ b/source/blender/editors/render/render_preview.cc
@@ -687,17 +687,17 @@ static bool ed_preview_draw_rect(ScrArea *area, int split, int first, rcti *rect
RE_AcquiredResultGet32(re, &rres, (uint *)rect_byte, 0);
IMMDra
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list