Commit 75365412 authored by Blackbeard (alberto flores)'s avatar Blackbeard (alberto flores) 🚢

Use paintDevice to render brush

parent 30c2f3c9
......@@ -57,7 +57,7 @@ void KisVectorShapeObject::renderImage(int width, int height)
theImage = theImage.convertToFormat(QImage::Format_Indexed8, table);
setBrushTipImage(theImage);
//m_image = theImage;
m_image = theImage;
}
......@@ -66,6 +66,19 @@ QImage KisVectorShapeObject::image()
return brushTipImage();
}
QImage KisVectorShapeObject::brushTipImage() const
{
return m_image;
}
void KisVectorShapeObject::setBrushTipImage(const QImage& image)
{
KisBrush::setBrushTipImage(image);
setValid(true);
}
KoShape* KisVectorShapeObject::shape()
{
......
......@@ -59,6 +59,13 @@ public:
void setShape(KoShape* shape);
/**
* @return a preview of the brush
*/
QImage brushTipImage() const override;
QImage image();
KoShape* shape();
void renderImage(int width, int weight);
......@@ -67,8 +74,12 @@ public:
private:
protected:
void setBrushTipImage(const QImage& image) override;
private:
KoShape* m_shape;
QImage m_image;
};
......
......@@ -295,27 +295,12 @@ QImage KisVectorAnimatedBrush::brushTipImage() const
return image;
}
*/
/*
KisFixedPaintDeviceSP KisVectorAnimatedBrush::paintDevice(const KoColorSpace *colorSpace,
const KisDabShape &,
const KisPaintInformation &info,
double subPixelX, double subPixelY) const
KisFixedPaintDeviceSP KisVectorAnimatedBrush::paintDevice(
const KoColorSpace * colorSpace,
KisDabShape const& shape,
const KisPaintInformation& info, double subPixelX, double subPixelY) const
{
Q_ASSERT(valid());
// Q_UNUSED(info)
Q_UNUSED(subPixelX)
Q_UNUSED(subPixelY)
QImage outputImage = m_parasite.nextBrushTip();
KisFixedPaintDeviceSP dab = new KisFixedPaintDevice(colorSpace);
Q_CHECK_PTR(dab);
dab->convertFromQImage(outputImage, "");
// KisVectorAnimatedBrush::notifyCachedDabPainted(info)
return dab;
return m_d->brushesPipe.paintDevice(colorSpace, shape, info, subPixelX, subPixelY);
}
*/
......@@ -28,6 +28,9 @@
#include <kis_vectorbrush_parasite.h>
#include <KisVectorShapeObject.h>
#include <resources/KoResource.h>
#include "kis_global.h"
//
......@@ -64,12 +67,12 @@ public:
// QImage brushTipImage() const override;
// Asks for the new image
/*
KisFixedPaintDeviceSP paintDevice(const KoColorSpace * colorSpace,
KisDabShape const&,
const KisPaintInformation& info,
double subPixelX = 0, double subPixelY = 0) const override;
*/
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment