diff options
Diffstat (limited to 'src/gui/painting/qplatformbackingstore.h')
-rw-r--r-- | src/gui/painting/qplatformbackingstore.h | 70 |
1 files changed, 12 insertions, 58 deletions
diff --git a/src/gui/painting/qplatformbackingstore.h b/src/gui/painting/qplatformbackingstore.h index 97df8fca4f..1d55e9ab6a 100644 --- a/src/gui/painting/qplatformbackingstore.h +++ b/src/gui/painting/qplatformbackingstore.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QPLATFORMBACKINGSTORE_H #define QPLATFORMBACKINGSTORE_H @@ -59,7 +23,7 @@ QT_BEGIN_NAMESPACE -Q_GUI_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcQpaBackingStore) +Q_DECLARE_EXPORTED_LOGGING_CATEGORY(lcQpaBackingStore, Q_GUI_EXPORT) class QRegion; class QRect; @@ -72,7 +36,6 @@ class QPlatformGraphicsBuffer; class QRhi; class QRhiTexture; class QRhiResourceUpdateBatch; -class QRhiSwapChain; struct Q_GUI_EXPORT QPlatformBackingStoreRhiConfig { @@ -81,6 +44,7 @@ struct Q_GUI_EXPORT QPlatformBackingStoreRhiConfig Metal, Vulkan, D3D11, + D3D12, Null }; @@ -102,22 +66,10 @@ struct Q_GUI_EXPORT QPlatformBackingStoreRhiConfig bool isDebugLayerEnabled() const { return m_debugLayer; } void setDebugLayer(bool enable) { m_debugLayer = enable; } - QByteArrayList instanceExtensions() const { return m_instanceExtensions; } - void setInstanceExtensions(const QByteArrayList &e) { m_instanceExtensions = e; } - - QByteArrayList instanceLayers() const { return m_instanceLayers; } - void setInstanceLayers(const QByteArrayList &e) { m_instanceLayers = e; } - - QByteArrayList deviceExtensions() const { return m_deviceExtensions; } - void setDeviceExtensions(const QByteArrayList &e) { m_deviceExtensions = e; } - private: bool m_enable; Api m_api = Null; bool m_debugLayer = false; - QByteArrayList m_instanceExtensions; - QByteArrayList m_instanceLayers; - QByteArrayList m_deviceExtensions; friend bool operator==(const QPlatformBackingStoreRhiConfig &a, const QPlatformBackingStoreRhiConfig &b); }; @@ -125,10 +77,7 @@ inline bool operator==(const QPlatformBackingStoreRhiConfig &a, const QPlatformB { return a.m_enable == b.m_enable && a.m_api == b.m_api - && a.m_debugLayer == b.m_debugLayer - && a.m_instanceExtensions == b.m_instanceExtensions - && a.m_instanceLayers == b.m_instanceLayers - && a.m_deviceExtensions == b.m_deviceExtensions; + && a.m_debugLayer == b.m_debugLayer; } inline bool operator!=(const QPlatformBackingStoreRhiConfig &a, const QPlatformBackingStoreRhiConfig &b) @@ -144,7 +93,8 @@ public: enum Flag { StacksOnTop = 0x01, TextureIsSrgb = 0x02, - NeedsPremultipliedAlphaBlending = 0x04 + NeedsPremultipliedAlphaBlending = 0x04, + MirrorVertically = 0x08 }; Q_DECLARE_FLAGS(Flags, Flag) @@ -154,6 +104,7 @@ public: int count() const; bool isEmpty() const { return count() == 0; } QRhiTexture *texture(int index) const; + QRhiTexture *textureExtra(int index) const; QRect geometry(int index) const; QRect clipRect(int index) const; void *source(int index); @@ -163,6 +114,9 @@ public: void appendTexture(void *source, QRhiTexture *texture, const QRect &geometry, const QRect &clipRect = QRect(), Flags flags = { }); + + void appendTexture(void *source, QRhiTexture *textureLeft, QRhiTexture *textureRight, const QRect &geometry, + const QRect &clipRect = QRect(), Flags flags = { }); void clear(); Q_SIGNALS: @@ -190,6 +144,7 @@ public: virtual void flush(QWindow *window, const QRegion ®ion, const QPoint &offset); virtual FlushResult rhiFlush(QWindow *window, + qreal sourceDevicePixelRatio, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, @@ -218,7 +173,6 @@ public: void setRhiConfig(const QPlatformBackingStoreRhiConfig &config); QRhi *rhi() const; - QRhiSwapChain *rhiSwapChain() const; void surfaceAboutToBeDestroyed(); void graphicsDeviceReportedLost(); |