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
qblittable_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 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 QBLITTABLE_P_H
6#define QBLITTABLE_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/qtguiglobal_p.h>
20#include <QtCore/qsize.h>
21#include <QtGui/private/qpixmap_blitter_p.h>
22
23
24#ifndef QT_NO_BLITTABLE
25QT_BEGIN_NAMESPACE
26
27class QImage;
29
30class Q_GUI_EXPORT QBlittable
31{
32 Q_DECLARE_PRIVATE(QBlittable)
33public:
34 enum Capability {
35
36 SolidRectCapability = 0x0001,
37 SourcePixmapCapability = 0x0002,
38 SourceOverPixmapCapability = 0x0004,
39 SourceOverScaledPixmapCapability = 0x0008,
40 AlphaFillRectCapability = 0x0010,
41 OpacityPixmapCapability = 0x0020,
42 DrawScaledCachedGlyphsCapability = 0x0040,
43 SubPixelGlyphsCapability = 0x0080,
44 ComplexClipCapability = 0x0100,
45
46 // Internal ones
47 OutlineCapability = 0x0001000
48 };
49 Q_DECLARE_FLAGS (Capabilities, Capability)
50
51 QBlittable(const QSize &size, Capabilities caps);
52 virtual ~QBlittable();
53
55 QSize size() const;
56
57 virtual void fillRect(const QRectF &rect, const QColor &color) = 0;
58 virtual void drawPixmap(const QRectF &rect, const QPixmap &pixmap, const QRectF &subrect) = 0;
59 virtual void alphaFillRect(const QRectF &rect, const QColor &color, QPainter::CompositionMode cmode) {
60 Q_UNUSED(rect);
61 Q_UNUSED(color);
62 Q_UNUSED(cmode);
63 qWarning("Please implement alphaFillRect function in your platform or remove AlphaFillRectCapability from it");
64 }
65 virtual void drawPixmapOpacity(const QRectF &rect, const QPixmap &pixmap, const QRectF &subrect, QPainter::CompositionMode cmode, qreal opacity) {
66 Q_UNUSED(rect);
67 Q_UNUSED(pixmap);
68 Q_UNUSED(subrect);
69 Q_UNUSED(cmode);
70 Q_UNUSED(opacity);
71 qWarning("Please implement drawPixmapOpacity function in your platform or remove OpacityPixmapCapability from it");
72 }
73 virtual bool drawCachedGlyphs(const QPaintEngineState *state, QFontEngine::GlyphFormat glyphFormat, int numGlyphs, const glyph_t *glyphs, const QFixedPoint *positions, QFontEngine *fontEngine) {
74 Q_UNUSED(state);
75 Q_UNUSED(glyphFormat);
76 Q_UNUSED(numGlyphs);
77 Q_UNUSED(glyphs);
78 Q_UNUSED(positions);
79 Q_UNUSED(fontEngine);
80 qWarning("Please implement drawCachedGlyphs function in your platform or remove DrawCachedGlyphsCapability from it");
81 return true;
82 }
83
84
85 QImage *lock();
86 void unlock();
87
88 bool isLocked() const;
89
90protected:
91 virtual QImage *doLock() = 0;
92 virtual void doUnlock() = 0;
94};
95
96QT_END_NAMESPACE
97#endif //QT_NO_BLITTABLE
98#endif //QBLITTABLE_P_H
QBlittablePrivate(const QSize &size, QBlittable::Capabilities caps)
virtual void drawPixmapOpacity(const QRectF &rect, const QPixmap &pixmap, const QRectF &subrect, QPainter::CompositionMode cmode, qreal opacity)
virtual bool drawCachedGlyphs(const QPaintEngineState *state, QFontEngine::GlyphFormat glyphFormat, int numGlyphs, const glyph_t *glyphs, const QFixedPoint *positions, QFontEngine *fontEngine)
virtual void doUnlock()=0
virtual void alphaFillRect(const QRectF &rect, const QColor &color, QPainter::CompositionMode cmode)
QImage * lock()
Capabilities capabilities() const
bool isLocked() const
void unlock()
QSize size() const
Returns the size of the image, without actually reading the image contents.
void fillRect(const QRectF &, const QColor &color)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
Draws the rectangular portion source of the given pixmap into the given target in the paint device.
Combined button and popup list for selecting options.