10#include <QMutexLocker>
30#include <QApplication>
53 , m_viewConverter(rhs.m_viewConverter)
139 , m_parentLayer(parent)
156 , m_parentLayer(parent)
232 dbg <<
"KisRepaintShapeLayerLayerJob" <<
m_layer;
258 Q_FOREACH (
const QRectF &rc, region) {
293 QRect uncroppedRepaintRect;
294 bool forceUpdateHiddenAreasOnly =
false;
295 const qint32 MASK_IMAGE_WIDTH = 256;
296 const qint32 MASK_IMAGE_HEIGHT = 256;
315 if (!forceUpdateHiddenAreasOnly) {
316 if (repaintRect.isEmpty()) {
322 uncroppedRepaintRect = repaintRect;
323 repaintRect = repaintRect.intersected(image->
bounds());
327 uncroppedRepaintRect = repaintRect;
360 QSize(MASK_IMAGE_WIDTH, MASK_IMAGE_HEIGHT));
363 Q_FOREACH (
const QRect &viewUpdateRect, updateRects) {
386 QRegion dirtyCacheRegion;
392 auto rc = dirtyCacheRegion.begin();
393 while (rc != dirtyCacheRegion.end()) {
416 if (paintJobsOrder.
isEmpty())
return;
418 const qint32 MASK_IMAGE_WIDTH = 256;
419 const qint32 MASK_IMAGE_HEIGHT = 256;
421 QImage image(MASK_IMAGE_WIDTH, MASK_IMAGE_HEIGHT, QImage::Format_ARGB32);
422 QPainter tempPainter(&image);
425 tempPainter.setRenderHint(QPainter::Antialiasing);
426 tempPainter.setRenderHint(QPainter::TextAntialiasing);
447 tempPainter.setTransform(QTransform());
455 const quint8 *imagePtr = image.constBits();
456 const int imageRowStride = 4 * image.width();
472 imagePtr += imageRowStride;
477 MASK_IMAGE_WIDTH * MASK_IMAGE_HEIGHT,
537 Q_UNUSED(colorSpace);
541 Q_FOREACH (
const KoShape* shape, shapes) {
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
void setImage(KisImageWSP image)
const KoColorSpace * colorSpace() const
QRect bounds() const override
void addSpontaneousJob(KisSpontaneousJob *spontaneousJob)
quint32 pixelSize() const
void setDefaultBounds(KisDefaultBoundsBaseSP bounds)
void purgeDefaultPixels()
const KoColorSpace * colorSpace() const
void setParentNode(KisNodeWSP parent)
void convertTo(const KoColorSpace *dstColorSpace, KoColorConversionTransformation::Intent renderingIntent=KoColorConversionTransformation::internalRenderingIntent(), KoColorConversionTransformation::ConversionFlags conversionFlags=KoColorConversionTransformation::internalConversionFlags(), KUndo2Command *parentCommand=nullptr, KoUpdater *progressUpdater=nullptr)
void writeBytes(const quint8 *data, qint32 x, qint32 y, qint32 w, qint32 h)
KisRepaintShapeLayerLayerJob(KisShapeLayerSP layer, KisShapeLayerCanvas *canvas)
bool overrides(const KisSpontaneousJob *_otherJob) override
KisShapeLayerCanvas * m_canvas
QString debugName() const override
int levelOfDetail() const override
QScopedPointer< KoSelectedShapesProxy > m_selectedShapesProxy
KisShapeLayerCanvasBase(KisShapeLayer *parent)
void gridSize(QPointF *offset, QSizeF *spacing) const override
const KoViewConverter * viewConverter() const override
bool m_hasChangedWhileBeingInvisible
virtual void setImage(KisImageWSP image)
KoToolProxy * toolProxy() const override
KoUnit unit() const override
bool snapToGrid() const override
KisImageViewConverter m_viewConverter
void prepareForDestroying()
bool hasChangedWhileBeingInvisible()
QScopedPointer< KoShapeManager > m_shapeManager
QWidget * canvasWidget() override
KoShapeManager * shapeManager() const override
KoSelectedShapesProxy * selectedShapesProxy() const override
selectedShapesProxy() is a special interface for keeping a persistent connections to selectionChanged...
void addCommand(KUndo2Command *command) override
void slotStartAsyncRepaint()
QMutex m_dirtyRegionMutex
bool hasPendingUpdates() const override
~KisShapeLayerCanvas() override
void forceRepaintWithHiddenAreas() override
void setProjection(KisPaintDeviceSP projection)
This canvas won't render onto a widget, but a projection.
bool m_forceUpdateHiddenAreasOnly
friend class KisRepaintShapeLayerLayerJob
KisSignalAutoConnectionsStore m_imageConnections
KoShapeManager::PaintJobsOrder m_paintJobsOrder
bool m_hasUpdateOnSetImage
void setImage(KisImageWSP image) override
KisPaintDeviceSP projection() const override
KisPaintDeviceSP m_projection
void rerenderAfterBeingInvisible() override
KisSafeBlockingQueueConnectionProxy< void > m_safeForcedConnection
KisShapeLayer * m_parentLayer
KisThreadSafeSignalCompressor m_asyncUpdateSignalCompressor
KisShapeLayerCanvas(const KoColorSpace *cs, KisDefaultBoundsBaseSP defaultBounds, KisShapeLayer *parent)
volatile bool m_hasUpdateInCompressor
void forceRepaint() override
void resetCache(const KoColorSpace *colorSpace=0) override
void updateCanvas(const QRectF &rc) override
void slotImageSizeChanged()
bool visible(bool recursive=false) const override
void addUniqueConnection(Sender sender, Signal signal, Receiver receiver, Method method)
virtual QPointF viewToDocument(const QPointF &viewPoint) const
virtual bool convertPixelsTo(const quint8 *src, quint8 *dst, const KoColorSpace *dstColorSpace, quint32 numPixels, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) const
The KoSelectedShapesProxy class is a special interface of KoCanvasBase to have a stable connection to...
@ AddWithoutRepaint
Avoids each shapes 'update()' to be called for faster addition when its possible.
virtual QRectF boundingRect() const
Get the bounding box of the shape.
virtual void update() const
@ Point
Postscript point, 1/72th of an Inco.
virtual QPointF documentToView(const QPointF &documentPoint) const
#define KIS_SAFE_ASSERT_RECOVER(cond)
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
T kisGrowRect(const T &rect, U offset)
QVector< QRect > splitRectIntoPatchesTight(const QRect &rc, const QSize &patchSize)
static KoColorSpaceRegistry * instance()
const KoColorSpace * rgb8(const QString &profileName=QString())
QRect uncroppedViewUpdateRect