diff options
author | Louai Al-Khanji <louai.al-khanji@digia.com> | 2014-04-30 10:27:57 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-05 14:13:50 +0200 |
commit | ac448335f177eff59465300a7141db559c9eadad (patch) | |
tree | a70d815ba5cb629e1b2f41a29673b58f98036107 /src/plugins/platforms/direct2d/qwindowsdirect2dbackingstore.h | |
parent | 89b70f3910dfec7108d6e95cc96f904fce01da29 (diff) |
Direct2D QPA: Draw directly to swap chain
Remove the intermediate pixmap in the backing store and draw directly to
the window swap chain. This is faster and reduces memory pressure on the
graphics card.
In case of native child widgets we need to read back the back buffer,
which incurs an extra copy in this case.
In an artificial benchmark drawing animated full screen
gradients as fast as possible this patch increases performance by 42% on
my current machine from 480fps to around 680fps, i.e. the time for
actually getting the pixels to the screen is now lower.
Change-Id: Ifbeda0e199afec03cecfe76337679a9e9d082bdd
Reviewed-by: Risto Avila <risto.avila@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Diffstat (limited to 'src/plugins/platforms/direct2d/qwindowsdirect2dbackingstore.h')
-rw-r--r-- | src/plugins/platforms/direct2d/qwindowsdirect2dbackingstore.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dbackingstore.h b/src/plugins/platforms/direct2d/qwindowsdirect2dbackingstore.h index fc6802aaa2..71e9437274 100644 --- a/src/plugins/platforms/direct2d/qwindowsdirect2dbackingstore.h +++ b/src/plugins/platforms/direct2d/qwindowsdirect2dbackingstore.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the plugins of the Qt Toolkit. @@ -50,6 +50,8 @@ QT_BEGIN_NAMESPACE +class QWindowsDirect2DWindow; + class QWindowsDirect2DBackingStore : public QPlatformBackingStore { Q_DISABLE_COPY(QWindowsDirect2DBackingStore) @@ -62,11 +64,8 @@ public: void endPaint(); QPaintDevice *paintDevice() Q_DECL_OVERRIDE; - void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) Q_DECL_OVERRIDE; + void flush(QWindow *targetWindow, const QRegion ®ion, const QPoint &offset) Q_DECL_OVERRIDE; void resize(const QSize &size, const QRegion &staticContents) Q_DECL_OVERRIDE; - -private: - QScopedPointer<QPixmap> m_pixmap; }; QT_END_NAMESPACE |