Merging r49834 through r49839 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Sun, 12 Aug 2012 13:38:46 +0000 (13:38 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sun, 12 Aug 2012 13:38:46 +0000 (13:38 +0000)
1  2 
release/scripts/startup/bl_ui/space_sequencer.py
source/blender/editors/space_clip/space_clip.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/makesdna/DNA_space_types.h
source/blender/makesrna/intern/rna_space.c

@@@ -927,20 -910,28 +927,28 @@@ void draw_image_seq(const bContext *C, 
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
  
 -      glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, ibuf->x, ibuf->y, 0, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
 +      glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, ibuf->x, ibuf->y, 0, GL_RGBA, GL_UNSIGNED_BYTE, display_buffer);
        glBegin(GL_QUADS);
  
-       if (frame_ofs) {
-               rctf tot_clip;
-               tot_clip.xmin = v2d->tot.xmin + (ABS(v2d->tot.xmax - v2d->tot.xmin) * scene->ed->over_border.xmin);
-               tot_clip.ymin = v2d->tot.ymin + (ABS(v2d->tot.ymax - v2d->tot.ymin) * scene->ed->over_border.ymin);
-               tot_clip.xmax = v2d->tot.xmin + (ABS(v2d->tot.xmax - v2d->tot.xmin) * scene->ed->over_border.xmax);
-               tot_clip.ymax = v2d->tot.ymin + (ABS(v2d->tot.ymax - v2d->tot.ymin) * scene->ed->over_border.ymax);
-               glTexCoord2f(scene->ed->over_border.xmin, scene->ed->over_border.ymin); glVertex2f(tot_clip.xmin, tot_clip.ymin);
-               glTexCoord2f(scene->ed->over_border.xmin, scene->ed->over_border.ymax); glVertex2f(tot_clip.xmin, tot_clip.ymax);
-               glTexCoord2f(scene->ed->over_border.xmax, scene->ed->over_border.ymax); glVertex2f(tot_clip.xmax, tot_clip.ymax);
-               glTexCoord2f(scene->ed->over_border.xmax, scene->ed->over_border.ymin); glVertex2f(tot_clip.xmax, tot_clip.ymin);
+       if (draw_overlay) {
+               if (sseq->overlay_type == SEQ_DRAW_OVERLAY_RECT) {
+                       rctf tot_clip;
+                       tot_clip.xmin = v2d->tot.xmin + (ABS(v2d->tot.xmax - v2d->tot.xmin) * scene->ed->over_border.xmin);
+                       tot_clip.ymin = v2d->tot.ymin + (ABS(v2d->tot.ymax - v2d->tot.ymin) * scene->ed->over_border.ymin);
+                       tot_clip.xmax = v2d->tot.xmin + (ABS(v2d->tot.xmax - v2d->tot.xmin) * scene->ed->over_border.xmax);
+                       tot_clip.ymax = v2d->tot.ymin + (ABS(v2d->tot.ymax - v2d->tot.ymin) * scene->ed->over_border.ymax);
+                       glTexCoord2f(scene->ed->over_border.xmin, scene->ed->over_border.ymin); glVertex2f(tot_clip.xmin, tot_clip.ymin);
+                       glTexCoord2f(scene->ed->over_border.xmin, scene->ed->over_border.ymax); glVertex2f(tot_clip.xmin, tot_clip.ymax);
+                       glTexCoord2f(scene->ed->over_border.xmax, scene->ed->over_border.ymax); glVertex2f(tot_clip.xmax, tot_clip.ymax);
+                       glTexCoord2f(scene->ed->over_border.xmax, scene->ed->over_border.ymin); glVertex2f(tot_clip.xmax, tot_clip.ymin);
+               }
+               else if (sseq->overlay_type == SEQ_DRAW_OVERLAY_REFERENCE) {
+                       glTexCoord2f(0.0f, 0.0f); glVertex2f(v2d->tot.xmin, v2d->tot.ymin);
+                       glTexCoord2f(0.0f, 1.0f); glVertex2f(v2d->tot.xmin, v2d->tot.ymax);
+                       glTexCoord2f(1.0f, 1.0f); glVertex2f(v2d->tot.xmax, v2d->tot.ymax);
+                       glTexCoord2f(1.0f, 0.0f); glVertex2f(v2d->tot.xmax, v2d->tot.ymin);
+               }
        }
        else {
                glTexCoord2f(0.0f, 0.0f); glVertex2f(v2d->tot.xmin, v2d->tot.ymin);
@@@ -470,12 -470,9 +470,12 @@@ typedef struct SpaceSeq 
        int flag;
        float zoom DNA_DEPRECATED;  /* deprecated, handled by View2D now */
        int view; /* see SEQ_VIEW_* below */
-       int pad;
+       int overlay_type;
  
        struct bGPdata *gpd;        /* grease-pencil data */
 +
 +      /* **** color management **** */
 +      ColorManagedViewSettings view_settings;
  } SpaceSeq;
  
  
@@@ -2211,10 -2212,11 +2218,16 @@@ static void rna_def_space_sequencer(Ble
        RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space");
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
  
 +      prop = RNA_def_property(srna, "view_settings", PROP_POINTER, PROP_NONE);
 +      RNA_def_property_pointer_sdna(prop, NULL, "view_settings");
 +      RNA_def_property_struct_type(prop, "ColorManagedViewSettings");
 +      RNA_def_property_ui_text(prop, "View Settings", "Color management settings used for displaying images on the display");
++
+       prop = RNA_def_property(srna, "overlay_type", PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, "overlay_type");
+       RNA_def_property_enum_items(prop, overlay_type_items);
+       RNA_def_property_ui_text(prop, "Overlay Type", "Overlay draw type");
+       RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
  }
  
  static void rna_def_space_text(BlenderRNA *brna)