diff options
author | Louai Al-Khanji <louai.al-khanji@qt.io> | 2017-01-06 15:15:54 -0800 |
---|---|---|
committer | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2017-04-21 10:56:02 +0000 |
commit | 07942adb77f60738a6043665673d51fc7991233b (patch) | |
tree | 6a94958d0b02d7b2149fa00b1047297370737831 /src/gui | |
parent | 7be9653f1288d32bc732262b01ba910f6a321ecd (diff) |
xcb: Add experimental legacy support for native X11 painting
This commit revives the old native QPixmap and QPaintEngine
implementations that were present in Qt4. The backing store supports
regular raster windows in this commit. Support for render-to-texture
widgets and OpenGL compositing will be added in a follow-up commit.
Change-Id: I80a9c4f0c42a6f68f571dfee930d95000d5dd950
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/configure.json | 22 | ||||
-rw-r--r-- | src/gui/image/qplatformpixmap.h | 5 | ||||
-rw-r--r-- | src/gui/painting/qbrush.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine.cpp | 4 |
4 files changed, 27 insertions, 6 deletions
diff --git a/src/gui/configure.json b/src/gui/configure.json index 854b187eb6..1e873d3709 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -40,6 +40,7 @@ "tslib": "boolean", "vulkan": "boolean", "xcb": { "type": "enum", "values": [ "no", "yes", "qt", "system" ] }, + "xcb-native-painting": "boolean", "xcb-xlib": "boolean", "xinput2": "boolean", "xkb": "boolean", @@ -305,6 +306,13 @@ "sources": [ { "type": "pkgConfig", "args": "xkbcommon xkbcommon-x11 >= 0.4.1" } ] + }, + "xrender": { + "label": "XRender for native painting", + "test": "x11/xrender", + "sources": [ + "-lXrender" + ] } }, @@ -755,6 +763,18 @@ "condition": "libs.xcb_glx", "output": [ "privateFeature" ] }, + "xcb-native-painting": { + "label": "Native painting (experimental)", + "emitIf": "features.xcb", + "condition": "features.xcb-xlib && libs.xrender", + "output": [ "privateFeature" ] + }, + "xrender": { + "label": "XRender for native painting", + "emitIf": "features.xcb && features.xcb-native-painting", + "condition": "features.xcb-native-painting", + "output": [ "privateFeature" ] + }, "xcb-render": { "label": "XCB render", "emitIf": "features.xcb", @@ -1145,7 +1165,7 @@ QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your pla "section": "X11", "condition": "features.xcb", "entries": [ - "system-xcb", "egl_x11", "xinput2", "xkb", "xlib", "xcb-render", "xcb-glx", "xcb-xlib", "xkbcommon-system" + "system-xcb", "egl_x11", "xinput2", "xkb", "xlib", "xcb-render", "xcb-glx", "xcb-xlib", "xkbcommon-system", "xcb-native-painting" ] }, { diff --git a/src/gui/image/qplatformpixmap.h b/src/gui/image/qplatformpixmap.h index 1857856b07..7635ac2949 100644 --- a/src/gui/image/qplatformpixmap.h +++ b/src/gui/image/qplatformpixmap.h @@ -69,7 +69,7 @@ public: enum ClassId { RasterClass, DirectFBClass, BlitterClass, Direct2DClass, - CustomClass = 1024 }; + X11Class, CustomClass = 1024 }; QPlatformPixmap(PixelType pixelType, int classId); virtual ~QPlatformPixmap(); @@ -147,6 +147,7 @@ protected: private: friend class QPixmap; + friend class QX11PlatformPixmap; friend class QImagePixmapCleanupHooks; // Needs to set is_cached friend class QOpenGLTextureCache; //Needs to check the reference count friend class QExplicitlySharedDataPointer<QPlatformPixmap>; @@ -162,7 +163,7 @@ private: # define QT_XFORM_TYPE_MSBFIRST 0 # define QT_XFORM_TYPE_LSBFIRST 1 -extern bool qt_xForm_helper(const QTransform&, int, int, int, uchar*, int, int, int, const uchar*, int, int, int); +Q_GUI_EXPORT bool qt_xForm_helper(const QTransform&, int, int, int, uchar*, int, int, int, const uchar*, int, int, int); QT_END_NAMESPACE diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp index cc3ee76f0d..5c13308d94 100644 --- a/src/gui/painting/qbrush.cpp +++ b/src/gui/painting/qbrush.cpp @@ -100,7 +100,7 @@ const uchar *qt_patternForBrush(int brushStyle, bool invert) return pat_tbl[brushStyle - Qt::Dense1Pattern][invert]; } -QPixmap qt_pixmapForBrush(int brushStyle, bool invert) +Q_GUI_EXPORT QPixmap qt_pixmapForBrush(int brushStyle, bool invert) { QPixmap pm; diff --git a/src/gui/painting/qpaintengine.cpp b/src/gui/painting/qpaintengine.cpp index 5fc5d5364e..f42fd4ff87 100644 --- a/src/gui/painting/qpaintengine.cpp +++ b/src/gui/painting/qpaintengine.cpp @@ -547,8 +547,8 @@ void qt_fill_tile(QPixmap *tile, const QPixmap &pixmap) } } -void qt_draw_tile(QPaintEngine *gc, qreal x, qreal y, qreal w, qreal h, - const QPixmap &pixmap, qreal xOffset, qreal yOffset) +Q_GUI_EXPORT void qt_draw_tile(QPaintEngine *gc, qreal x, qreal y, qreal w, qreal h, + const QPixmap &pixmap, qreal xOffset, qreal yOffset) { qreal yPos, xPos, drawH, drawW, yOff, xOff; yPos = y; |