本文整理汇总了C++中KisPaintDeviceSP::createCompositionSourceDevice方法的典型用法代码示例。如果您正苦于以下问题:C++ KisPaintDeviceSP::createCompositionSourceDevice方法的具体用法?C++ KisPaintDeviceSP::createCompositionSourceDevice怎么用?C++ KisPaintDeviceSP::createCompositionSourceDevice使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KisPaintDeviceSP
的用法示例。
在下文中一共展示了KisPaintDeviceSP::createCompositionSourceDevice方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createDeviceCache
KisPaintDeviceSP TransformStrokeStrategy::createDeviceCache(KisPaintDeviceSP dev)
{
KisPaintDeviceSP cache;
if (m_selection) {
QRect srcRect = m_selection->selectedExactRect();
cache = dev->createCompositionSourceDevice();
KisPainter gc(cache);
gc.setSelection(m_selection);
gc.bitBlt(srcRect.topLeft(), dev, srcRect);
} else {
cache = dev->createCompositionSourceDevice(dev);
}
return cache;
}
示例2: initStrokeCallback
void KisFilterStrokeStrategy::initStrokeCallback()
{
KisPainterBasedStrokeStrategy::initStrokeCallback();
KisPaintDeviceSP dev = targetDevice();
if (activeSelection() ||
(dev->colorSpace() != dev->compositionSourceColorSpace() &&
!(dev->colorSpace() == dev->compositionSourceColorSpace()))) {
m_d->filterDevice = dev->createCompositionSourceDevice(dev);
m_d->secondaryTransaction = new KisTransaction("", m_d->filterDevice);
} else {
m_d->filterDevice = dev;
}
}
示例3: visitNodeWithPaintDevice
void FillProcessingVisitor::visitNodeWithPaintDevice(KisNode *node, KisUndoAdapter *undoAdapter)
{
KisPaintDeviceSP device = node->paintDevice();
Q_ASSERT(device);
ProgressHelper helper(node);
QRect fillRect = m_resources->image()->bounds();
if (!device->defaultBounds()->wrapAroundMode() &&
!fillRect.contains(m_startPoint)) {
return;
}
if (m_selectionOnly) {
KisPaintDeviceSP filledDevice = device->createCompositionSourceDevice();
KisFillPainter fillPainter(filledDevice);
fillPainter.setProgress(helper.updater());
if (m_usePattern) {
fillPainter.fillRect(fillRect, m_resources->currentPattern());
} else if (m_useBgColor) {
fillPainter.fillRect(fillRect,
m_resources->currentBgColor(),
m_resources->opacity());
} else {
fillPainter.fillRect(fillRect,
m_resources->currentFgColor(),
m_resources->opacity());
}
QVector<QRect> dirtyRect = fillPainter.takeDirtyRegion();
KisPainter painter(device, m_selection);
painter.beginTransaction();
m_resources->setupPainter(&painter);
foreach(const QRect &rc, dirtyRect) {
painter.bitBlt(rc.topLeft(), filledDevice, rc);
}
painter.endTransaction(undoAdapter);
} else {