Remove unused ibuf argument from draw_gpencil_2dimage
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 7 Jun 2012 17:57:49 +0000 (17:57 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 7 Jun 2012 17:57:49 +0000 (17:57 +0000)
It was used by sequencer only and it wasn't ported for a while already.
This change allows to save cahce lookup for image and clip editors.

source/blender/editors/gpencil/drawgpencil.c
source/blender/editors/include/ED_gpencil.h
source/blender/editors/space_clip/clip_draw.c
source/blender/editors/space_image/image_draw.c

index 8d771f0dc58e5b2781a1d8eed399ee86aab04716..1823bbce3a12ffe944732e59d0001b6e10b8f719 100644 (file)
@@ -669,7 +669,7 @@ static void gp_draw_data(bGPdata *gpd, int offsx, int offsy, int winx, int winy,
 // ............................
 
 /* draw grease-pencil sketches to specified 2d-view that uses ibuf corrections */
-void draw_gpencil_2dimage(bContext *C, ImBuf *ibuf)
+void draw_gpencil_2dimage(bContext *C /* , ImBuf *ibuf */)
 {
        ScrArea *sa = CTX_wm_area(C);
        ARegion *ar = CTX_wm_region(C);
@@ -678,8 +678,6 @@ void draw_gpencil_2dimage(bContext *C, ImBuf *ibuf)
        int offsx, offsy, sizex, sizey;
        int dflag = GP_DRAWDATA_NOSTATUS;
        
-       /* check that we have grease-pencil stuff to draw */
-       if (ELEM(NULL, sa, ibuf)) return;
        gpd = gpencil_data_get_active(C); // XXX
        if (gpd == NULL) return;
        
@@ -706,7 +704,10 @@ void draw_gpencil_2dimage(bContext *C, ImBuf *ibuf)
                {
                        SpaceSeq *sseq = (SpaceSeq *)sa->spacedata.first;
                        float zoom, zoomx, zoomy;
-                       
+
+                       /* check that we have grease-pencil stuff to draw */
+                       if (ELEM(NULL, sa, ibuf)) return;
+
                        /* calculate accessory values */
                        zoom = (float)(SEQ_ZOOM_FAC(sseq->zoom));
                        if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
index bd3e4371a79fb73a7c91992b28014a99048f08a8..2040d4b9c32a9d693aa808c075e9cbe20cb2b795 100644 (file)
@@ -76,7 +76,7 @@ void ED_operatortypes_gpencil(void);
 /* ------------ Grease-Pencil Drawing API ------------------ */
 /* drawgpencil.c */
 
-void draw_gpencil_2dimage(struct bContext *C, struct ImBuf *ibuf);
+void draw_gpencil_2dimage(struct bContext *C /* , struct ImBuf *ibuf */);
 void draw_gpencil_view2d(struct bContext *C, short onlyv2d);
 void draw_gpencil_view3d(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, short only3d);
 
index 62ea0b00ff8da1db491626e24eabdaecfd2202fc..cca72e7469a0f059891592d85e4c3fd2a233a628 100644 (file)
@@ -1457,7 +1457,6 @@ void clip_draw_grease_pencil(bContext *C, int onlyv2d)
 {
        SpaceClip *sc = CTX_wm_space_clip(C);
        MovieClip *clip = ED_space_clip(sc);
-       ImBuf *ibuf;
 
        if (!clip)
                return;
@@ -1466,16 +1465,11 @@ void clip_draw_grease_pencil(bContext *C, int onlyv2d)
                /* if manual calibration is used then grease pencil data is already
                 * drawed in draw_distortion */
                if ((sc->flag & SC_MANUAL_CALIBRATION) == 0 || sc->mode != SC_MODE_DISTORTION) {
-                       ibuf = ED_space_clip_get_buffer(sc);
-
-                       if (ibuf) {
-                               glPushMatrix();
-                               glMultMatrixf(sc->unistabmat);
-                               draw_gpencil_2dimage(C, ibuf);
+                       glPushMatrix();
+                       glMultMatrixf(sc->unistabmat);
+                       draw_gpencil_2dimage(C);
 
-                               IMB_freeImBuf(ibuf);
-                               glPopMatrix();
-                       }
+                       glPopMatrix();
                }
        }
        else {
index aab628180c880c870d049d37f3164ba933b746ed..0440aff3f659ce94a790c3b5e04faaeafe0227b5 100644 (file)
@@ -564,16 +564,9 @@ void draw_image_grease_pencil(bContext *C, short onlyv2d)
 {
        /* draw in View2D space? */
        if (onlyv2d) {
-               /* assume that UI_view2d_ortho(C) has been called... */
-               SpaceImage *sima = (SpaceImage *)CTX_wm_space_data(C);
-               void *lock;
-               ImBuf *ibuf = ED_space_image_acquire_buffer(sima, &lock);
-               
                /* draw grease-pencil ('image' strokes) */
                //if (sima->flag & SI_DISPGP)
-               draw_gpencil_2dimage(C, ibuf);
-
-               ED_space_image_release_buffer(sima, lock);
+               draw_gpencil_2dimage(C);
        }
        else {
                /* assume that UI_view2d_restore(C) has been called... */