Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qsgtexture_mac.mm
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#include "qsgtexture_p.h"
7#include <private/qquickitem_p.h>
8#include <private/qquickwindow_p.h>
9#include <QtCore/private/qnativeinterface_p.h>
10#include <rhi/qrhi.h>
11
13
14id<MTLTexture> QSGTexturePlatformMetal::nativeTexture() const
15{
16 if (auto *tex = m_texture->rhiTexture())
17 return (id<MTLTexture>) quintptr(tex->nativeTexture().object);
18 return 0;
19}
20
21namespace QNativeInterface {
22
24
25QSGTexture *QSGMetalTexture::fromNative(id<MTLTexture> texture,
26 QQuickWindow *window,
27 const QSize &size,
28 QQuickWindow::CreateTextureOptions options)
29{
30 return QQuickWindowPrivate::get(window)->createTextureFromNativeTexture(quint64(texture), 0, size, options);
31}
32
33} // QNativeInterface
34
35QT_END_NAMESPACE
QT_DEFINE_NATIVE_INTERFACE(QSGMetalTexture)
Combined button and popup list for selecting options.