From 89c79c3ed8d4f8cdf4f78782443bcf218425b412 Mon Sep 17 00:00:00 2001 From: Germano Cavalcante Date: Wed, 17 Feb 2021 12:38:21 -0300 Subject: Cleanup: Abbreviate enums with 'UNSIGNED_' in the name --- source/blender/editors/gpencil/gpencil_fill.c | 2 +- source/blender/editors/interface/interface_icons.c | 8 ++++---- source/blender/editors/render/render_opengl.c | 2 +- source/blender/editors/screen/glutil.c | 2 +- source/blender/editors/screen/screen_draw.c | 2 +- source/blender/editors/sculpt_paint/paint_cursor.c | 8 ++++---- source/blender/editors/space_clip/clip_draw.c | 2 +- source/blender/editors/space_sequencer/sequencer_draw.c | 6 +++--- source/blender/editors/space_view3d/view3d_draw.c | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c index e1a4f40745c..a81d319ab42 100644 --- a/source/blender/editors/gpencil/gpencil_fill.c +++ b/source/blender/editors/gpencil/gpencil_fill.c @@ -723,7 +723,7 @@ static bool gpencil_render_offscreen(tGPDfill *tgpf) GPU_offscreen_read_pixels(offscreen, GPU_DATA_FLOAT, ibuf->rect_float); } else if (ibuf->rect) { - GPU_offscreen_read_pixels(offscreen, GPU_DATA_UNSIGNED_BYTE, ibuf->rect); + GPU_offscreen_read_pixels(offscreen, GPU_DATA_UBYTE, ibuf->rect); } if (ibuf->rect_float && ibuf->rect) { IMB_rect_from_float(ibuf); diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 26f0f6ca98a..1739035f92c 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -889,15 +889,15 @@ void UI_icons_reload_internal_textures(void) icongltex.invh = 1.0f / b32buf->y; icongltex.tex[0] = GPU_texture_create_2d("icons", b32buf->x, b32buf->y, 2, GPU_RGBA8, NULL); - GPU_texture_update_mipmap(icongltex.tex[0], 0, GPU_DATA_UNSIGNED_BYTE, b32buf->rect); - GPU_texture_update_mipmap(icongltex.tex[0], 1, GPU_DATA_UNSIGNED_BYTE, b16buf->rect); + GPU_texture_update_mipmap(icongltex.tex[0], 0, GPU_DATA_UBYTE, b32buf->rect); + GPU_texture_update_mipmap(icongltex.tex[0], 1, GPU_DATA_UBYTE, b16buf->rect); } if (need_icons_with_border && icongltex.tex[1] == NULL) { icongltex.tex[1] = GPU_texture_create_2d( "icons_border", b32buf_border->x, b32buf_border->y, 2, GPU_RGBA8, NULL); - GPU_texture_update_mipmap(icongltex.tex[1], 0, GPU_DATA_UNSIGNED_BYTE, b32buf_border->rect); - GPU_texture_update_mipmap(icongltex.tex[1], 1, GPU_DATA_UNSIGNED_BYTE, b16buf_border->rect); + GPU_texture_update_mipmap(icongltex.tex[1], 0, GPU_DATA_UBYTE, b32buf_border->rect); + GPU_texture_update_mipmap(icongltex.tex[1], 1, GPU_DATA_UBYTE, b16buf_border->rect); } } diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index 6744461b2f2..48f937fb4ec 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -351,7 +351,7 @@ static void screen_opengl_render_doit(const bContext *C, OGLRender *oglrender, R G.f &= ~G_FLAG_RENDER_VIEWPORT; gp_rect = MEM_mallocN(sizeof(uchar[4]) * sizex * sizey, "offscreen rect"); - GPU_offscreen_read_pixels(oglrender->ofs, GPU_DATA_UNSIGNED_BYTE, gp_rect); + GPU_offscreen_read_pixels(oglrender->ofs, GPU_DATA_UBYTE, gp_rect); for (i = 0; i < sizex * sizey * 4; i += 4) { blend_color_mix_byte(&render_rect[i], &render_rect[i], &gp_rect[i]); diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index a88afecd064..e366760a55d 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -131,7 +131,7 @@ void immDrawPixelsTexScaled_clipping(IMMDrawPixelsTexState *state, } const bool use_float_data = ELEM(gpu_format, GPU_RGBA16F, GPU_RGB16F, GPU_R16F); - eGPUDataFormat gpu_data = (use_float_data) ? GPU_DATA_FLOAT : GPU_DATA_UNSIGNED_BYTE; + eGPUDataFormat gpu_data = (use_float_data) ? GPU_DATA_FLOAT : GPU_DATA_UBYTE; size_t stride = components * ((use_float_data) ? sizeof(float) : sizeof(uchar)); GPUTexture *tex = GPU_texture_create_2d("immDrawPixels", tex_w, tex_h, 1, gpu_format, NULL); diff --git a/source/blender/editors/screen/screen_draw.c b/source/blender/editors/screen/screen_draw.c index 1ea64c542f5..2ba7ef8f972 100644 --- a/source/blender/editors/screen/screen_draw.c +++ b/source/blender/editors/screen/screen_draw.c @@ -610,7 +610,7 @@ void ED_screen_preview_render(const bScreen *screen, int size_x, int size_y, uin screen_preview_draw(screen, size_x, size_y); - GPU_offscreen_read_pixels(offscreen, GPU_DATA_UNSIGNED_BYTE, r_rect); + GPU_offscreen_read_pixels(offscreen, GPU_DATA_UBYTE, r_rect); GPU_offscreen_unbind(offscreen, true); GPU_offscreen_free(offscreen); diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index 7eb08cbabac..e9f33d2fbd3 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -350,7 +350,7 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima eGPUTextureFormat format = col ? GPU_RGBA8 : GPU_R8; target->overlay_texture = GPU_texture_create_2d( "paint_cursor_overlay", size, size, 1, format, NULL); - GPU_texture_update(target->overlay_texture, GPU_DATA_UNSIGNED_BYTE, buffer); + GPU_texture_update(target->overlay_texture, GPU_DATA_UBYTE, buffer); if (!col) { GPU_texture_swizzle_set(target->overlay_texture, "rrrr"); @@ -358,7 +358,7 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima } if (init) { - GPU_texture_update(target->overlay_texture, GPU_DATA_UNSIGNED_BYTE, buffer); + GPU_texture_update(target->overlay_texture, GPU_DATA_UBYTE, buffer); } if (buffer) { @@ -469,13 +469,13 @@ static int load_tex_cursor(Brush *br, ViewContext *vc, float zoom) if (!cursor_snap.overlay_texture) { cursor_snap.overlay_texture = GPU_texture_create_2d( "cursor_snap_overaly", size, size, 1, GPU_R8, NULL); - GPU_texture_update(cursor_snap.overlay_texture, GPU_DATA_UNSIGNED_BYTE, buffer); + GPU_texture_update(cursor_snap.overlay_texture, GPU_DATA_UBYTE, buffer); GPU_texture_swizzle_set(cursor_snap.overlay_texture, "rrrr"); } if (init) { - GPU_texture_update(cursor_snap.overlay_texture, GPU_DATA_UNSIGNED_BYTE, buffer); + GPU_texture_update(cursor_snap.overlay_texture, GPU_DATA_UBYTE, buffer); } if (buffer) { diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index 93c30c9a4ba..cbe8ec4ba00 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -1207,7 +1207,7 @@ static void draw_plane_marker_image(Scene *scene, GPUTexture *texture = GPU_texture_create_2d( "plane_marker_image", ibuf->x, ibuf->y, 1, GPU_RGBA8, NULL); - GPU_texture_update(texture, GPU_DATA_UNSIGNED_BYTE, display_buffer); + GPU_texture_update(texture, GPU_DATA_UBYTE, display_buffer); GPU_texture_filter_mode(texture, false); GPU_matrix_push(); diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 201df1ceed6..b9fb577eb43 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -1533,7 +1533,7 @@ static void *sequencer_OCIO_transform_ibuf(const bContext *C, /* Default */ *r_format = GPU_RGBA8; - *r_data = GPU_DATA_UNSIGNED_BYTE; + *r_data = GPU_DATA_UBYTE; /* Fallback to CPU based color space conversion. */ if (force_fallback) { @@ -1580,7 +1580,7 @@ static void *sequencer_OCIO_transform_ibuf(const bContext *C, if ((ibuf->rect || ibuf->rect_float) && !*r_glsl_used) { display_buffer = IMB_display_buffer_acquire_ctx(C, ibuf, &cache_handle); *r_format = GPU_RGBA8; - *r_data = GPU_DATA_UNSIGNED_BYTE; + *r_data = GPU_DATA_UBYTE; } if (cache_handle) { IMB_display_buffer_release(cache_handle); @@ -1682,7 +1682,7 @@ static void sequencer_draw_display_buffer(const bContext *C, display_buffer = (uchar *)ibuf->rect; format = GPU_RGBA8; - data = GPU_DATA_UNSIGNED_BYTE; + data = GPU_DATA_UBYTE; } else { display_buffer = sequencer_OCIO_transform_ibuf(C, ibuf, &glsl_used, &format, &data); diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 12fb96c0737..a46d093c039 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2002,7 +2002,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Depsgraph *depsgraph, GPU_offscreen_read_pixels(ofs, GPU_DATA_FLOAT, ibuf->rect_float); } else if (ibuf->rect) { - GPU_offscreen_read_pixels(ofs, GPU_DATA_UNSIGNED_BYTE, ibuf->rect); + GPU_offscreen_read_pixels(ofs, GPU_DATA_UBYTE, ibuf->rect); } /* unbind */ -- cgit v1.2.3