summaryrefslogtreecommitdiff
path: root/plugins/unityshell
diff options
authorEleni Maria Stea <elenimaria.stea@canonical.com>2016-07-22 13:20:33 +0300
committerEleni Maria Stea <elenimaria.stea@canonical.com>2016-07-22 13:20:33 +0300
commitb0d3be831fb6b79c0cd4c2a24c4d62cbe06508ae (patch)
treece1635242e7b43a90f5a827ba8f20b62d9d6978f /plugins/unityshell
parent9ab365b80c9e1e641fba4bec135a4ad975b0b376 (diff)
low gfx optimisation: don't calculate blur rectangles when we have no blur
(bzr r4151.1.3)
Diffstat (limited to 'plugins/unityshell')
-rw-r--r--plugins/unityshell/src/unityshell.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp
index fb35b4886..530d9620f 100644
--- a/plugins/unityshell/src/unityshell.cpp
+++ b/plugins/unityshell/src/unityshell.cpp
@@ -884,7 +884,7 @@ void UnityScreen::paintOutput()
current_draw_binding = old_read_binding;
#endif
- BackgroundEffectHelper::monitor_rect_.Set(0, 0, output->width(), output->height());
+ BackgroundEffectHelper::monitor_rect_.Set(0, 0, screen->width(), screen->height());
// If we have dirty helpers re-copy the backbuffer into a texture
if (dirty_helpers_on_this_frame_)
@@ -909,10 +909,10 @@ void UnityScreen::paintOutput()
for (CompRect const& rect : blur_region.rects())
{
- int x = nux::Clamp<int>(rect.x(), 0, output->width());
- int y = nux::Clamp<int>(output->height() - rect.y2(), 0, output->height());
- int width = std::min<int>(output->width() - rect.x(), rect.width());
- int height = std::min<int>(output->height() - y, rect.height());
+ int x = nux::Clamp<int>(rect.x(), 0, screen->width());
+ int y = nux::Clamp<int>(screen->height() - rect.y2(), 0, screen->height());
+ int width = std::min<int>(screen->width() - rect.x(), rect.width());
+ int height = std::min<int>(screen->height() - y, rect.height());
CHECKGL(glCopyTexSubImage2D(surface_target, 0, x, y, x, y, width, height));
}