[Bf-blender-cvs] [73fa066e8b3] master: Cleanup: Remove BIF_gl.h

Jeroen Bakker noreply at git.blender.org
Wed Nov 27 16:10:43 CET 2019


Commit: 73fa066e8b3ca4e3ff4a34a328a12b575dfc5823
Author: Jeroen Bakker
Date:   Fri Sep 20 12:44:29 2019 +0200
Branches: master
https://developer.blender.org/rB73fa066e8b3ca4e3ff4a34a328a12b575dfc5823

Cleanup: Remove BIF_gl.h

BIF_gl.h included hacks like redefining glew functions and a constant.
The named constant `GLA_PIXEL_OFS` has been moved to `GPU_viewport.h`

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5860

===================================================================

M	source/blender/draw/engines/workbench/workbench_forward.c
M	source/blender/draw/engines/workbench/workbench_materials.c
M	source/blender/draw/modes/paint_texture_mode.c
D	source/blender/editors/include/BIF_gl.h
M	source/blender/editors/interface/interface_eyedropper_color.c
M	source/blender/editors/mesh/editface.c
M	source/blender/editors/render/render_preview.c
M	source/blender/editors/util/CMakeLists.txt
M	source/blender/gpu/GPU_viewport.h
M	source/blender/gpu/intern/gpu_viewport.c
M	source/blender/makesrna/intern/rna_image_api.c
M	source/blender/windowmanager/intern/wm_dragdrop.c
M	source/blender/windowmanager/intern/wm_draw.c
M	source/blender/windowmanager/intern/wm_stereo.c
M	source/blender/windowmanager/intern/wm_subwindow.c

===================================================================

diff --git a/source/blender/draw/engines/workbench/workbench_forward.c b/source/blender/draw/engines/workbench/workbench_forward.c
index 7a027bf9c86..80b274e9b76 100644
--- a/source/blender/draw/engines/workbench/workbench_forward.c
+++ b/source/blender/draw/engines/workbench/workbench_forward.c
@@ -22,8 +22,6 @@
 
 #include "workbench_private.h"
 
-#include "BIF_gl.h"
-
 #include "BLI_alloca.h"
 #include "BLI_dynstr.h"
 #include "BLI_string_utils.h"
diff --git a/source/blender/draw/engines/workbench/workbench_materials.c b/source/blender/draw/engines/workbench/workbench_materials.c
index 0f9551a8cc9..45d49448490 100644
--- a/source/blender/draw/engines/workbench/workbench_materials.c
+++ b/source/blender/draw/engines/workbench/workbench_materials.c
@@ -22,8 +22,6 @@
 
 #include "workbench_private.h"
 
-#include "BIF_gl.h"
-
 #include "BKE_image.h"
 #include "BKE_node.h"
 
diff --git a/source/blender/draw/modes/paint_texture_mode.c b/source/blender/draw/modes/paint_texture_mode.c
index 7c164a74f2f..969dc54ab7d 100644
--- a/source/blender/draw/modes/paint_texture_mode.c
+++ b/source/blender/draw/modes/paint_texture_mode.c
@@ -23,8 +23,6 @@
 #include "DRW_engine.h"
 #include "DRW_render.h"
 
-#include "BIF_gl.h"
-
 #include "BKE_node.h"
 
 #include "BLI_string_utils.h"
diff --git a/source/blender/editors/include/BIF_gl.h b/source/blender/editors/include/BIF_gl.h
deleted file mode 100644
index 84820c3c564..00000000000
--- a/source/blender/editors/include/BIF_gl.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- * os dependent include locations of gl.h
- */
-
-/** \file
- * \ingroup editorui
- */
-
-#ifndef __BIF_GL_H__
-#define __BIF_GL_H__
-
-#include "GPU_glew.h"
-#include "BLI_utildefines.h"
-
-/* hacking pointsize and linewidth */
-#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
-#  define glPointSize(f) \
-    glPointSize(U.pixelsize *_Generic((f), double : (float)(f), default : (f)))
-#  define glLineWidth(f) \
-    glLineWidth(U.pixelsize *_Generic((f), double : (float)(f), default : (f)))
-#else
-#  define glPointSize(f) glPointSize(U.pixelsize *(f))
-#  define glLineWidth(f) glLineWidth(U.pixelsize *(f))
-#endif /* C11 */
-
-#define GLA_PIXEL_OFS 0.375f
-
-#endif /* #ifdef __BIF_GL_H__ */
diff --git a/source/blender/editors/interface/interface_eyedropper_color.c b/source/blender/editors/interface/interface_eyedropper_color.c
index 0cf357c508b..2b5cf2ed6b9 100644
--- a/source/blender/editors/interface/interface_eyedropper_color.c
+++ b/source/blender/editors/interface/interface_eyedropper_color.c
@@ -39,7 +39,7 @@
 
 #include "RNA_access.h"
 
-#include "BIF_gl.h"
+#include "GPU_glew.h"
 
 #include "UI_interface.h"
 
diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c
index b7f506a8a41..5c9fb866df7 100644
--- a/source/blender/editors/mesh/editface.c
+++ b/source/blender/editors/mesh/editface.c
@@ -36,8 +36,6 @@
 #include "BKE_global.h"
 #include "BKE_mesh.h"
 
-#include "BIF_gl.h"
-
 #include "ED_mesh.h"
 #include "ED_screen.h"
 #include "ED_select_utils.h"
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c
index 6dc3a1ec1ac..1fe299e58a9 100644
--- a/source/blender/editors/render/render_preview.c
+++ b/source/blender/editors/render/render_preview.c
@@ -80,10 +80,10 @@
 #include "IMB_imbuf_types.h"
 #include "IMB_thumbs.h"
 
-#include "BIF_gl.h"
 #include "BIF_glutil.h"
 
 #include "GPU_shader.h"
+#include "GPU_glew.h"
 
 #include "RE_pipeline.h"
 #include "RE_engine.h"
diff --git a/source/blender/editors/util/CMakeLists.txt b/source/blender/editors/util/CMakeLists.txt
index 0c52dd15092..987327eefc1 100644
--- a/source/blender/editors/util/CMakeLists.txt
+++ b/source/blender/editors/util/CMakeLists.txt
@@ -44,7 +44,6 @@ set(SRC
   select_utils.c
 
   # general includes
-  ../include/BIF_gl.h
   ../include/BIF_glutil.h
   ../include/ED_anim_api.h
   ../include/ED_armature.h
diff --git a/source/blender/gpu/GPU_viewport.h b/source/blender/gpu/GPU_viewport.h
index 4bbcb6a4335..e692262358b 100644
--- a/source/blender/gpu/GPU_viewport.h
+++ b/source/blender/gpu/GPU_viewport.h
@@ -32,6 +32,7 @@
 #include "GPU_texture.h"
 
 #define GPU_INFO_SIZE 512 /* IMA_MAX_RENDER_TEXT */
+#define GLA_PIXEL_OFS 0.375f
 
 typedef struct GPUViewport GPUViewport;
 
diff --git a/source/blender/gpu/intern/gpu_viewport.c b/source/blender/gpu/intern/gpu_viewport.c
index 615af57c1bd..519cd918b53 100644
--- a/source/blender/gpu/intern/gpu_viewport.c
+++ b/source/blender/gpu/intern/gpu_viewport.c
@@ -29,8 +29,6 @@
 #include "BLI_rect.h"
 #include "BLI_memblock.h"
 
-#include "BIF_gl.h"
-
 #include "DNA_vec_types.h"
 #include "DNA_userdef_types.h"
 
diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c
index d167c650683..997a5f5ca45 100644
--- a/source/blender/makesrna/intern/rna_image_api.c
+++ b/source/blender/makesrna/intern/rna_image_api.c
@@ -31,8 +31,6 @@
 #include "BLI_utildefines.h"
 #include "BLI_path_util.h"
 
-#include "BIF_gl.h"
-
 #include "RNA_define.h"
 #include "RNA_enum_types.h"
 
@@ -52,6 +50,8 @@
 #  include "DNA_image_types.h"
 #  include "DNA_scene_types.h"
 
+#  include "GPU_glew.h"
+
 #  include "MEM_guardedalloc.h"
 
 static void rna_ImagePackedFile_save(ImagePackedFile *imapf, Main *bmain, ReportList *reports)
diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c
index 901594850dd..e2462bb59b1 100644
--- a/source/blender/windowmanager/intern/wm_dragdrop.c
+++ b/source/blender/windowmanager/intern/wm_dragdrop.c
@@ -34,14 +34,15 @@
 
 #include "BLI_blenlib.h"
 
-#include "BIF_gl.h"
 #include "BIF_glutil.h"
 
 #include "BKE_context.h"
 #include "BKE_idcode.h"
 
+#include "GPU_glew.h"
 #include "GPU_shader.h"
 #include "GPU_state.h"
+#include "GPU_viewport.h"
 
 #include "IMB_imbuf_types.h"
 
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c
index 2f538a19ba2..09b7d89fc2b 100644
--- a/source/blender/windowmanager/intern/wm_draw.c
+++ b/source/blender/windowmanager/intern/wm_draw.c
@@ -39,8 +39,6 @@
 #include "BLI_blenlib.h"
 #include "BLI_utildefines.h"
 
-#include "BIF_gl.h"
-
 #include "BKE_context.h"
 #include "BKE_image.h"
 #include "BKE_main.h"
diff --git a/source/blender/windowmanager/intern/wm_stereo.c b/source/blender/windowmanager/intern/wm_stereo.c
index 9b62e532132..54953c097eb 100644
--- a/source/blender/windowmanager/intern/wm_stereo.c
+++ b/source/blender/windowmanager/intern/wm_stereo.c
@@ -32,8 +32,6 @@
 
 #include "BLI_utildefines.h"
 
-#include "BIF_gl.h"
-
 #include "BKE_context.h"
 #include "BKE_global.h"
 #include "BKE_report.h"
@@ -44,6 +42,7 @@
 
 #include "GPU_immediate.h"
 #include "GPU_texture.h"
+#include "GPU_viewport.h"
 
 #include "WM_api.h"
 #include "WM_types.h"
diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c
index 2f40947b395..6a5de84ac31 100644
--- a/source/blender/windowmanager/intern/wm_subwindow.c
+++ b/source/blender/windowmanager/intern/wm_subwindow.c
@@ -29,9 +29,9 @@
 #include "DNA_screen_types.h"
 #include "DNA_windowmanager_types.h"
 
-#include "BIF_gl.h"
-
+#include "GPU_glew.h"
 #include "GPU_matrix.h"
+#include "GPU_viewport.h"
 
 #include "WM_api.h"



More information about the Bf-blender-cvs mailing list