summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoronestone <onestone>2006-12-18 20:35:42 +0000
committeronestone <onestone>2006-12-18 20:35:42 +0000
commit2f44397a29a96715e919bc5173e7dcfacbd16c78 (patch)
treed7d664ce8f7507e14ee893fb1ed79a568f17c3bb
parent95d160ec163a21401c337c0556fb5bc60f3027ca (diff)
downloadaquamarine-2f44397a29a96715e919bc5173e7dcfacbd16c78.tar.gz
aquamarine-2f44397a29a96715e919bc5173e7dcfacbd16c78.tar.bz2
aquamarine: improved shadow drawing performance
-rw-r--r--src/window.cpp29
-rw-r--r--src/window.h1
2 files changed, 22 insertions, 8 deletions
diff --git a/src/window.cpp b/src/window.cpp
index b45f986..0453975 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -566,14 +566,12 @@ Aquamarine::Window::setMask (const QRegion & reg, int)
int top, bottom, left, right;
m_deco->borders (left, right, top, bottom);
- QRegion win(left,top,m_geometry.width(),m_geometry.height());
-
if (m_shapeSet)
- m_shapeChange += m_shape.eor(reg.subtract(win));
+ m_shapeChange += m_shape.eor(reg);
else
- m_shapeChange = reg.subtract(win);
+ m_shapeChange = reg;
- m_shape = QRegion (reg.subtract(win));
+ m_shape = QRegion (reg);
m_shapeSet = true;
if (m_deco)
@@ -1606,9 +1604,26 @@ void Aquamarine::Window::renderShadow ()
if (m_shapeChange.isEmpty() || !Settings::drawShadows()) return;
kdDebug () << k_funcinfo << endl;
+ int top, bottom, left, right;
+ m_deco->borders (left, right, top, bottom);
+
+ renderShadow(m_shapeChange.intersect(QRegion(0,0,m_deco->width(),top)));
+ renderShadow(m_shapeChange.intersect(QRegion(0,m_deco->height() - bottom,m_deco->width(),bottom)));
+ renderShadow(m_shapeChange.intersect(QRegion(0,top,left,m_geometry.height())));
+ renderShadow(m_shapeChange.intersect(QRegion(m_deco->width() - right,top,right,m_geometry.height())));
+
+ m_shapeChange = QRegion();
+}
+
+void Aquamarine::Window::renderShadow (QRegion reg)
+{
+
+ if (reg.isEmpty())
+ return;
+
int s2 = m_sradius * 2;
- QRect rect = m_shapeChange.boundingRect();
+ QRect rect = reg.boundingRect();
rect.setLeft(rect.left() - s2);
rect.setTop(rect.top() - s2);
@@ -1694,8 +1709,6 @@ void Aquamarine::Window::renderShadow ()
XRenderFreePicture (qt_xdisplay(), tmp);
XRenderFreePicture (qt_xdisplay(), dst);
- m_shapeChange = QRegion();
-
delete params;
}
diff --git a/src/window.h b/src/window.h
index 388567e..20b40df 100644
--- a/src/window.h
+++ b/src/window.h
@@ -169,6 +169,7 @@ namespace Aquamarine
XFixed *createGaussianKernel (int *r_size);
void setPictureTransform (Picture p, int dx, int dy);
void renderShadow ();
+ void renderShadow (QRegion reg);
private slots:
void updateWindow ();