Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwindowsdirect2dwindow.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QWINDOWSDIRECT2DWINDOW_H
5#define QWINDOWSDIRECT2DWINDOW_H
6
8#include <QtCore/private/qcomptr_p.h>
9
10struct IDXGISwapChain1;
11struct ID2D1DeviceContext;
12
13QT_BEGIN_NAMESPACE
14
15class QWindowsDirect2DBitmap;
16
18{
19public:
20 QWindowsDirect2DWindow(QWindow *window, const QWindowsWindowData &data);
22
23 void setWindowFlags(Qt::WindowFlags flags) override;
24
25 QPixmap *pixmap();
26 void flush(QWindowsDirect2DBitmap *bitmap, const QRegion &region, const QPoint &offset);
27 void present(const QRegion &region);
28 void setupSwapChain();
29 void resizeSwapChain(const QSize &size);
30
32
33private:
34 void setupBitmap();
35
36private:
37 ComPtr<IDXGISwapChain1> m_swapChain;
38 ComPtr<ID2D1DeviceContext> m_deviceContext;
39 QScopedPointer<QWindowsDirect2DBitmap> m_bitmap;
40 QScopedPointer<QPixmap> m_pixmap;
41 bool m_needsFullFlush = true;
42 bool m_directRendering = false;
43};
44
45QT_END_NAMESPACE
46
47#endif // QWINDOWSDIRECT2DWINDOW_H
\inmodule QtCore\reentrant
Definition qpoint.h:29
void resize(const QSize &size, const QRegion &staticContents) override
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.
void flush(QWindow *targetWindow, const QRegion &region, const QPoint &offset) override
Flushes the given region from the specified window.
QPaintDevice * paintDevice() 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.
QWindowsDirect2DDeviceContext * deviceContext() const
void fill(const QColor &color)
ID2D1Bitmap1 * bitmap() const
QWindowsDirect2DBitmap(ID2D1Bitmap1 *bitmap, ID2D1DeviceContext *dc)
bool resize(int width, int height)
bool fromImage(const QImage &image, Qt::ImageConversionFlags flags)
QImage toImage(const QRect &rect=QRect())
ID2D1Factory1 * d2dFactory() const
IDXGIFactory2 * dxgiFactory() const
IDWriteGdiInterop * dwriteGdiInterop() const
ID3D11DeviceContext * d3dDeviceContext() const
IDWriteFactory * dwriteFactory() const
static QWindowsDirect2DContext * instance()
QWindowsDirect2DDeviceContextSuspender(QWindowsDirect2DDeviceContext *dc)
QWindowsDirect2DDeviceContext(ID2D1DeviceContext *dc)
static QWindowsDirect2DIntegration * create(const QStringList &paramList)
QWindowsWindow * createPlatformWindowHelper(QWindow *window, const QWindowsWindowData &) const override
QPlatformNativeInterface * nativeInterface() const override
QWindowsDirect2DContext * direct2DContext() const
QPlatformPixmap * createPlatformPixmap(QPlatformPixmap::PixelType type) const override
Factory function for QPlatformPixmap.
QPlatformBackingStore * createPlatformBackingStore(QWindow *window) const override
Factory function for QPlatformBackingStore.
static QWindowsDirect2DIntegration * instance()
QPaintEngine * paintEngine() const override
int metric(PaintDeviceMetric metric) const override
QWindowsDirect2DPaintEngineSuspender(QWindowsDirect2DPaintEngine *engine)
void fillRect(const QRectF &rect, const QBrush &brush) override
Type type() const override
Reimplement this function to return the paint engine \l{Type}.
void stroke(ID2D1Geometry *geometry, const QPen &pen)
void fill(ID2D1Geometry *geometry, const QBrush &brush)
void drawRects(const QRect *rects, int rectCount) override
This is an overloaded member function, provided for convenience. It differs from the above function o...
void draw(const QVectorPath &path) override
void drawEllipse(const QRectF &r) override
Reimplement this function to draw the largest ellipse that can be contained within rectangle rect.
void drawTextItem(const QPointF &p, const QTextItem &textItem) override
This function draws the text item textItem at position p.
void setState(QPainterState *s) override
void stroke(const QVectorPath &path, const QPen &pen) override
void drawStaticTextItem(QStaticTextItem *staticTextItem) override
void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override
Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r.
void fill(const QVectorPath &path, const QBrush &brush) override
void clip(const QVectorPath &path, Qt::ClipOperation op) override
bool end() override
Reimplement this function to finish painting on the current paint device.
void drawImage(const QRectF &rectangle, const QImage &image, const QRectF &sr, Qt::ImageConversionFlags flags=Qt::AutoColor) override
Reimplement this function to draw the part of the image specified by the sr rectangle in the given re...
bool begin(QPaintDevice *pdev) override
Reimplement this function to initialise your paint engine when painting is to start on the paint devi...
QImage toImage(const QRect &rect) const override
void fromImage(const QImage &image, Qt::ImageConversionFlags flags) override
void resize(int width, int height) override
QWindowsDirect2DPlatformPixmap(PixelType pixelType, QWindowsDirect2DPaintEngine::Flags flags, QWindowsDirect2DBitmap *bitmap)
void setDevicePixelRatio(qreal scaleFactor) override
void fill(const QColor &color) override
QPaintEngine * paintEngine() const override
int metric(QPaintDevice::PaintDeviceMetric metric) const override
QWindowsDirect2DWindow(QWindow *window, const QWindowsWindowData &data)
void setWindowFlags(Qt::WindowFlags flags) override
Requests setting the window flags of this surface to flags.
void present(const QRegion &region)
QSharedPointer< QWindowsDirect2DBitmap > copyBackBuffer() const
void flush(QWindowsDirect2DBitmap *bitmap, const QRegion &region, const QPoint &offset)
void resizeSwapChain(const QSize &size)
Raster or OpenGL Window.
static QWindowsDirect2DPlatformPixmap * platformPixmap(QPixmap *p)
static QWindowsDirect2DWindow * nativeWindow(QWindow *window)
static QWindowsDirect2DBitmap * bitmap(QPixmap *p)