diff options
| author | Sam Spilsbury <sam.spilsbury@canonical.com> | 2013-11-07 18:48:57 +0000 |
|---|---|---|
| committer | Tarmac <> | 2013-11-07 18:48:57 +0000 |
| commit | 6a2e5491e487dbbeed835b3c962fbba812fb617d (patch) | |
| tree | 18dabd30af0019ea1a9d55c093d8d2152ee539b6 /unity-shared | |
| parent | a3ad488a274f9f197eba78216afcd3b16f1b672e (diff) | |
| parent | 69f3a52e1dfe060cce6b4d25a215db789d2dc38f (diff) | |
Don't re-present all of our windows on every frame. Only do that if damage intersects it.
Use the new APIs exposed by compiz and nux to intelligently determine which windows need to be presented per-frame and only register damage for those windows. This fixes two things: 1. BaseWindows being redrawn from scratch every time damage was registered over them. That was incorrect and should only be done in the case of background blurs. 2. BaseWindows being drawn to the screen on every frame, regardless of whether or not they needed to be. Now they will only be drawn if some damage intersects beneath them. Note that unity will expand the damage region to accomadate the base window since nux does not support geometry clipping. So if there is a partial intersection of the launcher for example, the area of the screen which contains the launcher will be re-painted (but the launcher itself won't be redrawn, just its texture) (LP: #1080947). Fixes: https://bugs.launchpad.net/bugs/1080947. Approved by PS Jenkins bot, Stephen M. Webb, Christopher Townsend, Brandon Schaefer. Original authors: - Sam Spilsbury <sam.spilsbury@canonical.com> - Andrea Azzarone <azzaronea@gmail.com> - Marco Trevisan (TreviƱo) <mail@3v1n0.net> - Chris Townsend <christopher.townsend@canonical.com> (bzr r3591)
Diffstat (limited to 'unity-shared')
| -rw-r--r-- | unity-shared/BackgroundEffectHelper.cpp | 2 | ||||
| -rw-r--r-- | unity-shared/PlacesOverlayVScrollBar.cpp | 3 | ||||
| -rw-r--r-- | unity-shared/PluginAdapter.cpp | 2 |
3 files changed, 3 insertions, 4 deletions
diff --git a/unity-shared/BackgroundEffectHelper.cpp b/unity-shared/BackgroundEffectHelper.cpp index d48aad978..0d86d3aba 100644 --- a/unity-shared/BackgroundEffectHelper.cpp +++ b/unity-shared/BackgroundEffectHelper.cpp @@ -74,7 +74,7 @@ void BackgroundEffectHelper::ProcessDamage(nux::Geometry const& geo) if (bg_effect_helper->cache_dirty || !bg_effect_helper->owner || !bg_effect_helper->enabled) continue; - if (!geo.Intersect(bg_effect_helper->blur_geometry_).IsNull()) + if (geo.IsIntersecting(bg_effect_helper->blur_geometry_)) { bg_effect_helper->DirtyCache(); } diff --git a/unity-shared/PlacesOverlayVScrollBar.cpp b/unity-shared/PlacesOverlayVScrollBar.cpp index fc5d2daac..e16f4b848 100644 --- a/unity-shared/PlacesOverlayVScrollBar.cpp +++ b/unity-shared/PlacesOverlayVScrollBar.cpp @@ -209,9 +209,8 @@ void PlacesOverlayVScrollBar::CheckIfThumbIsInsideSlider() { nux::Geometry const& slider_geo = _slider->GetAbsoluteGeometry(); nux::Geometry const& thumb_geo = overlay_window_->GetThumbGeometry(); - nux::Geometry const& intersection = (thumb_geo.Intersect(slider_geo)); - if (!intersection.IsNull()) + if (thumb_geo.IsIntersecting(slider_geo)) { ResetConnector(); overlay_window_->ThumbInsideSlider(); diff --git a/unity-shared/PluginAdapter.cpp b/unity-shared/PluginAdapter.cpp index b233f3067..34bead63d 100644 --- a/unity-shared/PluginAdapter.cpp +++ b/unity-shared/PluginAdapter.cpp @@ -573,7 +573,7 @@ bool PluginAdapter::IsWindowObscured(Window window_id) const && sibling->isMapped() && sibling->isViewable() && (sibling->state() & MAXIMIZE_STATE) == MAXIMIZE_STATE - && !GetWindowGeometry(sibling->id()).Intersect(win_geo).IsNull()) + && GetWindowGeometry(sibling->id()).IsIntersecting(win_geo)) { return true; } |
