add XRenderPicture(QImage) constructor

was implicitly present for QPixmap::toImage

REVIEW: 111878
This commit is contained in:
Thomas Lübking 2013-08-04 14:50:25 +02:00
parent 18f8493dee
commit e9e73f1134
2 changed files with 8 additions and 3 deletions

View file

@ -109,11 +109,15 @@ static xcb_render_picture_t createPicture(xcb_pixmap_t pix, int depth)
XRenderPicture::XRenderPicture(const QPixmap &pix)
{
if (!Extensions::nonNativePixmaps()) {
if (Extensions::nonNativePixmaps()) {
XRenderPicture(pix.toImage());
} else {
d = new XRenderPictureData(createPicture(pix.handle(), pix.depth()));
return;
}
QImage img(pix.toImage());
}
XRenderPicture::XRenderPicture(const QImage &img)
{
const int depth = img.depth();
xcb_pixmap_t xpix = xcb_generate_id(connection());
xcb_create_pixmap(connection(), depth, xpix, rootWindow(), img.width(), img.height());

View file

@ -70,6 +70,7 @@ public:
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(const QPixmap &pix);
explicit XRenderPicture(const QImage &img);
XRenderPicture(xcb_pixmap_t pix, int depth);
operator xcb_render_picture_t();
private: