[Bf-blender-cvs] [96f6a1f] experimental-build: Revert "GPU offscreen API + bpy.context.window.close()"

Dalai Felinto noreply at git.blender.org
Fri Oct 16 10:00:31 CEST 2015


Commit: 96f6a1fd28e00031164ce3d04fb5402cd4580881
Author: Dalai Felinto
Date:   Fri Oct 16 05:00:04 2015 -0300
Branches: experimental-build
https://developer.blender.org/rB96f6a1fd28e00031164ce3d04fb5402cd4580881

Revert "GPU offscreen API + bpy.context.window.close()"

This reverts commit 598a26ffb879a234177547a0fd09b27056a2038c.

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

M	source/blender/gpu/CMakeLists.txt
M	source/blender/gpu/GPU_extensions.h
M	source/blender/gpu/SConscript
M	source/blender/gpu/intern/gpu_extensions.c
M	source/blender/makesrna/intern/rna_wm_api.c
M	source/blender/python/intern/CMakeLists.txt
M	source/blender/python/intern/gpu.c
M	source/blender/python/intern/gpu.h
D	source/blender/python/intern/gpu_offscreen.c
M	source/blender/windowmanager/WM_api.h
M	source/blender/windowmanager/intern/wm_window.c
M	source/blenderplayer/bad_level_call_stubs/stubs.c

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

diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt
index 3cde0db..328623f 100644
--- a/source/blender/gpu/CMakeLists.txt
+++ b/source/blender/gpu/CMakeLists.txt
@@ -28,7 +28,6 @@ set(INC
 	../blenkernel
 	../blenlib
 	../bmesh
-	../editors/include
 	../imbuf
 	../makesdna
 	../makesrna
diff --git a/source/blender/gpu/GPU_extensions.h b/source/blender/gpu/GPU_extensions.h
index ded9669..2dadd38 100644
--- a/source/blender/gpu/GPU_extensions.h
+++ b/source/blender/gpu/GPU_extensions.h
@@ -36,7 +36,6 @@
 extern "C" {
 #endif
 
-struct bContext;
 struct Image;
 struct ImageUser;
 struct PreviewImage;
@@ -185,13 +184,10 @@ void GPU_framebuffer_blur(GPUFrameBuffer *fb, GPUTexture *tex, GPUFrameBuffer *b
 GPUOffScreen *GPU_offscreen_create(int width, int height, int samples, char err_out[256]);
 void GPU_offscreen_free(GPUOffScreen *ofs);
 void GPU_offscreen_bind(GPUOffScreen *ofs, bool save);
-void GPU_offscreen_draw_view3d(GPUOffScreen *ofs, struct bContext *C, float projection_matrix[4][4], float modelview_matrix[4][4]);
 void GPU_offscreen_unbind(GPUOffScreen *ofs, bool restore);
 void GPU_offscreen_read_pixels(GPUOffScreen *ofs, int type, void *pixels);
 int GPU_offscreen_width(const GPUOffScreen *ofs);
 int GPU_offscreen_height(const GPUOffScreen *ofs);
-int GPU_offscreen_fb_object(const GPUOffScreen *ofs);
-int GPU_offscreen_color_object(const GPUOffScreen *ofs);
 
 /* Builtin/Non-generated shaders */
 typedef enum GPUProgramType {
diff --git a/source/blender/gpu/SConscript b/source/blender/gpu/SConscript
index c529c57..d27d5b0 100644
--- a/source/blender/gpu/SConscript
+++ b/source/blender/gpu/SConscript
@@ -42,7 +42,6 @@ incs = [
     '../blenkernel',
     '../blenlib',
     '../bmesh',
-    '../editors/include',
     '../imbuf',
     '../include',
     '../makesdna',
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index 458505d..1335e00 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -42,7 +42,6 @@
 #include "BLI_math_base.h"
 #include "BLI_math_vector.h"
 
-#include "BKE_context.h"
 #include "BKE_global.h"
 
 #include "GPU_glew.h"
@@ -54,12 +53,6 @@
 
 #include "intern/gpu_private.h"
 
-#include "DNA_scene_types.h"
-#include "DNA_screen_types.h"
-#include "DNA_view3d_types.h"
-
-#include "ED_view3d.h"
-
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -1616,77 +1609,6 @@ int GPU_offscreen_height(const GPUOffScreen *ofs)
 	return ofs->color->h_orig;
 }
 
-int GPU_offscreen_fb_object(const GPUOffScreen *ofs)
-{
-	return ofs->fb->object;
-}
-
-int GPU_offscreen_color_object(const GPUOffScreen *ofs)
-{
-	return ofs->color->bindcode;
-}
-
-
-/* GPUOffScreen Draw*/
-
-static void gpu_offscreen_draw_setup(GPUOffScreen *ofs)
-{
-	GPU_offscreen_bind(ofs, true);
-}
-
-static void gpu_offscreen_draw_reset(GPUOffScreen *ofs)
-{
-	GPU_offscreen_unbind(ofs, true);
-}
-
-static void gpu_offscreen_draw_doit(
-        GPUOffScreen *ofs,
-        bContext *C,
-        float modelviewmat[4][4],
-		float projmat[4][4])
-{
-	View3D *v3d = CTX_wm_view3d(C);
-	Scene *scene = CTX_data_scene(C);
-	ARegion *ar = CTX_wm_region(C);
-
-	int width = GPU_offscreen_width(ofs);
-	int height = GPU_offscreen_height(ofs);
-	GPUFX *fx = GPU_fx_compositor_create();
-
-	/* full copy */
-	GPUFXSettings fx_settings = v3d->fx_settings;
-
-	ED_view3d_draw_offscreen_init(scene, v3d);
-
-	GPU_offscreen_bind(ofs, true); /* bind */
-
-	ED_view3d_draw_offscreen(
-	            scene,
-	            v3d,
-	            ar,
-	            width,
-	            height,
-	            projmat,
-	            modelviewmat,
-	            false,
-	            true,
-	            true,
-	            "",
-	            fx,
-	            &fx_settings,
-	            ofs);
-
-	GPU_fx_compositor_destroy(fx);
-	GPU_offscreen_unbind(ofs, true); /* unbind */
-}
-
-void GPU_offscreen_draw_view3d(GPUOffScreen *ofs, struct bContext *C, float projection_matrix[4][4], float modelview_matrix[4][4])
-{
-	gpu_offscreen_draw_setup(ofs);
-	gpu_offscreen_draw_doit(ofs, C, projection_matrix, modelview_matrix);
-	gpu_offscreen_draw_reset(ofs);
-}
-
 /* GPUShader */
 
 struct GPUShader {
diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c
index 8775bc3..e819d33 100644
--- a/source/blender/makesrna/intern/rna_wm_api.c
+++ b/source/blender/makesrna/intern/rna_wm_api.c
@@ -384,10 +384,6 @@ void RNA_api_window(StructRNA *srna)
 
 	RNA_def_function(srna, "cursor_modal_restore", "WM_cursor_modal_restore");
 	RNA_def_function_ui_description(func, "Restore the previous cursor after calling ``cursor_modal_set``");
-
-	func = RNA_def_function(srna, "close", "WM_window_close");
-	RNA_def_function_flag(func, FUNC_USE_CONTEXT);
-	RNA_def_function_ui_description(func, "Close the current window");
 }
 
 void RNA_api_wm(StructRNA *srna)
diff --git a/source/blender/python/intern/CMakeLists.txt b/source/blender/python/intern/CMakeLists.txt
index f04bca7..cd2a9fd 100644
--- a/source/blender/python/intern/CMakeLists.txt
+++ b/source/blender/python/intern/CMakeLists.txt
@@ -46,7 +46,6 @@ set(INC_SYS
 
 set(SRC
 	gpu.c
-	gpu_offscreen.c
 	bpy.c
 	bpy_app.c
 	bpy_app_build_options.c
diff --git a/source/blender/python/intern/gpu.c b/source/blender/python/intern/gpu.c
index d31b29c..bc15e10 100644
--- a/source/blender/python/intern/gpu.c
+++ b/source/blender/python/intern/gpu.c
@@ -60,7 +60,7 @@
 #define PY_MODULE_ADD_CONSTANT(module, name) PyModule_AddIntConstant(module, # name, name)
 
 PyDoc_STRVAR(M_gpu_doc,
-"This module provides access to the GLSL shader and Offscreen rendering functionalities."
+"This module provides access to the GLSL shader."
 );
 static struct PyModuleDef gpumodule = {
 	PyModuleDef_HEAD_INIT,
@@ -314,25 +314,12 @@ static PyMethodDef meth_export_shader[] = {
 	{"export_shader", (PyCFunction)GPU_export_shader, METH_VARARGS | METH_KEYWORDS, GPU_export_shader_doc}
 };
 
-/* -------------------------------------------------------------------- */
-/* Initialize Module */
-
 PyObject *GPU_initPython(void)
 {
-	PyObject *module;
-	PyObject *submodule;
-	PyObject *sys_modules = PyThreadState_GET()->interp->modules;
-
-	module = PyInit_gpu();
-
+	PyObject *module = PyInit_gpu();
 	PyModule_AddObject(module, "export_shader", (PyObject *)PyCFunction_New(meth_export_shader, NULL));
-
-	/* gpu.offscreen */
-	PyModule_AddObject(module, "offscreen", (submodule = BPyInit_gpu_offscreen()));
-	PyDict_SetItemString(sys_modules, PyModule_GetName(submodule), submodule);
-	Py_INCREF(submodule);
-
 	PyDict_SetItemString(PyImport_GetModuleDict(), "gpu", module);
+
 	return module;
 }
 
diff --git a/source/blender/python/intern/gpu.h b/source/blender/python/intern/gpu.h
index 0da44a4..8233886 100644
--- a/source/blender/python/intern/gpu.h
+++ b/source/blender/python/intern/gpu.h
@@ -36,6 +36,4 @@
 
 PyObject *GPU_initPython(void);
 
-PyObject *BPyInit_gpu_offscreen(void);
-
 #endif /* __GPU_H__ */
diff --git a/source/blender/python/intern/gpu_offscreen.c b/source/blender/python/intern/gpu_offscreen.c
deleted file mode 100644
index b63ea0c..0000000
--- a/source/blender/python/intern/gpu_offscreen.c
+++ /dev/null
@@ -1,437 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * 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) 2015 Blender Foundation.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): Dalai Felinto
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file blender/python/intern/gpu_offscreen.c
- *  \ingroup pythonintern
- *
- * This file defines the offscreen functionalities of the 'gpu' module
- * used for offline rendering
- */
-
-/* python redefines */
-#ifdef _POSIX_C_SOURCE
-#undef _POSIX_C_SOURCE
-#endif
-
-#include <Python.h>
-
-#include "DNA_object_types.h"
-
-#include "BLI_utildefines.h"
-
-#include "BKE_context.h"
-
-#include "WM_types.h"
-
-#include "ED_screen.h"
-
-#include "GPU_extensions.h"
-#include "GPU_compositing.h"
-
-#include "../mathutils/mathutils.h"
-
-#include "bpy_util.h"
-
-#include "../generic/py_capi_utils.h"
-
-#include "gpu.h"
-
-/* -------------------------------------------------------------------- */
-/* GPU Offscreen PyObject */
-
-typedef struct {
-	PyObject_HEAD
-	GPUOffScreen *ofs;
-} PyGPUOffScreen;
-
-static int bpy_gpu_offscreen_valid_check(PyGPUOffScreen *pygpu, const char *error_prefix)
-{
-	if (UNLIKELY(pygpu->ofs == NULL)) {
-		PyErr_Format(PyExc_ReferenceError,
-		             "%.200s: GPU offscreen was freed, no further access is valid",
-		             error_prefix, Py_TYPE(pygpu)->tp_name);
-		return -1;
-	}
-	return 0;
-}
-
-#define BPY_GPU_OFFSCREEN_CHECK_OBJ(pygpu, errmsg) { \
-    if (UNLIKELY(bpy_gpu_offscreen_valid_check(pygpu, errmsg) == -1)) { \
-		return NULL; \
-	} \
-} (void)0
-
-/* annoying since arg parsing won't check overflow */
-#define UINT_IS_NEG(n) ((n) > INT_MAX)
-
-PyDoc_STRVAR(pygpu_offscreen_width_doc, "Texture width.\n\n:type: GLsizei");
-static PyObject *pygpu_offscreen_width_get(PyGPUOffScreen *self, void *UNUSED(type))
-{
-	BPY_GPU_OFFSCREEN_CHECK_OBJ(self, "width");
-	return PyLong_FromLong(GPU_offscreen_width(self->ofs));
-}
-
-PyDoc_STRVAR(pygpu_offscreen_height_doc, "Texture height.\n\n:type: GLsizei");
-static PyObject *pygpu_offscreen_height_get(PyGPUOffScreen *self, void *UNUSED(type))
-{
-	BPY_GPU_OFFSCREEN_CHECK_OBJ(self, "height");
-	return PyLong_FromLong(GPU_offscreen_height(self->o

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list