11#include <private/qguiapplication_p.h>
12#include <private/qblittable_p.h>
14#include <private/qdrawhelper_p.h>
15#include <private/qfont_p.h>
17#ifndef QT_NO_BLITTABLE
25 , m_devicePixelRatio(1.0)
26#ifdef QT_BLITTER_RASTEROVERLAY
27 ,m_rasterOverlay(0), m_unmergedCopy(0)
35#ifdef QT_BLITTER_RASTEROVERLAY
36 delete m_rasterOverlay;
37 delete m_unmergedCopy;
92 qWarning(
"QRasterPlatformPixmap::metric(): Unhandled metric type %d",
metric);
138 Qt::ImageConversionFlags
flags)
153 while (bytesCopied < correctFormatPic.
sizeInBytes()) {
180#ifdef QT_BLITTER_RASTEROVERLAY
184void QBlittablePlatformPixmap::mergeOverlay()
186 if (m_unmergedCopy || !showRasterOverlay)
191 p.drawImage(0,0,*overlay());
195void QBlittablePlatformPixmap::unmergeOverlay()
197 if (!m_unmergedCopy || !showRasterOverlay)
201 p.drawImage(0,0,*m_unmergedCopy);
204 delete m_unmergedCopy;
208QImage *QBlittablePlatformPixmap::overlay()
210 if (!m_rasterOverlay||
211 m_rasterOverlay->size() !=
QSize(
w,
h)){
213 m_rasterOverlay->fill(0x00000000);
216 m_overlayColor.setAlpha(0x88);
219 return m_rasterOverlay;
222void QBlittablePlatformPixmap::markRasterOverlayImpl(
const QRectF &
rect)
224 if (!showRasterOverlay)
226 QRectF transformationRect = clipAndTransformRect(
rect);
227 if (!transformationRect.
isEmpty()) {
229 p.setBrush(m_overlayColor);
231 p.fillRect(transformationRect,
QBrush(m_overlayColor));
235void QBlittablePlatformPixmap::unmarkRasterOverlayImpl(
const QRectF &
rect)
237 if (!showRasterOverlay)
239 QRectF transformationRect = clipAndTransformRect(
rect);
240 if (!transformationRect.
isEmpty()) {
249QRectF QBlittablePlatformPixmap::clipAndTransformRect(
const QRectF &
rect)
const
258 transformationRect &= clipData->
clipRect;
260 for (
const QRect &
rect : clipData->clipRegion)
261 transformationRect &=
rect;
265 return transformationRect;
virtual void alphaFillRect(const QRectF &rect, const QColor &color, QPainter::CompositionMode cmode)
virtual void fillRect(const QRectF &rect, const QColor &color)=0
@ AlphaFillRectCapability
The QColor class provides colors based on RGB, HSV or CMYK values.
QScreen * primaryScreen
the primary (or default) screen of the application.
bool hasAlphaChannel() const
Returns true if the image has a format that respects the alpha channel, otherwise returns false.
qsizetype bytesPerLine() const
Returns the number of bytes per image scanline.
QImage copy(const QRect &rect=QRect()) const
Returns a sub-area of the image as a new image.
qsizetype sizeInBytes() const
uchar * bits()
Returns a pointer to the first pixel data.
@ Format_ARGB32_Premultiplied
void fill(uint pixel)
Fills the entire image with the given pixelValue.
Format format() const
Returns the format of the image.
const uchar * constBits() const
Returns a pointer to the first pixel data.
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const &
@ PdmDevicePixelRatioScaled
static qreal devicePixelRatioFScale()
The QPainter class performs low-level painting on widgets and other paint devices.
@ CompositionMode_SourceOver
static Q_DECL_CONST_FUNCTION QRandomGenerator * global()
\threadsafe
double bounded(double highest)
Generates one random double in the range between 0 (inclusive) and highest (exclusive).
QRasterPaintEngineState * state()
void clip(const QVectorPath &path, Qt::ClipOperation op) override
\inmodule QtCore\reentrant
constexpr bool isEmpty() const noexcept
Returns true if the rectangle is empty, otherwise returns false.
\inmodule QtCore\reentrant
T * data() const noexcept
Returns the value of the pointer referenced by this object.
void reset(T *other=nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval< T * >())))
Deletes the existing object it is pointing to (if any), and sets its pointer to other.
int depth
the color depth of the screen
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
Combined button and popup list for selecting options.
int qRound(qfloat16 d) noexcept
Q_GUI_EXPORT int qt_defaultDpiX()
Q_GUI_EXPORT int qt_defaultDpiY()
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLfloat GLfloat GLfloat GLfloat h
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const void * bits
static QT_BEGIN_NAMESPACE int global_ser_no
Q_CORE_EXPORT bool qEnvironmentVariableIsEmpty(const char *varName) noexcept