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:
authorCampbell Barton <ideasman42@gmail.com>2020-08-07 15:36:11 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-08-07 15:37:39 +0300
commitb134434224254d4ac3fc73d023f2f6d914746690 (patch)
treeb67d2c5aee982495d55848414c362665a37476b0 /source/blender/draw/engines/gpencil
parent3db67fd670535c0a709ec6e8204fcb730cd3eb0d (diff)
Cleanup: declare arrays arrays where possible
Diffstat (limited to 'source/blender/draw/engines/gpencil')
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_antialiasing.c2
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_cache_utils.c2
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_engine.c6
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_render.c2
4 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_antialiasing.c b/source/blender/draw/engines/gpencil/gpencil_antialiasing.c
index 8955240c549..b9600ad8caf 100644
--- a/source/blender/draw/engines/gpencil/gpencil_antialiasing.c
+++ b/source/blender/draw/engines/gpencil/gpencil_antialiasing.c
@@ -36,7 +36,7 @@ void GPENCIL_antialiasing_init(struct GPENCIL_Data *vedata)
const float *size = DRW_viewport_size_get();
const float *sizeinv = DRW_viewport_invert_size_get();
- float metrics[4] = {sizeinv[0], sizeinv[1], size[0], size[1]};
+ const float metrics[4] = {sizeinv[0], sizeinv[1], size[0], size[1]};
if (pd->simplify_antialias) {
/* No AA fallback. */
diff --git a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
index 41a7196cb90..363794e1be3 100644
--- a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
@@ -245,7 +245,7 @@ static void gpencil_layer_random_color_get(const Object *ob,
uint ob_hash = BLI_ghashutil_strhash_p_murmur(ob->id.name);
uint gpl_hash = BLI_ghashutil_strhash_p_murmur(gpl->info);
float hue = BLI_hash_int_01(ob_hash * gpl_hash);
- float hsv[3] = {hue, hsv_saturation, hsv_value};
+ const float hsv[3] = {hue, hsv_saturation, hsv_value};
hsv_to_rgb_v(hsv, r_color);
}
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index dbad226099e..746920e38c6 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -71,7 +71,7 @@ void GPENCIL_engine_init(void *ved)
}
if (txl->dummy_texture == NULL) {
- float pixels[1][4] = {{1.0f, 0.0f, 1.0f, 1.0f}};
+ const float pixels[1][4] = {{1.0f, 0.0f, 1.0f, 1.0f}};
txl->dummy_texture = DRW_texture_create_2d(1, 1, GPU_RGBA8, DRW_TEX_WRAP, (float *)pixels);
}
@@ -766,7 +766,7 @@ static void gpencil_draw_mask(GPENCIL_Data *vedata, GPENCIL_tObject *ob, GPENCIL
{
GPENCIL_PassList *psl = vedata->psl;
GPENCIL_FramebufferList *fbl = vedata->fbl;
- float clear_col[4] = {1.0f, 1.0f, 1.0f, 1.0f};
+ const float clear_col[4] = {1.0f, 1.0f, 1.0f, 1.0f};
float clear_depth = ob->is_drawmode3d ? 1.0f : 0.0f;
bool inverted = false;
/* OPTI(fclem) we could optimize by only clearing if the new mask_bits does not contain all
@@ -813,7 +813,7 @@ static void GPENCIL_draw_object(GPENCIL_Data *vedata, GPENCIL_tObject *ob)
GPENCIL_PassList *psl = vedata->psl;
GPENCIL_PrivateData *pd = vedata->stl->pd;
GPENCIL_FramebufferList *fbl = vedata->fbl;
- float clear_cols[2][4] = {{0.0f, 0.0f, 0.0f, 0.0f}, {1.0f, 1.0f, 1.0f, 1.0f}};
+ const float clear_cols[2][4] = {{0.0f, 0.0f, 0.0f, 0.0f}, {1.0f, 1.0f, 1.0f, 1.0f}};
DRW_stats_group_start("GPencil Object");
diff --git a/source/blender/draw/engines/gpencil/gpencil_render.c b/source/blender/draw/engines/gpencil/gpencil_render.c
index c3294f88acf..df52b65aa78 100644
--- a/source/blender/draw/engines/gpencil/gpencil_render.c
+++ b/source/blender/draw/engines/gpencil/gpencil_render.c
@@ -129,7 +129,7 @@ void GPENCIL_render_init(GPENCIL_Data *vedata,
/* To avoid unpredictable result, clear buffers that have not be initialized. */
GPU_framebuffer_bind(fbl->render_fb);
if (do_clear_col) {
- float clear_col[4] = {0.0f, 0.0f, 0.0f, 0.0f};
+ const float clear_col[4] = {0.0f, 0.0f, 0.0f, 0.0f};
GPU_framebuffer_clear_color(fbl->render_fb, clear_col);
}
if (do_clear_z) {