[Bf-blender-cvs] [04dfdfc] framebuffer: From review: rename ofs.draw() > ofs.draw_view3d()

Dalai Felinto noreply at git.blender.org
Thu Oct 15 16:25:00 CEST 2015


Commit: 04dfdfc4ab9f1cb3cb30d0a10ec41a4b59d270ff
Author: Dalai Felinto
Date:   Thu Oct 15 11:16:34 2015 -0300
Branches: framebuffer
https://developer.blender.org/rB04dfdfc4ab9f1cb3cb30d0a10ec41a4b59d270ff

>From review: rename ofs.draw() > ofs.draw_view3d()

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

M	source/blender/gpu/GPU_extensions.h
M	source/blender/gpu/intern/gpu_extensions.c
M	source/blender/python/intern/gpu_offscreen.c

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

diff --git a/source/blender/gpu/GPU_extensions.h b/source/blender/gpu/GPU_extensions.h
index bdceb25..ded9669 100644
--- a/source/blender/gpu/GPU_extensions.h
+++ b/source/blender/gpu/GPU_extensions.h
@@ -185,7 +185,7 @@ 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(GPUOffScreen *ofs, struct bContext *C, float projection_matrix[4][4], float modelview_matrix[4][4]);
+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);
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index 005df4c..458505d 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -1680,7 +1680,7 @@ static void gpu_offscreen_draw_doit(
 	GPU_offscreen_unbind(ofs, true); /* unbind */
 }
 
-void GPU_offscreen_draw(GPUOffScreen *ofs, struct bContext *C, float projection_matrix[4][4], float modelview_matrix[4][4])
+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);
diff --git a/source/blender/python/intern/gpu_offscreen.c b/source/blender/python/intern/gpu_offscreen.c
index 763f231..34e3907 100644
--- a/source/blender/python/intern/gpu_offscreen.c
+++ b/source/blender/python/intern/gpu_offscreen.c
@@ -200,17 +200,17 @@ static int pygpu_offscreen_check_matrix(PyObject *o, void *p)
 	return 1;
 }
 
-PyDoc_STRVAR(pygpu_offscreen_draw_doc,
-"draw(modelview_matrix, projection_matrix)\n"
+PyDoc_STRVAR(pygpu_offscreen_draw_view3d_doc,
+"draw_view3d(modelview_matrix, projection_matrix)\n"
 "\n"
-"   Draw the viewport in the offscreen object.\n"
+"   Draw the 3d viewport in the offscreen object.\n"
 "\n"
 "   :param modelview_matrix: ModelView Matrix\n"
 "   :type modelview_matrix: :class:`mathutils.Matrix`\n"
 "   :param projection_matrix: Projection Matrix\n"
 "   :type projection_matrix: :class:`mathutils.Matrix`"
 );
-static PyObject *pygpu_offscreen_draw(PyGPUOffScreen *self, PyObject *args, PyObject *kwds)
+static PyObject *pygpu_offscreen_draw_view3d(PyGPUOffScreen *self, PyObject *args, PyObject *kwds)
 {
 	MatrixObject *PyModelViewMatrix;
 	MatrixObject *PyProjectionMatrix;
@@ -220,9 +220,9 @@ static PyObject *pygpu_offscreen_draw(PyGPUOffScreen *self, PyObject *args, PyOb
 
 	static const char *kwlist[] = {"projection_matrix", "modelview_matrix", NULL};
 
-	BPY_GPU_OFFSCREEN_CHECK_OBJ(self, "draw");
+	BPY_GPU_OFFSCREEN_CHECK_OBJ(self, "draw_view3d");
 
-	if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&:draw", (char **)(kwlist),
+	if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&:draw_view3d", (char **)(kwlist),
 	                                 pygpu_offscreen_check_matrix, &PyProjectionMatrix,
 	                                 pygpu_offscreen_check_matrix, &PyModelViewMatrix))
 	{
@@ -234,11 +234,11 @@ static PyObject *pygpu_offscreen_draw(PyGPUOffScreen *self, PyObject *args, PyOb
 	ar = CTX_wm_region(C);
 
 	if ((v3d == NULL) || (ar == NULL)) {
-		PyErr_SetString(PyExc_SystemError, "draw: No valid view3d in the context");
+		PyErr_SetString(PyExc_SystemError, "draw_view3d: No valid view3d in the context");
 		return NULL;
 	}
 
-	GPU_offscreen_draw(self->ofs, C, (float(*)[4])PyProjectionMatrix->matrix, (float(*)[4])PyModelViewMatrix->matrix);
+	GPU_offscreen_draw_view3d(self->ofs, C, (float(*)[4])PyProjectionMatrix->matrix, (float(*)[4])PyModelViewMatrix->matrix);
 
 	Py_RETURN_NONE;
 }




More information about the Bf-blender-cvs mailing list