Browse Source

Fl_Double_Window: Try to be more efficient when using XDBE.

tags/v1.3.1000
Jonathan Moore Liles 13 years ago
parent
commit
3b35024d52
2 changed files with 27 additions and 9 deletions
  1. +8
    -0
      .gitignore
  2. +19
    -9
      src/Fl_Double_Window.cxx

+ 8
- 0
.gitignore View File

@@ -0,0 +1,8 @@
*~
*.bak
*.swp
*.[ao]
TAGS
.nfs*
make.conf
.deps

+ 19
- 9
src/Fl_Double_Window.cxx View File

@@ -338,7 +338,7 @@ void Fl_Double_Window::flush(int eraseoverlay) {
if (!myi->other_xid) {
#if USE_XDBE
if (can_xdbe()) {
myi->other_xid = XdbeAllocateBackBufferName(fl_display, fl_xid(this), XdbeCopied);
myi->other_xid = XdbeAllocateBackBufferName(fl_display, fl_xid(this), XdbeUndefined);
myi->backbuffer_bad = 1;
} else
#endif
@@ -361,8 +361,11 @@ void Fl_Double_Window::flush(int eraseoverlay) {
if (myi->region) {XDestroyRegion(myi->region); myi->region = 0;}
clear_damage(FL_DAMAGE_ALL);
myi->backbuffer_bad = 0;

}


XdbeBeginIdiom( fl_display );
// Redraw as needed...
if (damage()) {
fl_clip_region(myi->region); myi->region = 0;
@@ -372,10 +375,14 @@ void Fl_Double_Window::flush(int eraseoverlay) {
}

// Copy contents of back buffer to window...

XdbeSwapInfo s;
s.swap_window = fl_xid(this);
s.swap_action = XdbeCopied;
s.swap_window = myi->xid;
s.swap_action = XdbeUndefined;
XdbeSwapBuffers(fl_display, &s, 1);

XdbeEndIdiom( fl_display );

return;
} else
#endif
@@ -411,8 +418,13 @@ void Fl_Double_Window::flush(int eraseoverlay) {
if (eraseoverlay) fl_clip_region(0);
// on Irix (at least) it is faster to reduce the area copied to
// the current clip region:
int X,Y,W,H; fl_clip_box(0,0,w(),h(),X,Y,W,H);
if (myi->other_xid) fl_copy_offscreen(X, Y, W, H, myi->other_xid, X, Y);
#if USE_XDBE
if ( !use_xdbe )
#endif
{
int X,Y,W,H; fl_clip_box(0,0,w(),h(),X,Y,W,H);
if (myi->other_xid) fl_copy_offscreen(X, Y, W, H, myi->other_xid, X, Y);
}
}

void Fl_Double_Window::resize(int X,int Y,int W,int H) {
@@ -422,10 +434,8 @@ void Fl_Double_Window::resize(int X,int Y,int W,int H) {
#if USE_XDBE
if (use_xdbe) {
Fl_X* myi = Fl_X::i(this);
if (myi && myi->other_xid && (ow < w() || oh < h())) {
// STR #2152: Deallocate the back buffer to force creation of a new one.
XdbeDeallocateBackBufferName(fl_display,myi->other_xid);
myi->other_xid = 0;
if (myi && myi->other_xid && ( ow != w() || oh != h() ) ) {
myi->backbuffer_bad = 1;
}
return;
}


Loading…
Cancel
Save