diff --git a/libkwineffects/kwinxrenderutils.cpp b/libkwineffects/kwinxrenderutils.cpp index cfd3bc5859..270474f581 100644 --- a/libkwineffects/kwinxrenderutils.cpp +++ b/libkwineffects/kwinxrenderutils.cpp @@ -110,13 +110,18 @@ static xcb_render_picture_t createPicture(xcb_pixmap_t pix, int depth) XRenderPicture::XRenderPicture(const QPixmap &pix) { if (Extensions::nonNativePixmaps()) { - XRenderPicture(pix.toImage()); + fromImage(pix.toImage()); } else { d = new XRenderPictureData(createPicture(pix.handle(), pix.depth())); } } XRenderPicture::XRenderPicture(const QImage &img) +{ + fromImage(img); +} + +void XRenderPicture::fromImage(const QImage &img) { const int depth = img.depth(); xcb_pixmap_t xpix = xcb_generate_id(connection()); diff --git a/libkwineffects/kwinxrenderutils.h b/libkwineffects/kwinxrenderutils.h index a02028d766..697c82d691 100644 --- a/libkwineffects/kwinxrenderutils.h +++ b/libkwineffects/kwinxrenderutils.h @@ -74,6 +74,7 @@ public: XRenderPicture(xcb_pixmap_t pix, int depth); operator xcb_render_picture_t(); private: + void fromImage(const QImage &img); KSharedPtr< XRenderPictureData > d; };