7#include <qpa/qplatformbackingstore.h>
8#include <qpa/qplatformintegration.h>
13#include <private/qguiapplication_p.h>
14#include <private/qwindow_p.h>
16#include <private/qhighdpiscaling_p.h>
34 return downscale ? std::ceil(windowDpr) : windowDpr;
45 return roundingFactor * guiFactor;
178 qWarning(
"QBackingStore::endPaint() called with active painter; did you forget to destroy it or call QPainter::end() on it?");
204 qWarning() <<
"QBackingStore::flush() called for "
205 <<
window <<
" which does not have a handle.";
209 Q_ASSERT(
window == topLevelWindow || topLevelWindow->isAncestorOf(
window, QWindow::ExcludeTransients));
220 QPoint diff = nativeTopLeft - (nativeRegion.boundingRect().topLeft() + nativeOffset);
222 nativeRegion.translate(diff);
262 if (
qFloor(nativeDx) != nativeDx ||
qFloor(nativeDy) != nativeDy)
273 [[maybe_unused]]
static const bool didCheckPlatformSupport = []{
276 qWarning(
"QBackingStore::setStaticContents(): Platform does not support static contents");
308 const QRect imageRect(0, 0,
img.width(),
img.height());
314 Q_ASSERT_X(imageRect.contains(destRect),
"qt_scrollRectInImage",
315 "The sourceRect should already account for clipping, both pre and post scroll");
320 if (sourceRect.
top() < destRect.top()) {
322 dest = mem + (destRect.top() + sourceRect.
height() - 1) * lineskip + destRect.left() *
depth;
323 lineskip = -lineskip;
326 dest = mem + destRect.top() * lineskip + destRect.left() *
depth;
329 const int w = sourceRect.
width();
331 const int bytes =
w *
depth;
336 ::memmove(dest,
src, bytes);
342 ::memcpy(dest,
src, bytes);
IOBluetoothDevice * device
qreal deviceIndependentToNativeFactor() const
qreal backingStoreDevicePixelRatio() const
QPlatformBackingStore * platformBackingStore
QBackingStorePrivate(QWindow *w)
QScopedPointer< QImage > highDpiBackingstore
The QBackingStore class provides a drawing area for QWindow.
QPlatformBackingStore * handle() const
Returns a pointer to the QPlatformBackingStore implementation.
QPaintDevice * paintDevice()
Returns the paint device for this surface.
QWindow * window() const
Returns a pointer to the top-level window associated with this surface.
QRegion staticContents() const
Returns a QRegion representing the area of the window that has static contents.
void beginPaint(const QRegion &)
Begins painting on the backing store surface in the given region.
void flush(const QRegion ®ion, QWindow *window=nullptr, const QPoint &offset=QPoint())
Flushes the given region from the specified window onto the screen.
void setStaticContents(const QRegion ®ion)
Set region as the static contents of this window.
void resize(const QSize &size)
Sets the size of the window surface to size.
QBackingStore(QWindow *window)
Constructs an empty surface for the given top-level window.
QSize size() const
Returns the current size of the window surface.
bool hasStaticContents() const
Returns a boolean indicating if this window has static contents or not.
bool scroll(const QRegion &area, int dx, int dy)
Scrolls the given area dx pixels to the right and dy downward; both dx and dy may be negative.
~QBackingStore()
Destroys this surface.
void endPaint()
Ends painting.
static QPlatformIntegration * platformIntegration()
static qreal factor(C *context)
qsizetype bytesPerLine() const
Returns the number of bytes per image scanline.
QSize size() const
Returns the size of the image, i.e.
Format format() const
Returns the format of the image.
void setDevicePixelRatio(qreal scaleFactor)
Sets the device pixel ratio for the image.
const uchar * constBits() const
Returns a pointer to the first pixel data.
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
\inmodule QtCore\reentrant
constexpr bool isEmpty() const noexcept
Returns true if the rectangle is empty, otherwise returns false.
constexpr int height() const noexcept
Returns the height of the rectangle.
QRect intersected(const QRect &other) const noexcept
constexpr int bottom() const noexcept
Returns the y-coordinate of the rectangle's bottom edge.
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr int top() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr int left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr int width() const noexcept
Returns the width of the rectangle.
constexpr QRect translated(int dx, int dy) const noexcept
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis,...
The QRegion class specifies a clip region for a painter.
QRect boundingRect() const noexcept
Returns the bounding rectangle of this region.
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
T * data() const noexcept
Returns the value of the pointer referenced by this object.
bool isNull() const noexcept
Returns true if this object refers to \nullptr.
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.
qreal scale(qreal value, qreal scaleFactor, QPointF=QPointF(0, 0))
Combined button and popup list for selecting options.
void Q_GUI_EXPORT qt_scrollRectInImage(QImage &img, const QRect &rect, const QPoint &offset)
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
static int area(const QSize &s)
constexpr const T & qMax(const T &a, const T &b)
constexpr T qAbs(const T &t)
GLint GLenum GLsizei GLsizei GLsizei depth
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLintptr offset
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLsizei GLchar * source
#define Q_ASSERT_X(cond, x, msg)
Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) noexcept