|
Krita Source Code Documentation
|
#include <KisRepaintDebugger.h>
Public Member Functions | |
| KisRepaintDebugger ()=default | |
| void | paint (QPaintDevice *paintDevice, const QPaintEvent *event) |
| void | paint (QPaintDevice *paintDevice, const QRect &widgetRect) |
| void | paint (QPaintDevice *paintDevice, const QVector< QRect > &widgetRects) |
| void | paintFull (QPaintDevice *paintDevice) |
| ~KisRepaintDebugger ()=default | |
Static Public Member Functions | |
| static bool | enabled () |
Private Member Functions | |
| void | paint (QPaintDevice *paintDevice, const QRect *widgetRects, size_t count) |
Private Attributes | |
| unsigned int | m_colorIndex {0} |
A utility class to aid debugging widget or surface redraws. It lets you paint out the update rects and makes it obvious by cycling between colors with sharp contrast for each paint. This class is controlled globally by the environment variable KRITA_DEBUG_REPAINT. KisRepaintDebugger will only work when this environment variable is set to 1.
For optimal effect, one of the paint methods shall be called at the end of the paintEvent, after all the custom painting. If a QPainter has been instantiated at the topmost function scope, you must explicitly call end() on it to release the paint device so that KisRepaintDebugger can use it.
This class is stateful, so it shall be kept as a class member object and reused.
Seizure Warning: Enabling repaint debug will produce heavy flashing visuals. This may potentially trigger seizures for people with photosensitive epilepsy.
Definition at line 36 of file KisRepaintDebugger.h.
|
default |
|
default |
|
static |
Whether KisRepaintDebugger is enabled globally. This is controlled by the environment variable KRITA_DEBUG_REPAINT.
Definition at line 19 of file KisRepaintDebugger.cpp.
References enabled().
| void KisRepaintDebugger::paint | ( | QPaintDevice * | paintDevice, |
| const QPaintEvent * | event ) |
Definition at line 35 of file KisRepaintDebugger.cpp.
References paint().
| void KisRepaintDebugger::paint | ( | QPaintDevice * | paintDevice, |
| const QRect & | widgetRect ) |
Definition at line 25 of file KisRepaintDebugger.cpp.
References paint().
|
private |
Definition at line 50 of file KisRepaintDebugger.cpp.
References ALPHA, enabled(), and m_colorIndex.
Definition at line 30 of file KisRepaintDebugger.cpp.
References paint().
| void KisRepaintDebugger::paintFull | ( | QPaintDevice * | paintDevice | ) |
Definition at line 40 of file KisRepaintDebugger.cpp.
|
private |
Definition at line 57 of file KisRepaintDebugger.h.