summaryrefslogtreecommitdiff
path: root/plugins
diff options
authorEleni Maria Stea <elenimaria.stea@canonical.com>2016-07-05 10:23:04 +0000
committerBileto Bot <ci-train-bot@canonical.com>2016-07-05 10:23:04 +0000
commitaa0490895527cfe097d6d7e304b872830795c9fa (patch)
tree91cf2fbe63f465e1fd986a7f0fdd20d9435ca1a8 /plugins
parent43b2db050cf45d4e70aad1f1ecc1c98549cdbe65 (diff)
parent19054999d56d7b3b1eed6ead0866877d6e0cb04c (diff)
UnityScreen: only redraw parts of the screen visible in each output
We draw only the parts of the screen that are visible in each output (monitor) because compiz draws things per output anyway. Speeds up the drawing by about N times, where N is the number of monitors because: We used to draw all monitors' content when 1 monitor was rendered (=> we rendered N times the N monitors' content). Now, we draw only the current monitor's content (we render 1 time each of the N monitors' content). (LP: #1598770) (bzr r4145)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/unityshell/src/unityshell.cpp20
-rw-r--r--plugins/unityshell/src/unityshell.h2
2 files changed, 11 insertions, 11 deletions
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp
index eae3e412a..fb35b4886 100644
--- a/plugins/unityshell/src/unityshell.cpp
+++ b/plugins/unityshell/src/unityshell.cpp
@@ -863,7 +863,7 @@ void UnityScreen::DamageBlurUpdateRegion(nux::Geometry const& blur_update)
cScreen->damageRegion(CompRegionFromNuxGeo(blur_update));
}
-void UnityScreen::paintDisplay()
+void UnityScreen::paintOutput()
{
CompOutput *output = last_output_;
@@ -884,7 +884,7 @@ void UnityScreen::paintDisplay()
current_draw_binding = old_read_binding;
#endif
- BackgroundEffectHelper::monitor_rect_.Set(0, 0, screen->width(), screen->height());
+ BackgroundEffectHelper::monitor_rect_.Set(0, 0, output->width(), output->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::paintDisplay()
for (CompRect const& rect : blur_region.rects())
{
- 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());
+ 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());
CHECKGL(glCopyTexSubImage2D(surface_target, 0, x, y, x, y, width, height));
}
@@ -1504,7 +1504,7 @@ bool UnityScreen::glPaintOutput(const GLScreenPaintAttrib& attrib,
doShellRepaint = false;
if (doShellRepaint)
- paintDisplay();
+ paintOutput();
return ret;
}
@@ -3094,18 +3094,18 @@ bool UnityWindow::glDraw(const GLMatrix& matrix,
if (uScreen->doShellRepaint && window == uScreen->onboard_)
{
- uScreen->paintDisplay();
+ uScreen->paintOutput();
}
else if (uScreen->doShellRepaint &&
window == uScreen->firstWindowAboveShell &&
!uScreen->forcePaintOnTop() &&
!uScreen->fullscreenRegion.contains(window->geometry()))
{
- uScreen->paintDisplay();
+ uScreen->paintOutput();
}
else if (locked && CanBypassLockScreen())
{
- uScreen->paintDisplay();
+ uScreen->paintOutput();
}
enum class DrawPanelShadow
diff --git a/plugins/unityshell/src/unityshell.h b/plugins/unityshell/src/unityshell.h
index b1dfda5b0..789e18aaf 100644
--- a/plugins/unityshell/src/unityshell.h
+++ b/plugins/unityshell/src/unityshell.h
@@ -179,7 +179,7 @@ private:
void nuxEpilogue();
/* nux draw wrapper */
- void paintDisplay();
+ void paintOutput();
void paintPanelShadow(CompRegion const& clip);
void setPanelShadowMatrix(const GLMatrix& matrix);
void updateBlurDamage();