15#include <QtGui/qpainter.h>
16#include <QtGui/qwindow.h>
17#include <QtCore/qdebug.h>
22
23
24
25
34 return platformPixmap(p)->bitmap();
43 : QPlatformBackingStore(window)
53 QPixmap *pixmap = nativeWindow(window())->pixmap();
54 bitmap(pixmap)->deviceContext()->begin();
56 QPainter painter(pixmap);
57 QColor clear(Qt::transparent);
59 painter.setCompositionMode(QPainter::CompositionMode_Source);
61 for (
const QRect &r : region)
62 painter.fillRect(r, clear);
67 bitmap(nativeWindow(window())->pixmap())->deviceContext()->end();
72 return nativeWindow(window())->pixmap();
77 if (targetWindow != window()) {
78 QSharedPointer<QWindowsDirect2DBitmap> copy(nativeWindow(window())->copyBackBuffer());
79 nativeWindow(targetWindow)->flush(copy.data(), region, offset);
82 nativeWindow(targetWindow)->present(region);
87 QPixmap old = nativeWindow(window())->pixmap()->copy();
89 nativeWindow(window())->resizeSwapChain(size);
90 QPixmap *newPixmap = nativeWindow(window())->pixmap();
93 for (
const QRect &rect : region)
94 platformPixmap(newPixmap)->copy(old.handle(), rect);
100 return nativeWindow(window())->pixmap()->toImage();
\inmodule QtCore\reentrant
Backing store for windows.
void beginPaint(const QRegion &) override
This function is called before painting onto the surface begins, with the region in which the paintin...
void endPaint() override
This function is called after painting onto the surface has ended.
QPaintDevice * paintDevice() override
Implement this function to return the appropriate paint device.
~QWindowsDirect2DBackingStore()
QImage toImage() const override
Implemented in subclasses to return the content of the backingstore as a QImage.
static QWindowsDirect2DPlatformPixmap * platformPixmap(QPixmap *p)
static QWindowsDirect2DWindow * nativeWindow(QWindow *window)
static QWindowsDirect2DBitmap * bitmap(QPixmap *p)