MouseClick Animation effect supports QPainter Compositor
This commit is contained in:
parent
57eb00977b
commit
2dc14be640
2 changed files with 14 additions and 0 deletions
|
@ -34,6 +34,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <KDE/KConfigGroup>
|
||||
#include <KDE/KGlobalAccel>
|
||||
|
||||
#include <QPainter>
|
||||
|
||||
#include <math.h>
|
||||
|
||||
namespace KWin
|
||||
|
@ -254,6 +256,8 @@ void MouseClickEffect::drawCircle(const QColor& color, float cx, float cy, float
|
|||
drawCircleGl(color, cx, cy, r);
|
||||
if (effects->compositingType() == XRenderCompositing)
|
||||
drawCircleXr(color, cx, cy, r);
|
||||
if (effects->compositingType() == QPainterCompositing)
|
||||
drawCircleQPainter(color, cx, cy, r);
|
||||
}
|
||||
|
||||
void MouseClickEffect::paintScreenSetup(int mask, QRegion region, ScreenPaintData& data)
|
||||
|
@ -357,6 +361,15 @@ void MouseClickEffect::drawCircleXr(const QColor& color, float cx, float cy, flo
|
|||
#endif
|
||||
}
|
||||
|
||||
void MouseClickEffect::drawCircleQPainter(const QColor &color, float cx, float cy, float r)
|
||||
{
|
||||
QPainter *painter = effects->scenePainter();
|
||||
painter->save();
|
||||
painter->setPen(color);
|
||||
painter->drawArc(cx - r, cy - r, r * 2, r * 2, 0, 5760);
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
void MouseClickEffect::paintScreenSetupGl(int, QRegion, ScreenPaintData&)
|
||||
{
|
||||
if (ShaderManager::instance()->isValid()) {
|
||||
|
|
|
@ -160,6 +160,7 @@ private:
|
|||
|
||||
void drawCircleGl(const QColor& color, float cx, float cy, float r);
|
||||
void drawCircleXr(const QColor& color, float cx, float cy, float r);
|
||||
void drawCircleQPainter(const QColor& color, float cx, float cy, float r);
|
||||
void paintScreenSetupGl(int mask, QRegion region, ScreenPaintData& data);
|
||||
void paintScreenFinishGl(int mask, QRegion region, ScreenPaintData& data);
|
||||
|
||||
|
|
Loading…
Reference in a new issue