diff --git a/libkwineffects/kwinxrenderutils.cpp b/libkwineffects/kwinxrenderutils.cpp index 84d51d9236..aa03cb6990 100644 --- a/libkwineffects/kwinxrenderutils.cpp +++ b/libkwineffects/kwinxrenderutils.cpp @@ -75,10 +75,10 @@ XRenderPicture xRenderBlendPicture(double opacity) // XRenderFind(Standard)Format() is a roundtrip, so cache the results static XRenderPictFormat* renderformats[ 33 ]; -static Picture createPicture(Pixmap pix, int depth) +static xcb_render_picture_t createPicture(xcb_pixmap_t pix, int depth) { - if (pix == None) - return None; + if (pix == XCB_PIXMAP_NONE) + return XCB_RENDER_PICTURE_NONE; if (renderformats[ depth ] == NULL) { switch(depth) { case 1: @@ -131,7 +131,7 @@ XRenderPicture::XRenderPicture(QPixmap pix) xcb_free_pixmap(connection(), xpix); } -XRenderPicture::XRenderPicture(Pixmap pix, int depth) +XRenderPicture::XRenderPicture(xcb_pixmap_t pix, int depth) : d(new XRenderPictureData(createPicture(pix, depth))) { } diff --git a/libkwineffects/kwinxrenderutils.h b/libkwineffects/kwinxrenderutils.h index 2037dcca3c..b8c47818c5 100644 --- a/libkwineffects/kwinxrenderutils.h +++ b/libkwineffects/kwinxrenderutils.h @@ -49,11 +49,11 @@ class KWIN_EXPORT XRenderPictureData : public QSharedData { public: - explicit XRenderPictureData(Picture pic = None); + explicit XRenderPictureData(xcb_render_picture_t pic = XCB_RENDER_PICTURE_NONE); ~XRenderPictureData(); - Picture value(); + xcb_render_picture_t value(); private: - Picture picture; + xcb_render_picture_t picture; Q_DISABLE_COPY(XRenderPictureData) }; @@ -67,11 +67,11 @@ private: class KWIN_EXPORT XRenderPicture { public: - explicit XRenderPicture(Picture pic = None); + explicit XRenderPicture(xcb_render_picture_t pic = XCB_RENDER_PICTURE_NONE); // TODO: Qt5 - replace QPixmap by QImage to make it more obvious that it uses PutImage explicit XRenderPicture(QPixmap pix); - XRenderPicture(Pixmap pix, int depth); - operator Picture(); + XRenderPicture(xcb_pixmap_t pix, int depth); + operator xcb_render_picture_t(); private: KSharedPtr< XRenderPictureData > d; }; @@ -88,7 +88,7 @@ private: }; inline -XRenderPictureData::XRenderPictureData(Picture pic) +XRenderPictureData::XRenderPictureData(xcb_render_picture_t pic) : picture(pic) { } @@ -96,24 +96,24 @@ XRenderPictureData::XRenderPictureData(Picture pic) inline XRenderPictureData::~XRenderPictureData() { - if (picture != None) - XRenderFreePicture(display(), picture); + if (picture != XCB_RENDER_PICTURE_NONE) + xcb_render_free_picture(connection(), picture); } inline -Picture XRenderPictureData::value() +xcb_render_picture_t XRenderPictureData::value() { return picture; } inline -XRenderPicture::XRenderPicture(Picture pic) +XRenderPicture::XRenderPicture(xcb_render_picture_t pic) : d(new XRenderPictureData(pic)) { } inline -XRenderPicture::operator Picture() +XRenderPicture::operator xcb_render_picture_t() { return d->value(); }