Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QWindowsBackingStore Class Reference

Backing store for windows. More...

#include <qwindowsbackingstore.h>

+ Inheritance diagram for QWindowsBackingStore:
+ Collaboration diagram for QWindowsBackingStore:

Public Member Functions

 QWindowsBackingStore (QWindow *window)
 
 ~QWindowsBackingStore () override
 
QPaintDevicepaintDevice () override
 Implement this function to return the appropriate paint device.
 
void flush (QWindow *window, const QRegion &region, const QPoint &offset) override
 Flushes the given region from the specified window.
 
void resize (const QSize &size, const QRegion &r) override
 
bool scroll (const QRegion &area, int dx, int dy) override
 Scrolls the given area dx pixels to the right and dy downward; both dx and dy may be negative.
 
void beginPaint (const QRegion &) override
 This function is called before painting onto the surface begins, with the region in which the painting will occur.
 
HDC getDC () const
 
QImage toImage () const override
 Implemented in subclasses to return the content of the backingstore as a QImage.
 
- Public Member Functions inherited from QPlatformBackingStore
 QPlatformBackingStore (QWindow *window)
 Constructs an empty surface for the given top-level window.
 
virtual ~QPlatformBackingStore ()
 Destroys this surface.
 
QWindowwindow () const
 Returns a pointer to the top-level window associated with this surface.
 
QBackingStorebackingStore () const
 Returns a pointer to the backing store associated with this surface.
 
virtual FlushResult rhiFlush (QWindow *window, qreal sourceDevicePixelRatio, const QRegion &region, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground)
 Flushes the given region from the specified window, and compositing it with the specified textures list.
 
virtual QRhiTexturetoTexture (QRhiResourceUpdateBatch *resourceUpdates, const QRegion &dirtyRegion, TextureFlags *flags) const
 May be reimplemented in subclasses to return the content of the backingstore as an QRhiTexture.
 
virtual QPlatformGraphicsBuffergraphicsBuffer () const
 Accessor for a backingstores graphics buffer abstraction.
 
virtual void endPaint ()
 This function is called after painting onto the surface has ended.
 
void setRhiConfig (const QPlatformBackingStoreRhiConfig &config)
 
QRhirhi () const
 
void surfaceAboutToBeDestroyed ()
 
void graphicsDeviceReportedLost ()
 

Additional Inherited Members

- Public Types inherited from QPlatformBackingStore
enum  FlushResult { FlushSuccess , FlushFailed , FlushFailedDueToLostDevice }
 
enum  TextureFlag { TextureSwizzle = 0x01 , TextureFlip = 0x02 , TexturePremultiplied = 0x04 }
 

Detailed Description

Backing store for windows.

Definition at line 17 of file qwindowsbackingstore.h.

Constructor & Destructor Documentation

◆ QWindowsBackingStore()

QWindowsBackingStore::QWindowsBackingStore ( QWindow * window)

Definition at line 24 of file qwindowsbackingstore.cpp.

References qCDebug, and QPlatformBackingStore::window().

+ Here is the call graph for this function:

◆ ~QWindowsBackingStore()

QWindowsBackingStore::~QWindowsBackingStore ( )
override

Definition at line 31 of file qwindowsbackingstore.cpp.

References qCDebug.

Member Function Documentation

◆ beginPaint()

void QWindowsBackingStore::beginPaint ( const QRegion & )
overridevirtual

This function is called before painting onto the surface begins, with the region in which the painting will occur.

See also
endPaint(), paintDevice()

Reimplemented from QPlatformBackingStore.

Definition at line 155 of file qwindowsbackingstore.cpp.

References QPainter::CompositionMode_Source, QWindowsNativeImage::image(), qCDebug, Qt::transparent, and QWindowsContext::verbose.

+ Here is the call graph for this function:

◆ flush()

void QWindowsBackingStore::flush ( QWindow * window,
const QRegion & region,
const QPoint & offset )
overridevirtual

Flushes the given region from the specified window.

Note
region is relative to the window which may not be top-level in case window corresponds to a native child widget. offset is the position of the native child relative to the top-level window.

Unlike rhiFlush(), this function's default implementation does nothing. It is expected that subclasses provide a platform-specific (non-QRhi-based) implementation, if applicable on the given platform.

See also
rhiFlush()

Reimplemented from QPlatformBackingStore.

Definition at line 42 of file qwindowsbackingstore.cpp.

References arg, QRegion::boundingRect(), fileName, QWindow::flags, Qt::FramelessWindowHint, QString::fromLatin1(), hasAlpha(), QWindowsNativeImage::hdc(), QRect::height(), QWindowsNativeImage::image(), info, QMargins::left(), Q_ASSERT, qCDebug, qErrnoWarning(), qRound(), QImage::save(), QWindowsWindow::setWindowLayered(), QImage::size(), SIZE, QHighDpi::toNativePixels(), QMargins::top(), QRect::translated(), QWindowsContext::verbose, QRect::width(), QPlatformBackingStore::window(), QWindowsWindow::windowsWindowOf(), QRect::x(), and QRect::y().

+ Here is the call graph for this function:

◆ getDC()

HDC QWindowsBackingStore::getDC ( ) const

Definition at line 169 of file qwindowsbackingstore.cpp.

References QWindowsNativeImage::hdc(), and QScopedPointer< T, Cleanup >::isNull().

Referenced by QWindowsGdiNativeInterface::nativeResourceForBackingStore().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ paintDevice()

QPaintDevice * QWindowsBackingStore::paintDevice ( )
overridevirtual

Implement this function to return the appropriate paint device.

Implements QPlatformBackingStore.

Definition at line 36 of file qwindowsbackingstore.cpp.

References QWindowsNativeImage::image(), QScopedPointer< T, Cleanup >::isNull(), and Q_ASSERT.

+ Here is the call graph for this function:

◆ resize()

◆ scroll()

bool QWindowsBackingStore::scroll ( const QRegion & area,
int dx,
int dy )
overridevirtual

Scrolls the given area dx pixels to the right and dy downward; both dx and dy may be negative.

Returns true if the area was scrolled successfully; false otherwise.

Reimplemented from QPlatformBackingStore.

Definition at line 143 of file qwindowsbackingstore.cpp.

References area(), QWindowsNativeImage::image(), QImage::isNull(), QScopedPointer< T, Cleanup >::isNull(), qt_scrollRectInImage(), and rect.

+ Here is the call graph for this function:

◆ toImage()

QImage QWindowsBackingStore::toImage ( ) const
overridevirtual

Implemented in subclasses to return the content of the backingstore as a QImage.

If composition via a 3D graphics API is supported, either this function or toTexture() must be implemented.

The returned image is only valid until the next operation (resize, paint, scroll, or flush) on the backingstore. The caller must not store the return value between calls, but instead call this function before each use, or make an explicit copy.

See also
toTexture()

Reimplemented from QPlatformBackingStore.

Definition at line 176 of file qwindowsbackingstore.cpp.

References QScopedPointer< T, Cleanup >::data(), QWindowsNativeImage::image(), QScopedPointer< T, Cleanup >::isNull(), and qCWarning.

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: