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
QRasterBackingStore Class Reference

#include <qrasterbackingstore_p.h>

+ Inheritance diagram for QRasterBackingStore:
+ Collaboration diagram for QRasterBackingStore:

Public Member Functions

 QRasterBackingStore (QWindow *window)
 
 ~QRasterBackingStore ()
 
void resize (const QSize &size, const QRegion &staticContents) 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 &region) override
 This function is called before painting onto the surface begins, with the region in which the painting will occur.
 
QPaintDevicepaintDevice () override
 Implement this function to return the appropriate paint device.
 
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 void flush (QWindow *window, const QRegion &region, const QPoint &offset)
 Flushes the given region from the specified window.
 
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 ()
 

Protected Member Functions

virtual QImage::Format format () const
 

Protected Attributes

QImage m_image
 
QSize m_requestedSize
 

Additional Inherited Members

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

Detailed Description

Definition at line 24 of file qrasterbackingstore_p.h.

Constructor & Destructor Documentation

◆ QRasterBackingStore()

QT_BEGIN_NAMESPACE QRasterBackingStore::QRasterBackingStore ( QWindow * window)

Definition at line 14 of file qrasterbackingstore.cpp.

◆ ~QRasterBackingStore()

QRasterBackingStore::~QRasterBackingStore ( )

Definition at line 19 of file qrasterbackingstore.cpp.

Member Function Documentation

◆ beginPaint()

void QRasterBackingStore::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 63 of file qrasterbackingstore.cpp.

References QPainter::CompositionMode_Source, QImage::devicePixelRatio(), QPlatformWindow::devicePixelRatio(), QImage::fill(), QPainter::fillRect(), format(), QImage::hasAlphaChannel(), m_image, m_requestedSize, painter, rect, QPainter::setCompositionMode(), QImage::setDevicePixelRatio(), QImage::size(), Qt::transparent, and QPlatformBackingStore::window().

+ Here is the call graph for this function:

◆ format()

QImage::Format QRasterBackingStore::format ( ) const
protectedvirtual

Reimplemented in QRhiBackingStore.

Definition at line 29 of file qrasterbackingstore.cpp.

References format(), QImage::Format_ARGB32_Premultiplied, QImage::Format_RGB32, hasAlpha(), and QPlatformBackingStore::window().

Referenced by beginPaint(), format(), and QRhiBackingStore::format().

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

◆ paintDevice()

QPaintDevice * QRasterBackingStore::paintDevice ( )
overridevirtual

Implement this function to return the appropriate paint device.

Implements QPlatformBackingStore.

Definition at line 37 of file qrasterbackingstore.cpp.

References m_image.

◆ resize()

void QRasterBackingStore::resize ( const QSize & size,
const QRegion & staticContents )
overridevirtual

Implements QPlatformBackingStore.

Definition at line 23 of file qrasterbackingstore.cpp.

References m_requestedSize, and Q_UNUSED.

◆ scroll()

bool QRasterBackingStore::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 47 of file qrasterbackingstore.cpp.

References QRegion::boundingRect(), QImage::devicePixelRatio(), QPlatformSurface::isRasterSurface(), m_image, qt_scrollRectInImage(), rect, and QPlatformBackingStore::window().

+ Here is the call graph for this function:

◆ toImage()

QImage QRasterBackingStore::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 42 of file qrasterbackingstore.cpp.

References m_image.

Member Data Documentation

◆ m_image

QImage QRasterBackingStore::m_image
protected

◆ m_requestedSize

QSize QRasterBackingStore::m_requestedSize
protected

Definition at line 41 of file qrasterbackingstore_p.h.

Referenced by beginPaint(), and resize().


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