Browse Source

Don't use FL_DAMAGE_CHILD optimization because it's incompatible with transparency.

tags/v1.3.1000
Jonathan Moore Liles 13 years ago
parent
commit
2b96034996
3 changed files with 19 additions and 11 deletions
  1. +7
    -1
      src/Fl.cxx
  2. +7
    -6
      src/Fl_Group.cxx
  3. +5
    -4
      src/Fl_Window.cxx

+ 7
- 1
src/Fl.cxx View File

@@ -1675,8 +1675,14 @@ void Fl_Widget::damage(uchar fl, int X, int Y, int W, int H) {
wi->damage_ |= fl;
wi = wi->parent();
if (!wi) return;
fl = FL_DAMAGE_CHILD;
/* we use FL_DAMAGE_EXPOSE now because of alpha blending and FL_NO_BOX and frames... */
fl = FL_DAMAGE_EXPOSE;
}

fl = FL_DAMAGE_CHILD;

/* at this point 'wi' is the window */

Fl_X* i = Fl_X::i((Fl_Window*)wi);
if (!i) return; // window not mapped, so ignore it



+ 7
- 6
src/Fl_Group.cxx View File

@@ -725,24 +725,25 @@ void Fl_Group::draw_children() {
h() - Fl::box_dh(box()));
}

if (damage() & ~FL_DAMAGE_CHILD) { // redraw the entire thing:
// if (damage() & ~FL_DAMAGE_CHILD) { // redraw the entire thing:
// if ( damage() & FL_DAMAGE_ALL ) {
for (int i=children_; i--;) {
Fl_Widget& o = **a++;
draw_child(o);
draw_outside_label(o);
}
} else { // only redraw the children that need it:
for (int i=children_; i--;) update_child(**a++);
}
/* } else { // only redraw the children that need it: */
/* for (int i=children_; i--;) update_child(**a++); */
/* } */

if (clip_children()) fl_pop_clip();
}

void Fl_Group::draw() {
if (damage() & ~FL_DAMAGE_CHILD) { // redraw the entire thing:
// if (damage() & ~FL_DAMAGE_CHILD) { // redraw the entire thing:
draw_box();
draw_label();
}
// }
draw_children();
}



+ 5
- 4
src/Fl_Window.cxx View File

@@ -106,10 +106,11 @@ void Fl_Window::draw() {
// - we draw the box with x=0 and y=0 instead of x() and y()
// - we don't draw a label

if (damage() & ~FL_DAMAGE_CHILD) { // draw the entire thing
draw_box(box(),0,0,w(),h(),color()); // draw box with x/y = 0
}
draw_children();
// if (damage() & ~FL_DAMAGE_CHILD) { // draw the entire thing
/* always draw the box because the children may be transparent */
draw_box(box(),0,0,w(),h(),color()); // draw box with x/y = 0
// }
draw_children();

if (fl_gc && !parent() && resizable() && (!size_range_set || minh!=maxh || minw!=maxw)) {
int dx = Fl::box_dw(box())-Fl::box_dx(box());


Loading…
Cancel
Save