예제 #1
0
void InspectorPageAgent::setShowScrollBottleneckRects(ErrorString* errorString, bool show)
{
    m_state->setBoolean(PageAgentState::pageAgentShowScrollBottleneckRects, show);
    if (show && !compositingEnabled(errorString))
        return;
    m_client->setShowScrollBottleneckRects(show);
}
예제 #2
0
void InspectorPageAgent::setContinuousPaintingEnabled(ErrorString* errorString, bool enabled)
{
    m_state->setBoolean(PageAgentState::pageAgentContinuousPaintingEnabled, enabled);
    if (enabled && !compositingEnabled(errorString))
        return;
    m_client->setContinuousPaintingEnabled(enabled && !m_deviceMetricsOverridden);
}
예제 #3
0
void InspectorPageAgent::setShowDebugBorders(ErrorString* errorString, bool show)
{
    m_state->setBoolean(PageAgentState::pageAgentShowDebugBorders, show);
    if (show && !compositingEnabled(errorString))
        return;
    m_client->setShowDebugBorders(show);
}
예제 #4
0
파일: compositing.cpp 프로젝트: 8l/kwin
void Compositing::save()
{
    KConfigGroup kwinConfig(KSharedConfig::openConfig(QStringLiteral("kwinrc")), "Compositing");
    kwinConfig.writeEntry("AnimationSpeed", animationSpeed());
    kwinConfig.writeEntry("HiddenPreviews", windowThumbnail() + 4);
    kwinConfig.writeEntry("GLTextureFilter", glScaleFilter());
    kwinConfig.writeEntry("XRenderSmoothScale", xrScaleFilter());
    kwinConfig.writeEntry("UnredirectFullscreen", unredirectFullscreen());
    kwinConfig.writeEntry("Enabled", compositingEnabled());
    auto swapStrategy = [this] {
        switch (glSwapStrategy()) {
            case 0:
                return QStringLiteral("n");
            case 2:
                return QStringLiteral("e");
            case 3:
                return QStringLiteral("p");
            case 4:
                return QStringLiteral("c");
            case 1:
            default:
                return QStringLiteral("a");
        }
    };
    kwinConfig.writeEntry("GLPreferBufferSwap", swapStrategy());
    kwinConfig.writeEntry("GLColorCorrection", glColorCorrection());
    QString backend;
    bool glCore = false;
    switch (compositingType()) {
    case CompositingType::OPENGL31_INDEX:
        backend = "OpenGL";
        glCore = true;
        break;
    case CompositingType::OPENGL20_INDEX:
        backend = "OpenGL";
        glCore = false;
        break;
    case CompositingType::XRENDER_INDEX:
        backend = "XRender";
        glCore = false;
        break;
    }
    kwinConfig.writeEntry("Backend", backend);
    kwinConfig.writeEntry("GLCore", glCore);
    const QModelIndex glIndex = m_openGLPlatformInterfaceModel->index(m_openGLPlatformInterface);
    if (glIndex.isValid()) {
        kwinConfig.writeEntry("GLPlatformInterface", glIndex.data(Qt::UserRole).toString());
    }
    kwinConfig.sync();

    if (m_changed) {
        // Send signal to all kwin instances
        QDBusMessage message = QDBusMessage::createSignal(QStringLiteral("/Compositor"),
                                                          QStringLiteral("org.kde.kwin.Compositing"),
                                                          QStringLiteral("reinit"));
        QDBusConnection::sessionBus().send(message);
        m_changed = false;
    }
}
예제 #5
0
void InspectorPageAgent::setShowFPSCounter(ErrorString* errorString, bool show)
{
    // FIXME: allow metrics override, fps counter and continuous painting at the same time: crbug.com/299837.
    m_state->setBoolean(PageAgentState::pageAgentShowFPSCounter, show);
    if (show && !compositingEnabled(errorString))
        return;
    m_client->setShowFPSCounter(show && !m_deviceMetricsOverridden);
}