KWin
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
KWin::CrossFadeEffect Class Reference

#include <offscreeneffect.h>

Inheritance diagram for KWin::CrossFadeEffect:
KWin::Effect KWin::AnimationEffect KWin::BlendChanges KWin::HighlightWindowEffect KWin::ScriptedEffect ScriptedEffectWithDebugSpy

Public Member Functions

 CrossFadeEffect (QObject *parent=nullptr)
 
 ~CrossFadeEffect () override
 
void drawWindow (const RenderTarget &renderTarget, const RenderViewport &viewport, EffectWindow *window, int mask, const QRegion &region, WindowPaintData &data) override
 
void redirect (EffectWindow *window)
 
void unredirect (EffectWindow *window)
 
void setShader (EffectWindow *window, GLShader *shader)
 
- Public Member Functions inherited from KWin::Effect
 Effect (QObject *parent=nullptr)
 
 ~Effect () override
 
virtual void reconfigure (ReconfigureFlags flags)
 
virtual void prePaintScreen (ScreenPrePaintData &data, std::chrono::milliseconds presentTime)
 
virtual void paintScreen (const RenderTarget &renderTarget, const RenderViewport &viewport, int mask, const QRegion &region, Output *screen)
 
virtual void postPaintScreen ()
 
virtual void prePaintWindow (EffectWindow *w, WindowPrePaintData &data, std::chrono::milliseconds presentTime)
 
virtual void paintWindow (const RenderTarget &renderTarget, const RenderViewport &viewport, EffectWindow *w, int mask, QRegion region, WindowPaintData &data)
 
virtual void postPaintWindow (EffectWindow *w)
 
virtual bool provides (Feature)
 
virtual bool perform (Feature feature, const QVariantList &arguments)
 
virtual void windowInputMouseEvent (QEvent *e)
 
virtual void grabbedKeyboardEvent (QKeyEvent *e)
 
virtual bool isActive () const
 
virtual QString debug (const QString &parameter) const
 
virtual int requestedEffectChainPosition () const
 
virtual bool touchDown (qint32 id, const QPointF &pos, std::chrono::microseconds time)
 
virtual bool touchMotion (qint32 id, const QPointF &pos, std::chrono::microseconds time)
 
virtual bool touchUp (qint32 id, std::chrono::microseconds time)
 
virtual bool tabletToolEvent (QTabletEvent *event)
 
virtual bool tabletToolButtonEvent (uint button, bool pressed, quint64 tabletToolId)
 
virtual bool tabletPadButtonEvent (uint button, bool pressed, void *tabletPadId)
 
virtual bool tabletPadStripEvent (int number, int position, bool isFinger, void *tabletPadId)
 
virtual bool tabletPadRingEvent (int number, int position, bool isFinger, void *tabletPadId)
 
template<typename T >
int animationTime (int defaultDuration)
 
virtual bool blocksDirectScanout () const
 

Static Public Member Functions

static bool supported ()
 
- Static Public Member Functions inherited from KWin::Effect
static QPointF cursorPos ()
 
static double animationTime (const KConfigGroup &cfg, const QString &key, int defaultTime)
 
static double animationTime (int defaultTime)
 
static double interpolate (double x, double y, double a)
 
static void setPositionTransformations (WindowPaintData &data, QRect &region, EffectWindow *w, const QRect &r, Qt::AspectRatioMode aspect)
 

Additional Inherited Members

- Public Types inherited from KWin::Effect
enum  {
  PAINT_WINDOW_OPAQUE = 1 << 0 , PAINT_WINDOW_TRANSLUCENT = 1 << 1 , PAINT_WINDOW_TRANSFORMED = 1 << 2 , PAINT_SCREEN_REGION = 1 << 3 ,
  PAINT_SCREEN_TRANSFORMED = 1 << 4 , PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS = 1 << 5 , PAINT_SCREEN_BACKGROUND_FIRST = 1 << 6
}
 
enum  Feature {
  Nothing = 0 , ScreenInversion , Blur , Contrast ,
  HighlightWindows
}
 
enum  ReconfigureFlag { ReconfigureAll = 1 << 0 }
 
- Public Slots inherited from KWin::Effect
virtual bool borderActivated (ElectricBorder border)
 

Detailed Description

The CrossFadeEffect class is the base class for effects that paints crossfades

Windows are snapshotted at the time we want to start crossfading from. Hereafter we draw both the new contents and the old pixmap at the ratio defined by WindowPaintData::crossFadeProgress

Subclasses are responsible for driving the animation and calling unredirect after animation completes.

If window geometry changes shape after this point our "old" pixmap is resized to fit approximately matching frame geometry

Definition at line 97 of file offscreeneffect.h.

Constructor & Destructor Documentation

◆ CrossFadeEffect()

KWin::CrossFadeEffect::CrossFadeEffect ( QObject * parent = nullptr)
explicit

Definition at line 296 of file offscreeneffect.cpp.

◆ ~CrossFadeEffect()

KWin::CrossFadeEffect::~CrossFadeEffect ( )
overridedefault

Member Function Documentation

◆ drawWindow()

void KWin::CrossFadeEffect::drawWindow ( const RenderTarget & renderTarget,
const RenderViewport & viewport,
EffectWindow * w,
int mask,
const QRegion & region,
WindowPaintData & data )
overridevirtual

Can be called to draw multiple copies (e.g. thumbnails) of a window. You can change window's opacity/brightness/etc here, but you can't do any transformations.

In OpenGL based compositing, the frameworks ensures that the context is current when this method is invoked.

Reimplemented from KWin::Effect.

Definition at line 304 of file offscreeneffect.cpp.

◆ redirect()

void KWin::CrossFadeEffect::redirect ( EffectWindow * window)

This function must be called when the effect wants to animate the specified window.

Definition at line 354 of file offscreeneffect.cpp.

◆ setShader()

void KWin::CrossFadeEffect::setShader ( EffectWindow * window,
GLShader * shader )

Allows to specify a shader to draw the redirected texture for window. Can only be called once the window is redirected.

Since
5.25

Definition at line 395 of file offscreeneffect.cpp.

◆ supported()

static bool KWin::CrossFadeEffect::supported ( )
static

◆ unredirect()

void KWin::CrossFadeEffect::unredirect ( EffectWindow * window)

This function must be called when the effect is done animating the specified window. The window will be automatically unredirected if it's deleted.

Definition at line 382 of file offscreeneffect.cpp.


The documentation for this class was generated from the following files: