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
qsgrhitextureglyphcache_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 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#ifndef QSGRHITEXTUREGLYPHCACHE_P_H
6#define QSGRHITEXTUREGLYPHCACHE_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtGui/private/qtextureglyphcache_p.h>
20#include <rhi/qrhi.h>
21
23
24class QSGDefaultRenderContext;
25
27{
28public:
29 QSGRhiTextureGlyphCache(QSGDefaultRenderContext *rc,
30 QFontEngine::GlyphFormat format, const QTransform &matrix,
31 const QColor &color = QColor());
33
34 void createTextureData(int width, int height) override;
35 void resizeTextureData(int width, int height) override;
37 void fillTexture(const Coord &c, glyph_t glyph, const QFixedPoint &subPixelPosition) override;
39 int glyphPadding() const override;
40 int maxTextureWidth() const override;
41 int maxTextureHeight() const override;
42
43 QRhiTexture *texture() const { return m_texture; }
44 void commitResourceUpdates(QRhiResourceUpdateBatch *mergeInto);
45
46 // Clamp the default -1 width and height to 0 for compatibility with
47 // QOpenGLTextureGlyphCache.
48 int width() const { return qMax(0, m_size.width()); }
49 int height() const { return qMax(0, m_size.height()); }
50
52
53private:
54 void prepareGlyphImage(QImage *img);
55 QRhiTexture *createEmptyTexture(QRhiTexture::Format format);
56
57 QSGDefaultRenderContext *m_rc;
58 QRhi *m_rhi;
59 bool m_resizeWithTextureCopy;
60 QRhiTexture *m_texture = nullptr;
61 QSize m_size;
62 bool m_bgra = false;
63 QVarLengthArray<QRhiTextureUploadEntry, 16> m_uploads;
64};
65
66QT_END_NAMESPACE
67
68#endif // QSGRHITEXTUREGLYPHCACHE_P_H
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:662
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:722
void resizeTextureData(int width, int height) override
void commitResourceUpdates(QRhiResourceUpdateBatch *mergeInto)
int maxTextureHeight() const override
QSGRhiTextureGlyphCache(QSGDefaultRenderContext *rc, QFontEngine::GlyphFormat format, const QTransform &matrix, const QColor &color=QColor())
void fillTexture(const Coord &c, glyph_t glyph, const QFixedPoint &subPixelPosition) override
void createTextureData(int width, int height) override
Combined button and popup list for selecting options.
QT_BEGIN_NAMESPACE typedef unsigned int QRgb
Definition qrgb.h:14
constexpr int qRed(QRgb rgb)
Definition qrgb.h:19
constexpr int qGreen(QRgb rgb)
Definition qrgb.h:22
constexpr QRgb qRgba(int r, int g, int b, int a)
Definition qrgb.h:34
constexpr int qBlue(QRgb rgb)
Definition qrgb.h:25