Changeset View
Changeset View
Standalone View
Standalone View
scene.cpp
Show First 20 Lines • Show All 838 Lines • ▼ Show 20 Line(s) | 838 | { | |||
---|---|---|---|---|---|
839 | disable_painting |= reason; | 839 | disable_painting |= reason; | ||
840 | } | 840 | } | ||
841 | 841 | | |||
842 | WindowQuadList Scene::Window::buildQuads(bool force) const | 842 | WindowQuadList Scene::Window::buildQuads(bool force) const | ||
843 | { | 843 | { | ||
844 | if (cached_quad_list != nullptr && !force) | 844 | if (cached_quad_list != nullptr && !force) | ||
845 | return *cached_quad_list; | 845 | return *cached_quad_list; | ||
846 | WindowQuadList ret; | 846 | WindowQuadList ret; | ||
847 | qreal scale = 1.0; | 847 | | ||
848 | if (toplevel->surface()) { | 848 | const qreal scale = toplevel->bufferScale(); | ||
849 | scale = toplevel->surface()->scale(); | | |||
850 | } | | |||
851 | 849 | | |||
852 | if (toplevel->clientPos() == QPoint(0, 0) && toplevel->clientSize() == toplevel->decorationRect().size()) | 850 | if (toplevel->clientPos() == QPoint(0, 0) && toplevel->clientSize() == toplevel->decorationRect().size()) | ||
853 | ret = makeQuads(WindowQuadContents, shape(), QPoint(0,0), scale); // has no decoration | 851 | ret = makeQuads(WindowQuadContents, shape(), QPoint(0,0), scale); // has no decoration | ||
854 | else { | 852 | else { | ||
855 | AbstractClient *client = dynamic_cast<AbstractClient*>(toplevel); | 853 | AbstractClient *client = dynamic_cast<AbstractClient*>(toplevel); | ||
856 | QRegion contents = clientShape(); | 854 | QRegion contents = clientShape(); | ||
857 | QRegion center = toplevel->transparentRect(); | 855 | QRegion center = toplevel->transparentRect(); | ||
858 | QRegion decoration = (client ? QRegion(client->decorationRect()) : shape()) - center; | 856 | QRegion decoration = (client ? QRegion(client->decorationRect()) : shape()) - center; | ||
▲ Show 20 Lines • Show All 195 Lines • ▼ Show 20 Line(s) | |||||
1054 | WindowPixmap *WindowPixmap::createChild(const QPointer<KWayland::Server::SubSurfaceInterface> &subSurface) | 1052 | WindowPixmap *WindowPixmap::createChild(const QPointer<KWayland::Server::SubSurfaceInterface> &subSurface) | ||
1055 | { | 1053 | { | ||
1056 | Q_UNUSED(subSurface) | 1054 | Q_UNUSED(subSurface) | ||
1057 | return nullptr; | 1055 | return nullptr; | ||
1058 | } | 1056 | } | ||
1059 | 1057 | | |||
1060 | bool WindowPixmap::isValid() const | 1058 | bool WindowPixmap::isValid() const | ||
1061 | { | 1059 | { | ||
1062 | if (!m_buffer.isNull() || !m_fbo.isNull()) { | 1060 | if (!m_buffer.isNull() || !m_fbo.isNull() || !m_internalImage.isNull()) { | ||
1063 | return true; | 1061 | return true; | ||
1064 | } | 1062 | } | ||
1065 | return m_pixmap != XCB_PIXMAP_NONE; | 1063 | return m_pixmap != XCB_PIXMAP_NONE; | ||
1066 | } | 1064 | } | ||
1067 | 1065 | | |||
1068 | void WindowPixmap::updateBuffer() | 1066 | void WindowPixmap::updateBuffer() | ||
1069 | { | 1067 | { | ||
1070 | using namespace KWayland::Server; | 1068 | using namespace KWayland::Server; | ||
Show All 34 Lines | 1093 | if (auto b = s->buffer()) { | |||
1105 | m_buffer->ref(); | 1103 | m_buffer->ref(); | ||
1106 | QObject::connect(m_buffer.data(), &BufferInterface::aboutToBeDestroyed, m_buffer.data(), &BufferInterface::unref); | 1104 | QObject::connect(m_buffer.data(), &BufferInterface::aboutToBeDestroyed, m_buffer.data(), &BufferInterface::unref); | ||
1107 | } else if (m_subSurface) { | 1105 | } else if (m_subSurface) { | ||
1108 | if (m_buffer) { | 1106 | if (m_buffer) { | ||
1109 | QObject::disconnect(m_buffer.data(), &BufferInterface::aboutToBeDestroyed, m_buffer.data(), &BufferInterface::unref); | 1107 | QObject::disconnect(m_buffer.data(), &BufferInterface::aboutToBeDestroyed, m_buffer.data(), &BufferInterface::unref); | ||
1110 | m_buffer->unref(); | 1108 | m_buffer->unref(); | ||
1111 | m_buffer.clear(); | 1109 | m_buffer.clear(); | ||
1112 | } | 1110 | } | ||
1113 | } else { | | |||
1114 | // might be an internal window | | |||
1115 | const auto &fbo = toplevel()->internalFramebufferObject(); | | |||
1116 | if (!fbo.isNull()) { | | |||
1117 | m_fbo = fbo; | | |||
1118 | } | | |||
1119 | } | 1111 | } | ||
1112 | } else if (toplevel()->internalFramebufferObject()) { | ||||
1113 | m_fbo = toplevel()->internalFramebufferObject(); | ||||
1114 | } else if (!toplevel()->internalImageObject().isNull()) { | ||||
1115 | m_internalImage = toplevel()->internalImageObject(); | ||||
1120 | } else { | 1116 | } else { | ||
1121 | if (m_buffer) { | 1117 | if (m_buffer) { | ||
1122 | QObject::disconnect(m_buffer.data(), &BufferInterface::aboutToBeDestroyed, m_buffer.data(), &BufferInterface::unref); | 1118 | QObject::disconnect(m_buffer.data(), &BufferInterface::aboutToBeDestroyed, m_buffer.data(), &BufferInterface::unref); | ||
1123 | m_buffer->unref(); | 1119 | m_buffer->unref(); | ||
1124 | m_buffer.clear(); | 1120 | m_buffer.clear(); | ||
1125 | } | 1121 | } | ||
1126 | } | 1122 | } | ||
1127 | } | 1123 | } | ||
Show All 32 Lines |