From 76d96506dce83ab7200883fe1a33e4aeada77aa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 15 May 2013 13:07:10 +0200 Subject: [PATCH] Remove damage argument in Toplevel::resetDamage We always reset with the complete window geometry, so the subtracting doesn't make any sense. We can just always set the damage to an empty region. REVIEW: 110438 --- composite.cpp | 7 ++----- scene_opengl.cpp | 4 ++-- scene_xrender.cpp | 2 +- toplevel.h | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/composite.cpp b/composite.cpp index b7fae27a7d..3850f3f1b5 100644 --- a/composite.cpp +++ b/composite.cpp @@ -1026,12 +1026,9 @@ void Toplevel::addDamageFull() emit damaged(this, rect()); } -void Toplevel::resetDamage(const QRect& r) +void Toplevel::resetDamage() { - damage_region -= r; - int damageArea = 0; - foreach (const QRect &r2, damage_region.rects()) - damageArea += r2.width()*r2.height(); + damage_region = QRegion(); } void Toplevel::addRepaint(const QRect& r) diff --git a/scene_opengl.cpp b/scene_opengl.cpp index fc28035200..062d391603 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -921,7 +921,7 @@ bool SceneOpenGL::Window::bindTexture() if (!toplevel->damage().isEmpty()) { // mipmaps need to be updated texture->setDirty(); - toplevel->resetDamage(QRect(toplevel->clientPos(), toplevel->clientSize())); + toplevel->resetDamage(); } return true; } @@ -934,7 +934,7 @@ bool SceneOpenGL::Window::bindTexture() toplevel->damage()); if (success) - toplevel->resetDamage(QRect(toplevel->clientPos(), toplevel->clientSize())); + toplevel->resetDamage(); else kDebug(1212) << "Failed to bind window"; return success; diff --git a/scene_xrender.cpp b/scene_xrender.cpp index 4af7f5faf3..702854c0ac 100644 --- a/scene_xrender.cpp +++ b/scene_xrender.cpp @@ -329,7 +329,7 @@ xcb_render_picture_t SceneXrender::Window::picture() return XCB_RENDER_PICTURE_NONE; _picture = xcb_generate_id(connection()); xcb_render_create_picture(connection(), _picture, pix, format, 0, NULL); - toplevel->resetDamage(toplevel->rect()); + toplevel->resetDamage(); } return _picture; } diff --git a/toplevel.h b/toplevel.h index 8928e2bd09..0bd9c456d7 100644 --- a/toplevel.h +++ b/toplevel.h @@ -252,7 +252,7 @@ public: QRegion repaints() const; void resetRepaints(); QRegion damage() const; - void resetDamage(const QRect& r); + void resetDamage(); EffectWindowImpl* effectWindow(); const EffectWindowImpl* effectWindow() const; /**