当前位置: 首页>>代码示例>>C++>>正文


C++ KisPaintDeviceSP::setDirty方法代码示例

本文整理汇总了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();
 }
开发者ID:abhishekmurthy,项目名称:Calligra,代码行数:10,代码来源:kis_selection_action_factories.cpp

示例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);
}
开发者ID:ChrisJong,项目名称:krita,代码行数:14,代码来源:transform_stroke_strategy.cpp

示例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);
}
开发者ID:,项目名称:,代码行数:21,代码来源:

示例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;
}
开发者ID:crayonink,项目名称:calligra-2,代码行数:40,代码来源:kis_mirror_visitor.cpp


注:本文中的KisPaintDeviceSP::setDirty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。