From f191efb39e0fdbb71651668146fbcd03c2b67dcc Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 5 Dec 2022 14:29:03 +0200 Subject: [PATCH] backends/drm: outputLayer -> primaryLayer It makes terminology consistent. --- src/backends/drm/drm_abstract_output.h | 2 +- src/backends/drm/drm_egl_backend.cpp | 4 ++-- src/backends/drm/drm_gpu.cpp | 2 +- src/backends/drm/drm_output.cpp | 2 +- src/backends/drm/drm_output.h | 2 +- src/backends/drm/drm_qpainter_backend.cpp | 2 +- src/backends/drm/drm_virtual_output.cpp | 2 +- src/backends/drm/drm_virtual_output.h | 2 +- src/composite.cpp | 16 ++++++++-------- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/backends/drm/drm_abstract_output.h b/src/backends/drm/drm_abstract_output.h index 8a39413a49..18c9575325 100644 --- a/src/backends/drm/drm_abstract_output.h +++ b/src/backends/drm/drm_abstract_output.h @@ -30,7 +30,7 @@ public: DrmGpu *gpu() const; virtual bool present() = 0; - virtual DrmOutputLayer *outputLayer() const = 0; + virtual DrmOutputLayer *primaryLayer() const = 0; void updateEnabled(bool enabled); diff --git a/src/backends/drm/drm_egl_backend.cpp b/src/backends/drm/drm_egl_backend.cpp index 270f9e2194..8e7c488ab2 100644 --- a/src/backends/drm/drm_egl_backend.cpp +++ b/src/backends/drm/drm_egl_backend.cpp @@ -208,13 +208,13 @@ void EglGbmBackend::present(Output *output) OutputLayer *EglGbmBackend::primaryLayer(Output *output) { - return static_cast(output)->outputLayer(); + return static_cast(output)->primaryLayer(); } std::shared_ptr EglGbmBackend::textureForOutput(Output *output) const { const auto drmOutput = static_cast(output); - return static_cast(drmOutput->outputLayer())->texture(); + return static_cast(drmOutput->primaryLayer())->texture(); } std::optional EglGbmBackend::gbmFormatForDrmFormat(uint32_t format) const diff --git a/src/backends/drm/drm_gpu.cpp b/src/backends/drm/drm_gpu.cpp index 7927ecda0b..5e83d36b36 100644 --- a/src/backends/drm/drm_gpu.cpp +++ b/src/backends/drm/drm_gpu.cpp @@ -767,7 +767,7 @@ void DrmGpu::releaseBuffers() pipeline->cursorLayer()->releaseBuffers(); } for (const auto &output : std::as_const(m_virtualOutputs)) { - output->outputLayer()->releaseBuffers(); + output->primaryLayer()->releaseBuffers(); } } diff --git a/src/backends/drm/drm_output.cpp b/src/backends/drm/drm_output.cpp index 4366db32cd..9801e538cc 100644 --- a/src/backends/drm/drm_output.cpp +++ b/src/backends/drm/drm_output.cpp @@ -453,7 +453,7 @@ bool DrmOutput::usesSoftwareCursor() const return !m_setCursorSuccessful || !m_moveCursorSuccessful; } -DrmOutputLayer *DrmOutput::outputLayer() const +DrmOutputLayer *DrmOutput::primaryLayer() const { return m_pipeline->primaryLayer(); } diff --git a/src/backends/drm/drm_output.h b/src/backends/drm/drm_output.h index 174358a40a..ffb6e16fbc 100644 --- a/src/backends/drm/drm_output.h +++ b/src/backends/drm/drm_output.h @@ -42,7 +42,7 @@ public: DrmPipeline *pipeline() const; bool present() override; - DrmOutputLayer *outputLayer() const override; + DrmOutputLayer *primaryLayer() const override; bool queueChanges(const OutputConfiguration &config); void applyQueuedChanges(const OutputConfiguration &config); diff --git a/src/backends/drm/drm_qpainter_backend.cpp b/src/backends/drm/drm_qpainter_backend.cpp index 9b41ad5292..72e3d51348 100644 --- a/src/backends/drm/drm_qpainter_backend.cpp +++ b/src/backends/drm/drm_qpainter_backend.cpp @@ -41,7 +41,7 @@ void DrmQPainterBackend::present(Output *output) OutputLayer *DrmQPainterBackend::primaryLayer(Output *output) { - return static_cast(output)->outputLayer(); + return static_cast(output)->primaryLayer(); } std::shared_ptr DrmQPainterBackend::createPrimaryLayer(DrmPipeline *pipeline) diff --git a/src/backends/drm/drm_virtual_output.cpp b/src/backends/drm/drm_virtual_output.cpp index f6c24641aa..edcf3f7c31 100644 --- a/src/backends/drm/drm_virtual_output.cpp +++ b/src/backends/drm/drm_virtual_output.cpp @@ -69,7 +69,7 @@ void DrmVirtualOutput::setDpmsMode(DpmsMode mode) setState(next); } -DrmOutputLayer *DrmVirtualOutput::outputLayer() const +DrmOutputLayer *DrmVirtualOutput::primaryLayer() const { return m_layer.get(); } diff --git a/src/backends/drm/drm_virtual_output.h b/src/backends/drm/drm_virtual_output.h index b19a6db8c1..ea740a27a2 100644 --- a/src/backends/drm/drm_virtual_output.h +++ b/src/backends/drm/drm_virtual_output.h @@ -30,7 +30,7 @@ public: ~DrmVirtualOutput() override; bool present() override; - DrmOutputLayer *outputLayer() const override; + DrmOutputLayer *primaryLayer() const override; void recreateSurface(); private: diff --git a/src/composite.cpp b/src/composite.cpp index c037a28a5c..f4c04f61e8 100644 --- a/src/composite.cpp +++ b/src/composite.cpp @@ -615,12 +615,12 @@ void Compositor::composite(RenderLoop *renderLoop) } Output *output = findOutput(renderLoop); - OutputLayer *outputLayer = m_backend->primaryLayer(output); + OutputLayer *primaryLayer = m_backend->primaryLayer(output); fTraceDuration("Paint (", output->name(), ")"); RenderLayer *superLayer = m_superlayers[renderLoop]; prePaintPass(superLayer); - superLayer->setOutputLayer(outputLayer); + superLayer->setOutputLayer(primaryLayer); SurfaceItem *scanoutCandidate = superLayer->delegate()->scanoutCandidate(); renderLoop->setFullscreenSurface(scanoutCandidate); @@ -634,24 +634,24 @@ void Compositor::composite(RenderLoop *renderLoop) return sublayer->isVisible(); }); if (scanoutPossible && !output->directScanoutInhibited()) { - directScanout = outputLayer->scanout(scanoutCandidate); + directScanout = primaryLayer->scanout(scanoutCandidate); } } if (!directScanout) { - QRegion surfaceDamage = outputLayer->repaints(); - outputLayer->resetRepaints(); + QRegion surfaceDamage = primaryLayer->repaints(); + primaryLayer->resetRepaints(); preparePaintPass(superLayer, &surfaceDamage); - if (auto beginInfo = outputLayer->beginFrame()) { + if (auto beginInfo = primaryLayer->beginFrame()) { auto &[renderTarget, repaint] = beginInfo.value(); renderTarget.setDevicePixelRatio(output->scale()); const QRegion bufferDamage = surfaceDamage.united(repaint).intersected(superLayer->rect()); - outputLayer->aboutToStartPainting(bufferDamage); + primaryLayer->aboutToStartPainting(bufferDamage); paintPass(superLayer, &renderTarget, bufferDamage); - outputLayer->endFrame(bufferDamage, surfaceDamage); + primaryLayer->endFrame(bufferDamage, surfaceDamage); } } renderLoop->endFrame();