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:
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c14
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_draw_utils.c8
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_engine.c6
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_render.c30
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_shader_fx.c21
5 files changed, 40 insertions, 39 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index edb8f4433c9..8e6f2791e72 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -358,9 +358,9 @@ GPUBatch *DRW_gpencil_get_buffer_fill_geom(bGPdata *gpd)
float (*points2d)[2] = MEM_mallocN(sizeof(*points2d) * totpoints, __func__);
/* Convert points to array and triangulate
- * Here a cache is not used because while drawing the information changes all the time, so the cache
- * would be recalculated constantly, so it is better to do direct calculation for each function call
- */
+ * Here a cache is not used because while drawing the information changes all the time, so the cache
+ * would be recalculated constantly, so it is better to do direct calculation for each function call
+ */
for (int i = 0; i < totpoints; i++) {
const tGPspoint *pt = &points[i];
points2d[i][0] = pt->x;
@@ -460,10 +460,10 @@ GPUBatch *DRW_gpencil_get_edit_geom(bGPDstroke *gps, float alpha, short dflag)
}
/* Get size of verts:
- * - The selected state needs to be larger than the unselected state so that
- * they stand out more.
- * - We use the theme setting for size of the unselected verts
- */
+ * - The selected state needs to be larger than the unselected state so that
+ * they stand out more.
+ * - We use the theme setting for size of the unselected verts
+ */
float bsize = UI_GetThemeValuef(TH_GP_VERTEX_SIZE);
float vsize;
if ((int)bsize > 8) {
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index f1d3ad37e67..3963f9d45b9 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -928,8 +928,8 @@ void DRW_gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data, void *vedata, T
if (ED_gpencil_session_active() && (gpd->runtime.sbuffer_size > 0)) {
if ((gpd->runtime.sbuffer_sflag & GP_STROKE_ERASER) == 0) {
/* It should also be noted that sbuffer contains temporary point types
- * i.e. tGPspoints NOT bGPDspoints
- */
+ * i.e. tGPspoints NOT bGPDspoints
+ */
short lthick = brush->size * obscale;
/* if only one point, don't need to draw buffer because the user has no time to see it */
if (gpd->runtime.sbuffer_size > 1) {
@@ -1294,8 +1294,8 @@ void DRW_gpencil_populate_datablock(
if (!ID_IS_LINKED(&gpd->id)) {
ID *orig_id = gpd->id.orig_id;
/* GPXX: Now only a datablock with one use is allowed to be compatible
- * with instances
- */
+ * with instances
+ */
if ((!cache_ob->is_dup_onion) && (gpd->flag & GP_DATA_SHOW_ONIONSKINS) &&
(do_onion) && (gpl->onion_flag & GP_LAYER_ONIONSKIN) &&
((!playing) || (gpd->onion_flag & GP_ONION_GHOST_ALWAYS)) &&
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index 2e237ac7fe8..5dd1cb50405 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -353,9 +353,9 @@ void GPENCIL_cache_init(void *vedata)
if (obact_gpd) {
/* for some reason, when press play there is a delay in the animation flag check
- * and this produces errors. To be sure, we set cache as dirty because the frame
- * is changing.
- */
+ * and this produces errors. To be sure, we set cache as dirty because the frame
+ * is changing.
+ */
if (stl->storage->is_playing == true) {
obact_gpd->flag |= GP_DATA_CACHE_IS_DIRTY;
}
diff --git a/source/blender/draw/engines/gpencil/gpencil_render.c b/source/blender/draw/engines/gpencil/gpencil_render.c
index 3aa94c346df..41f0c601a13 100644
--- a/source/blender/draw/engines/gpencil/gpencil_render.c
+++ b/source/blender/draw/engines/gpencil/gpencil_render.c
@@ -40,9 +40,9 @@
#include "gpencil_engine.h"
/* Get pixel size for render
-* This function uses the same calculation used for viewport, because if use
-* camera pixelsize, the result is not correct.
-*/
+ * This function uses the same calculation used for viewport, because if use
+ * camera pixelsize, the result is not correct.
+ */
static float get_render_pixelsize(float persmat[4][4], int winx, int winy)
{
float v1[3], v2[3];
@@ -74,9 +74,9 @@ void GPENCIL_render_init(GPENCIL_Data *ved, RenderEngine *engine, struct Depsgra
const int size[2] = { (int)viewport_size[0], (int)viewport_size[1] };
/* In render mode the default framebuffer is not generated
- * because there is no viewport. So we need to manually create one
- * NOTE : use 32 bit format for precision in render mode.
- */
+ * because there is no viewport. So we need to manually create one
+ * NOTE : use 32 bit format for precision in render mode.
+ */
/* create multiframe framebuffer for AA */
if (U.gpencil_multisamples > 0) {
int rect_w = (int)viewport_size[0];
@@ -156,7 +156,7 @@ static void GPENCIL_render_update_viewvecs(float invproj[4][4], float winmat[4][
for (int i = 0; i < 4; i++) {
mul_project_m4_v3(invproj, view_vecs[i]);
/* normalized trick see:
- * http://www.derschmale.com/2014/01/26/reconstructing-positions-from-the-depth-buffer */
+ * http://www.derschmale.com/2014/01/26/reconstructing-positions-from-the-depth-buffer */
if (is_persp) {
/* Divide XY by Z. */
mul_v2_fl(view_vecs[i], 1.0f / view_vecs[i][2]);
@@ -164,14 +164,14 @@ static void GPENCIL_render_update_viewvecs(float invproj[4][4], float winmat[4][
}
/**
- * If ortho : view_vecs[0] is the near-bottom-left corner of the frustum and
- * view_vecs[1] is the vector going from the near-bottom-left corner to
- * the far-top-right corner.
- * If Persp : view_vecs[0].xy and view_vecs[1].xy are respectively the bottom-left corner
- * when Z = 1, and top-left corner if Z = 1.
- * view_vecs[0].z the near clip distance and view_vecs[1].z is the (signed)
- * distance from the near plane to the far clip plane.
- **/
+ * If ortho : view_vecs[0] is the near-bottom-left corner of the frustum and
+ * view_vecs[1] is the vector going from the near-bottom-left corner to
+ * the far-top-right corner.
+ * If Persp : view_vecs[0].xy and view_vecs[1].xy are respectively the bottom-left corner
+ * when Z = 1, and top-left corner if Z = 1.
+ * view_vecs[0].z the near clip distance and view_vecs[1].z is the (signed)
+ * distance from the near plane to the far clip plane.
+ */
copy_v4_v4(r_viewvecs[0], view_vecs[0]);
/* we need to store the differences */
diff --git a/source/blender/draw/engines/gpencil/gpencil_shader_fx.c b/source/blender/draw/engines/gpencil/gpencil_shader_fx.c
index c3bf241baf5..7d6a8691b87 100644
--- a/source/blender/draw/engines/gpencil/gpencil_shader_fx.c
+++ b/source/blender/draw/engines/gpencil/gpencil_shader_fx.c
@@ -76,11 +76,12 @@ static bool effect_is_active(bGPdata *gpd, ShaderFxData *fx, bool is_render)
return false;
}
-/* get normal of draw using one stroke of visible layer
-* /param gpd GP datablock
-* /param r_point Point on plane
-* /param r_normal Normal vector
-*/
+/**
+ * Get normal of draw using one stroke of visible layer
+ * \param gpd GP datablock
+ * \param r_point Point on plane
+ * \param r_normal Normal vector
+ */
static bool get_normal_vector(bGPdata *gpd, float r_point[3], float r_normal[3])
{
for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
@@ -123,9 +124,9 @@ static void GPENCIL_dof_nearfar(Object *camera, float coc, float nearfar[2])
float focal_len = cam->lens;
/* this is factor that converts to the scene scale. focal length and sensor are expressed in mm
- * unit.scale_length is how many meters per blender unit we have. We want to convert to blender units though
- * because the shader reads coordinates in world space, which is in blender units.
- * Note however that focus_distance is already in blender units and shall not be scaled here (see T48157). */
+ * unit.scale_length is how many meters per blender unit we have. We want to convert to blender units though
+ * because the shader reads coordinates in world space, which is in blender units.
+ * Note however that focus_distance is already in blender units and shall not be scaled here (see T48157). */
float scale = (scene->unit.system) ? scene->unit.scale_length : 1.0f;
float scale_camera = 0.001f / scale;
/* we want radius here for the aperture number */
@@ -308,8 +309,8 @@ static void DRW_gpencil_fx_light(
copy_v3_v3(fxd->loc, &fxd->object->loc[0]);
/* Calc distance to strokes plane
- * The w component of location is used to transfer the distance to drawing plane
- */
+ * The w component of location is used to transfer the distance to drawing plane
+ */
float r_point[3], r_normal[3];
float r_plane[4];
bGPdata *gpd = cache->gpd;