29 Q_DECLARE_PRIVATE(QSGPlainTexture)
32 ~QSGPlainTexture() override;
34 void setOwnsTexture(
bool owns) { m_owns_texture = owns; }
35 bool ownsTexture()
const {
return m_owns_texture; }
37 void setTextureSize(
const QSize &size) { m_texture_size = size; }
38 QSize textureSize()
const override {
return m_texture_size; }
40 void setHasAlphaChannel(
bool alpha) { m_has_alpha = alpha; }
41 bool hasAlphaChannel()
const override {
return m_has_alpha; }
43 bool hasMipmaps()
const override {
return mipmapFiltering() != QSGTexture::None; }
45 void setImage(
const QImage &image);
46 const QImage &image() {
return m_image; }
48 qint64 comparisonKey()
const override;
50 QRhiTexture *rhiTexture()
const override;
51 void commitTextureOperations(QRhi *rhi, QRhiResourceUpdateBatch *resourceUpdates) override;
53 void setTexture(QRhiTexture *texture);
54 void setTextureFromNativeTexture(QRhi *rhi,
55 quint64 nativeObjectHandle,
56 int nativeLayoutOrState,
59 QQuickWindow::CreateTextureOptions options,
60 QQuickWindowPrivate::TextureFromNativeTextureFlags flags);
62 static QSGPlainTexture *fromImage(
const QImage &image) {
63 QSGPlainTexture *t =
new QSGPlainTexture();
69 QSGPlainTexture(QSGPlainTexturePrivate &dd);
74 QRectF m_texture_rect;
75 QRhiTexture *m_texture;
78 uint m_dirty_texture : 1;
79 uint m_dirty_bind_options : 1;
80 uint m_owns_texture : 1;
81 uint m_mipmaps_generated : 1;
82 uint m_retain_image : 1;
83 uint m_mipmap_warned : 1;
The QSGOpaqueTextureMaterial class provides a convenient way of rendering textured geometry in the sc...
The QSGTextureMaterial class provides a convenient way of rendering textured geometry in the scene gr...