本文整理汇总了C++中KisPaintDeviceSP::setDirty方法的典型用法代码示例。如果您正苦于以下问题:C++ KisPaintDeviceSP::setDirty方法的具体用法?C++ KisPaintDeviceSP::setDirty怎么用?C++ KisPaintDeviceSP::setDirty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KisPaintDeviceSP
的用法示例。
在下文中一共展示了KisPaintDeviceSP::setDirty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paint
KUndo2Command* paint() {
KisPainter gc(m_dst, m_sel);
gc.beginTransaction("");
gc.bitBlt(m_rc.x(), m_rc.y(),
m_src,
m_rc.x(), m_rc.y(),
m_rc.width(), m_rc.height());
m_dst->setDirty(m_rc);
return gc.endAndTakeTransaction();
}
示例2: clearSelection
void TransformStrokeStrategy::clearSelection(KisPaintDeviceSP device)
{
KisTransaction transaction(device);
if (m_selection) {
device->clearSelection(m_selection);
} else {
QRect oldExtent = device->extent();
device->clear();
device->setDirty(oldExtent);
}
runAndSaveCommand(KUndo2CommandSP(transaction.endAndTake()),
KisStrokeJobData::SEQUENTIAL,
KisStrokeJobData::NORMAL);
}
示例3: benchmarkExactBoundsNullDefaultPixel
void KisPaintDeviceTest::benchmarkExactBoundsNullDefaultPixel()
{
const KoColorSpace *cs = KoColorSpaceRegistry::instance()->rgb8();
KisPaintDeviceSP dev = new KisPaintDevice(cs);
QVERIFY(dev->exactBounds().isEmpty());
QRect fillRect(60,60, 1930, 1930);
dev->fill(fillRect, KoColor(Qt::white, cs));
QRect measuredRect;
QBENCHMARK {
// invalidate the cache
dev->setDirty();
measuredRect = dev->exactBounds();
}
QCOMPARE(measuredRect, fillRect);
}
示例4: mirrorMask
bool KisMirrorVisitor::mirrorMask(KisMask* mask)
{
KoProperties properties;
KisSelectionSP selection = mask->selection();
if (selection->hasPixelSelection()) {
KisPaintDeviceSP dev = selection->pixelSelection();
QString name;
if (m_orientation == Qt::Horizontal) {
name = i18n("Mirror Mask X");
} else {
name = i18n("Mirror Mask Y");
}
// TODO: use a selection transaction to cache the outline
KisTransaction transaction(name, dev);
QRect dirty;
if (m_orientation == Qt::Horizontal) {
dirty = KisTransformWorker::mirrorX(dev, m_image->width()/2.0f);
} else {
dirty = KisTransformWorker::mirrorY(dev, m_image->height()/2.0f);
}
mask->setDirty(dirty);
transaction.commit(m_image->undoAdapter());
dev->setDirty(dirty);
}
/* TODO: Doesn't work correctly even thoush it's the same code as the shape layer
if (selection->hasShapeSelection()) {
if (m_orientation == Qt::Horizontal) {
KisTransformVisitor visitor(m_image, -1.0, 1.0, 0.0, 0.0, 0.0, m_image->width(), 0, 0, 0, true);
mask->accept(visitor);
} else {
KisTransformVisitor visitor(m_image, 1.0, -1.0, 0.0, 0.0, 0.0, 0, m_image->height(), 0, 0, true);
mask->accept(visitor);
}
} */
selection->updateProjection();
return true;
}