summaryrefslogtreecommitdiff
path: root/plugins
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2014-02-27 00:21:34 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2014-02-27 00:21:34 +0100
commit153bfcfe7b803638a34a62281375b22b49762c9e (patch)
tree516a52380f705503d2d25eaf7b8424f1ab90f377 /plugins
parent273fe9b0a9d5f8f48e8efc24a110726ef1735427 (diff)
UnityScreen: cache some functions results
(bzr r3680.1.66)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/unityshell/src/unityshell.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp
index 67cfd1cbc..c4f8c57db 100644
--- a/plugins/unityshell/src/unityshell.cpp
+++ b/plugins/unityshell/src/unityshell.cpp
@@ -2853,9 +2853,12 @@ bool UnityWindow::glDraw(const GLMatrix& matrix,
const CompRegion& region,
unsigned int mask)
{
- if (uScreen->doShellRepaint && !uScreen->paint_panel_under_dash_ && window->type() == CompWindowTypeNormalMask)
+ auto window_state = window->state();
+ auto window_type = window->type();
+
+ if (uScreen->doShellRepaint && !uScreen->paint_panel_under_dash_ && window_type == CompWindowTypeNormalMask)
{
- if ((window->state() & MAXIMIZE_STATE) && window->onCurrentDesktop() && !window->overrideRedirect() && window->managed())
+ if ((window_state & MAXIMIZE_STATE) && window->onCurrentDesktop() && !window->overrideRedirect() && window->managed())
{
CompPoint const& viewport = window->defaultViewport();
unsigned output = window->outputDevice();
@@ -2888,7 +2891,7 @@ bool UnityWindow::glDraw(const GLMatrix& matrix,
{
Window active_window = screen->activeWindow();
- if (G_UNLIKELY(window->type() == CompWindowTypeDesktopMask))
+ if (G_UNLIKELY(window_type == CompWindowTypeDesktopMask))
{
uScreen->setPanelShadowMatrix(matrix);
@@ -2908,9 +2911,9 @@ bool UnityWindow::glDraw(const GLMatrix& matrix,
draw_panel_shadow = DrawPanelShadow::BELOW_WINDOW;
uScreen->is_desktop_active_ = false;
- if (!(window->state() & CompWindowStateMaximizedVertMask) &&
- !(window->state() & CompWindowStateFullscreenMask) &&
- !(window->type() & CompWindowTypeFullscreenMask))
+ if (!(window_state & CompWindowStateMaximizedVertMask) &&
+ !(window_state & CompWindowStateFullscreenMask) &&
+ !(window_type & CompWindowTypeFullscreenMask))
{
WindowManager& wm = WindowManager::Default();
auto const& output = uScreen->screen->currentOutputDev();