Пример #1
0
bool SkDeferredCanvas::DeferredDevice::onReadPixels(
    const SkBitmap& bitmap, int x, int y, SkCanvas::Config8888 config8888)
{
    flushPending();
    return fImmediateCanvas->readPixels(const_cast<SkBitmap*>(&bitmap),
                                                   x, y, config8888);
}
void SkDeferredCanvas::DeferredDevice::flushIfNeeded(const SkBitmap& bitmap) {
    if (bitmap.isImmutable()) {
        return; // safe to deffer without registering a dependency
    }

    // For now, drawing a writable bitmap triggers a flush
    // TODO: implement read-only semantics and auto buffer duplication on write
    // in SkBitmap/SkPixelRef, which will make deferral possible in this case.
    flushPending();
}
Пример #3
0
GDBOutputWidget::GDBOutputWidget( QWidget *parent, const char *name) :
    QWidget(parent, name),
    m_userGDBCmdEditor(0),
    m_Interrupt(0),
    m_gdbView(0),
    showInternalCommands_(false),
    maxLines_(5000)
{

    m_gdbView = new OutputText(this);
    m_gdbView->setTextFormat(QTextEdit::LogText);

    QBoxLayout *userGDBCmdEntry = new QHBoxLayout();
    m_userGDBCmdEditor = new KHistoryCombo (this, "gdb-user-cmd-editor");

    QLabel *label = new QLabel(i18n("&GDB cmd:"), this);
    label->setBuddy(m_userGDBCmdEditor);
    userGDBCmdEntry->addWidget(label);

    userGDBCmdEntry->addWidget(m_userGDBCmdEditor);
    userGDBCmdEntry->setStretchFactor(m_userGDBCmdEditor, 1);

    m_Interrupt = new QToolButton( this, "add breakpoint" );
    m_Interrupt->setSizePolicy ( QSizePolicy ( (QSizePolicy::SizeType)0,
                                 ( QSizePolicy::SizeType)0,
                                 0,
                                 0,
                                 m_Interrupt->sizePolicy().hasHeightForWidth())
                               );
    m_Interrupt->setPixmap ( SmallIcon ( "player_pause" ) );
    userGDBCmdEntry->addWidget(m_Interrupt);
    QToolTip::add ( m_Interrupt, i18n ( "Pause execution of the app to enter gdb commands" ) );

    QVBoxLayout *topLayout = new QVBoxLayout(this, 2);
    topLayout->addWidget(m_gdbView, 10);
    topLayout->addLayout(userGDBCmdEntry);

    slotDbgStatus( "", s_dbgNotStarted);

    connect( m_userGDBCmdEditor, SIGNAL(returnPressed()), SLOT(slotGDBCmd()) );
    connect( m_Interrupt,        SIGNAL(clicked()),       SIGNAL(breakInto()));

    connect( &updateTimer_, SIGNAL(timeout()),
             this,  SLOT(flushPending()));
}
void SkDeferredCanvas::DeferredDevice::writePixels(const SkBitmap& bitmap,
        int x, int y, SkCanvas::Config8888 config8888) {

    if (x <= 0 && y <= 0 && (x + bitmap.width()) >= width() &&
            (y + bitmap.height()) >= height()) {
        contentsCleared();
    }

    if (SkBitmap::kARGB_8888_Config == bitmap.config() &&
            SkCanvas::kNative_Premul_Config8888 != config8888 &&
            kPMColorAlias != config8888) {
        //Special case config: no deferral
        flushPending();
        fImmediateDevice->writePixels(bitmap, x, y, config8888);
    }

    SkPaint paint;
    paint.setXfermodeMode(SkXfermode::kSrc_Mode);
    fRecordingCanvas->drawSprite(bitmap, x, y, &paint);
    flushIfNeeded(bitmap);
}
const SkBitmap& SkDeferredCanvas::DeferredDevice::onAccessBitmap(SkBitmap*) {
    flushPending();
    return fImmediateDevice->accessBitmap(false);
}
SkGpuRenderTarget* SkDeferredCanvas::DeferredDevice::accessRenderTarget() {
    flushPending();
    return fImmediateDevice->accessRenderTarget();
}
void SkDeferredCanvas::DeferredDevice::flush() {
    flushPending();
    fImmediateCanvas->flush();
}
Пример #8
0
void SkDeferredCanvas::DeferredDevice::onAccessBitmap(SkBitmap* bitmap)
{
    SkASSERT(bitmap);
    flushPending();
}
Пример #9
0
GDBOutputWidget::GDBOutputWidget(CppDebuggerPlugin* plugin, QWidget *parent) :
    QWidget(parent),
    m_userGDBCmdEditor(0),
    m_Interrupt(0),
    m_gdbView(0),
    showInternalCommands_(false),
    maxLines_(5000)
{
//     setWindowIcon(KIcon("inline_image"));
    setWindowIcon(KIcon("debugger"));
    setWindowTitle(i18n("GDB Output"));
    setWhatsThis(i18n("<b>GDB output</b><p>"
                    "Shows all gdb commands being executed. "
                    "You can also issue any other gdb command while debugging.</p>"));

    m_gdbView = new OutputTextEdit(this);
    m_gdbView->setReadOnly(true);

    m_userGDBCmdEditor = new KHistoryComboBox (this);

    QLabel *label = new QLabel(i18n("&GDB cmd:"), this);
    label->setBuddy(m_userGDBCmdEditor);

    m_Interrupt = new QToolButton( this );
    m_Interrupt->setIcon ( KIcon ( "media-playback-pause" ) );
    m_Interrupt->setToolTip( i18n ( "Pause execution of the app to enter gdb commands" ) );

    QVBoxLayout *topLayout = new QVBoxLayout(this);
    topLayout->addWidget(m_gdbView);
    topLayout->setStretchFactor(m_gdbView, 1);
    topLayout->setMargin(0);

    QBoxLayout *userGDBCmdEntry = new QHBoxLayout();
    userGDBCmdEntry->addWidget(label);
    userGDBCmdEntry->addWidget(m_userGDBCmdEditor);
    userGDBCmdEntry->setStretchFactor(m_userGDBCmdEditor, 1);
    userGDBCmdEntry->addWidget(m_Interrupt);
    topLayout->addLayout(userGDBCmdEntry);

    setLayout(topLayout);

    slotStateChanged(s_none, s_dbgNotStarted);

    connect( m_userGDBCmdEditor, SIGNAL(returnPressed()), SLOT(slotGDBCmd()) );
    connect( m_Interrupt,        SIGNAL(clicked()),       SIGNAL(breakInto()));

    updateTimer_.setSingleShot(true);
    connect( &updateTimer_, SIGNAL(timeout()),
             this,  SLOT(flushPending()));

    connect(KDevelop::ICore::self()->debugController(), 
            SIGNAL(currentSessionChanged(KDevelop::IDebugSession*)),
            SLOT(currentSessionChanged(KDevelop::IDebugSession*)));

    connect(plugin, SIGNAL(reset()), this, SLOT(clear()));
    connect(plugin, SIGNAL(raiseGdbConsoleViews()), SIGNAL(requestRaise()));

    currentSessionChanged(KDevelop::ICore::self()->debugController()->currentSession());

    connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()),
            this, SLOT(updateColors()));
    updateColors();

}