diff options
author | Sam Spilsbury <smspillaz@gmail.com> | 2011-01-04 16:44:26 +0800 |
---|---|---|
committer | Sam Spilsbury <smspillaz@gmail.com> | 2011-01-04 16:44:26 +0800 |
commit | b8010d03619080508dddfc8eaa33f86f6ab6cbbe (patch) | |
tree | 68a9bae509830b3479b22c4ef22112d57aa83f4a | |
parent | 0d81dcc38a6fcc54568e60de366ae99e2b53f7e6 (diff) | |
download | compiz-with-glib-mainloop-b8010d03619080508dddfc8eaa33f86f6ab6cbbe.tar.gz compiz-with-glib-mainloop-b8010d03619080508dddfc8eaa33f86f6ab6cbbe.tar.bz2 |
Re-add paint-smartness to composite.cpp
-rw-r--r-- | plugins/composite/src/screen.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/plugins/composite/src/screen.cpp b/plugins/composite/src/screen.cpp index 7cdf1c3..8c5f509 100644 --- a/plugins/composite/src/screen.cpp +++ b/plugins/composite/src/screen.cpp @@ -458,6 +458,9 @@ CompositeScreen::compositingActive () void CompositeScreen::damageScreen () { + if (priv->damageMask == 0) + priv->paintTimer.setTimes (priv->paintTimer.minLeft ()); + priv->damageMask |= COMPOSITE_SCREEN_DAMAGE_ALL_MASK; priv->damageMask &= ~COMPOSITE_SCREEN_DAMAGE_REGION_MASK; } @@ -468,6 +471,9 @@ CompositeScreen::damageRegion (const CompRegion ®ion) if (priv->damageMask & COMPOSITE_SCREEN_DAMAGE_ALL_MASK) return; + if (priv->damageMask == 0) + priv->paintTimer.setTimes (priv->paintTimer.minLeft ()); + priv->damage += region; priv->damageMask |= COMPOSITE_SCREEN_DAMAGE_REGION_MASK; @@ -483,6 +489,9 @@ CompositeScreen::damageRegion (const CompRegion ®ion) void CompositeScreen::damagePending () { + if (priv->damageMask == 0) + priv->paintTimer.setTimes (priv->paintTimer.minLeft ()); + priv->damageMask |= COMPOSITE_SCREEN_DAMAGE_PENDING_MASK; } @@ -883,6 +892,11 @@ CompositeScreen::handlePaintTimeout () else timeToNextRedraw = priv->getTimeToNextRedraw (&tv); + if (priv->idle) + priv->paintTimer.setTimes (timeToNextRedraw, MAXSHORT); + else + priv->paintTimer.setTimes (timeToNextRedraw); + return true; } |