Cleanup: remove redundant doxygen \file argument
[blender.git] / source / blender / draw / engines / gpencil / gpencil_engine.c
index dc62ca3..eff8d07 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * Copyright 2017, Blender Foundation.
- *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * Contributor(s): Antonio Vazquez
- *
+ * Copyright 2017, Blender Foundation.
  */
 
-/** \file blender/draw/engines/gpencil/gpencil_engine.c
- *  \ingroup draw
+/** \file \ingroup draw
  */
 #include "DRW_engine.h"
 #include "DRW_render.h"
 
-#include "BKE_camera.h"
 #include "BKE_object.h"
-#include "BKE_paint.h"
-#include "BKE_gpencil.h"
 #include "BKE_shader_fx.h"
 
 #include "DNA_gpencil_types.h"
@@ -36,7 +29,6 @@
 
 #include "draw_mode_engines.h"
 
-#include "UI_resources.h"
 
 #include "GPU_texture.h"
 
@@ -45,9 +37,7 @@
 #include "DEG_depsgraph_query.h"
 
 #include "ED_screen.h"
-#include "ED_gpencil.h"
 
-#include "WM_api.h"
 
 extern char datatoc_gpencil_fill_vert_glsl[];
 extern char datatoc_gpencil_fill_frag_glsl[];
@@ -108,7 +98,7 @@ static void GPENCIL_create_framebuffers(void *vedata)
        GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
 
        /* Go full 32bits for rendering */
-       GPUTextureFormat fb_format = DRW_state_is_image_render() ? GPU_RGBA32F : GPU_RGBA16F;
+       eGPUTextureFormat fb_format = DRW_state_is_image_render() ? GPU_RGBA32F : GPU_RGBA16F;
 
        if (DRW_state_is_fbo()) {
                const float *viewport_size = DRW_viewport_size_get();
@@ -125,10 +115,11 @@ static void GPENCIL_create_framebuffers(void *vedata)
                if (stl->storage->framebuffer_flag & GP_FRAMEBUFFER_BASIC) {
                        /* temp textures for ping-pong buffers */
                        e_data.temp_depth_tx_a = DRW_texture_pool_query_2D(
-                               size[0], size[1], GPU_DEPTH_COMPONENT24,
-                               &draw_engine_gpencil_type);
-                       e_data.temp_color_tx_a = DRW_texture_pool_query_2D(size[0], size[1], fb_format,
-                               &draw_engine_gpencil_type);
+                               size[0], size[1], GPU_DEPTH_COMPONENT24,
+                               &draw_engine_gpencil_type);
+                       e_data.temp_color_tx_a = DRW_texture_pool_query_2D(
+                               size[0], size[1], fb_format,
+                               &draw_engine_gpencil_type);
                        GPU_framebuffer_ensure_config(
                                &fbl->temp_fb_a, {
                                        GPU_ATTACHMENT_TEXTURE(e_data.temp_depth_tx_a),
@@ -136,11 +127,11 @@ static void GPENCIL_create_framebuffers(void *vedata)
                                });
 
                        e_data.temp_depth_tx_b = DRW_texture_pool_query_2D(
-                               size[0], size[1], GPU_DEPTH_COMPONENT24,
-                               &draw_engine_gpencil_type);
+                               size[0], size[1], GPU_DEPTH_COMPONENT24,
+                               &draw_engine_gpencil_type);
                        e_data.temp_color_tx_b = DRW_texture_pool_query_2D(
-                               size[0], size[1], fb_format,
-                               &draw_engine_gpencil_type);
+                               size[0], size[1], fb_format,
+                               &draw_engine_gpencil_type);
                        GPU_framebuffer_ensure_config(
                                &fbl->temp_fb_b, {
                                        GPU_ATTACHMENT_TEXTURE(e_data.temp_depth_tx_b),
@@ -149,11 +140,11 @@ static void GPENCIL_create_framebuffers(void *vedata)
 
                        /* used for FX effects and Layer blending */
                        e_data.temp_depth_tx_fx = DRW_texture_pool_query_2D(
-                               size[0], size[1], GPU_DEPTH_COMPONENT24,
-                               &draw_engine_gpencil_type);
+                               size[0], size[1], GPU_DEPTH_COMPONENT24,
+                               &draw_engine_gpencil_type);
                        e_data.temp_color_tx_fx = DRW_texture_pool_query_2D(
-                               size[0], size[1], fb_format,
-                               &draw_engine_gpencil_type);
+                               size[0], size[1], fb_format,
+                               &draw_engine_gpencil_type);
                        GPU_framebuffer_ensure_config(
                                &fbl->temp_fb_fx, {
                                        GPU_ATTACHMENT_TEXTURE(e_data.temp_depth_tx_fx),
@@ -164,11 +155,11 @@ static void GPENCIL_create_framebuffers(void *vedata)
                /* background framebuffer to speed up drawing process (always 16 bits) */
                if (stl->storage->framebuffer_flag & GP_FRAMEBUFFER_DRAW) {
                        e_data.background_depth_tx = DRW_texture_pool_query_2D(
-                               size[0], size[1], GPU_DEPTH_COMPONENT24,
-                               &draw_engine_gpencil_type);
+                               size[0], size[1], GPU_DEPTH_COMPONENT24,
+                               &draw_engine_gpencil_type);
                        e_data.background_color_tx = DRW_texture_pool_query_2D(
-                               size[0], size[1], GPU_RGBA32F,
-                               &draw_engine_gpencil_type);
+                               size[0], size[1], GPU_RGBA32F,
+                               &draw_engine_gpencil_type);
                        GPU_framebuffer_ensure_config(
                                &fbl->background_fb, {
                                        GPU_ATTACHMENT_TEXTURE(e_data.background_depth_tx),
@@ -558,7 +549,7 @@ static void gpencil_add_draw_data(void *vedata, Object *ob)
 void GPENCIL_cache_populate(void *vedata, Object *ob)
 {
        /* object must be visible */
-       if (!DRW_object_is_visible_in_active_context(ob)) {
+       if (!(DRW_object_visibility_in_active_context(ob) & OB_VISIBLE_SELF)) {
                return;
        }
 
@@ -624,9 +615,9 @@ void GPENCIL_cache_populate(void *vedata, Object *ob)
                        }
 
                        DRW_shgroup_call_add(
-                               stl->g_data->shgrps_grid,
-                               e_data.batch_grid,
-                               stl->storage->grid_matrix);
+                               stl->g_data->shgrps_grid,
+                               e_data.batch_grid,
+                               stl->storage->grid_matrix);
                }
        }
 }
@@ -829,9 +820,9 @@ void GPENCIL_draw_scene(void *ved)
                                                        GPU_framebuffer_bind(fbl->temp_fb_fx);
                                                        GPU_framebuffer_clear_color_depth(fbl->temp_fb_fx, clearcol, 1.0f);
                                                        gpencil_draw_pass_range(
-                                                               fbl, stl, psl, txl, fbl->temp_fb_fx,
-                                                               init_shgrp, end_shgrp,
-                                                               is_last);
+                                                               fbl, stl, psl, txl, fbl->temp_fb_fx,
+                                                               init_shgrp, end_shgrp,
+                                                               is_last);
 
                                                        /* Blend A texture and FX texture */
                                                        GPU_framebuffer_bind(fbl->temp_fb_b);
@@ -858,9 +849,9 @@ void GPENCIL_draw_scene(void *ved)
                                        }
                                        /* last group */
                                        gpencil_draw_pass_range(
-                                               fbl, stl, psl, txl, fbl->temp_fb_a,
-                                               init_shgrp, end_shgrp,
-                                               true);
+                                               fbl, stl, psl, txl, fbl->temp_fb_a,
+                                               init_shgrp, end_shgrp,
+                                               true);
                                }
 
                                /* Current buffer drawing */