Fixed bug #1362913, did not check format pointer.
This commit is contained in:
parent
fde970a21d
commit
06320420a5
1 changed files with 26 additions and 11 deletions
|
@ -52,7 +52,9 @@ Picture createAlphaPic(Window drawable, unsigned char alpha) {
|
||||||
PictFormatDepth | PictFormatAlphaMask,
|
PictFormatDepth | PictFormatAlphaMask,
|
||||||
&pic_format, 0);
|
&pic_format, 0);
|
||||||
if (format == 0) {
|
if (format == 0) {
|
||||||
cerr<<"FbTk::Transparent: "<<_FBTK_CONSOLETEXT(Error, NoRenderFormat, "Warning: Failed to find valid format for alpha.", "transparency requires a pict format, can't get one...")<<endl;
|
cerr<<"FbTk::Transparent: "<<_FBTK_CONSOLETEXT(Error, NoRenderFormat,
|
||||||
|
"Warning: Failed to find valid format for alpha.",
|
||||||
|
"transparency requires a pict format, can't get one...")<<endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +62,9 @@ Picture createAlphaPic(Window drawable, unsigned char alpha) {
|
||||||
Pixmap alpha_pm = XCreatePixmap(disp, drawable,
|
Pixmap alpha_pm = XCreatePixmap(disp, drawable,
|
||||||
1, 1, 8);
|
1, 1, 8);
|
||||||
if (alpha_pm == 0) {
|
if (alpha_pm == 0) {
|
||||||
cerr<<"FbTk::Transparent: "<<_FBTK_CONSOLETEXT(Error, NoRenderPixmap, "Warning: Failed to create alpha pixmap.", "XCreatePixmap failed for our transparency pixmap")<<endl;
|
cerr<<"FbTk::Transparent: "<<_FBTK_CONSOLETEXT(Error, NoRenderPixmap,
|
||||||
|
"Warning: Failed to create alpha pixmap.",
|
||||||
|
"XCreatePixmap failed for our transparency pixmap")<<endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +75,9 @@ Picture createAlphaPic(Window drawable, unsigned char alpha) {
|
||||||
format, CPRepeat, &attr);
|
format, CPRepeat, &attr);
|
||||||
if (alpha_pic == 0) {
|
if (alpha_pic == 0) {
|
||||||
XFreePixmap(disp, alpha_pm);
|
XFreePixmap(disp, alpha_pm);
|
||||||
cerr<<"FbTk::Transparent: "<<_FBTK_CONSOLETEXT(Error, NoRenderPicture, "Warning: Failed to create alpha picture.", "XRenderCreatePicture failed")<<endl;
|
cerr<<"FbTk::Transparent: "<<_FBTK_CONSOLETEXT(Error, NoRenderPicture,
|
||||||
|
"Warning: Failed to create alpha picture.",
|
||||||
|
"XRenderCreatePicture failed")<<endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,11 +240,16 @@ void Transparent::setDest(Drawable dest, int screen_num) {
|
||||||
if (format == 0) {
|
if (format == 0) {
|
||||||
_FB_USES_NLS;
|
_FB_USES_NLS;
|
||||||
cerr<<"FbTk::Transparent: ";
|
cerr<<"FbTk::Transparent: ";
|
||||||
fprintf(stderr, _FBTK_CONSOLETEXT(Error, NoRenderVisualFormat, "Failed to find format for screen(%d)", "XRenderFindVisualFormat failed... include %d for screen number").c_str(), screen_num);
|
fprintf(stderr,
|
||||||
cerr<<endl;
|
_FBTK_CONSOLETEXT(Error, NoRenderVisualFormat,
|
||||||
}
|
"Failed to find format for screen(%d)",
|
||||||
m_dest_pic = XRenderCreatePicture(disp, dest, format, 0, 0);
|
"XRenderFindVisualFormat failed... include %d for screen number").
|
||||||
|
c_str(), screen_num);
|
||||||
|
|
||||||
|
cerr<<endl;
|
||||||
|
} else {
|
||||||
|
m_dest_pic = XRenderCreatePicture(disp, dest, format, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
m_dest = dest;
|
m_dest = dest;
|
||||||
|
@ -273,11 +284,15 @@ void Transparent::setSource(Drawable source, int screen_num) {
|
||||||
if (format == 0) {
|
if (format == 0) {
|
||||||
_FB_USES_NLS;
|
_FB_USES_NLS;
|
||||||
cerr<<"FbTk::Transparent: ";
|
cerr<<"FbTk::Transparent: ";
|
||||||
fprintf(stderr, _FBTK_CONSOLETEXT(Error, NoRenderVisualFormat, "Failed to find format for screen(%d)", "XRenderFindVisualFormat failed... include %d for screen number").c_str(), screen_num);
|
fprintf(stderr, _FBTK_CONSOLETEXT(Error, NoRenderVisualFormat,
|
||||||
|
"Failed to find format for screen(%d)",
|
||||||
|
"XRenderFindVisualFormat failed... include %d for screen number").
|
||||||
|
c_str(), screen_num);
|
||||||
cerr<<endl;
|
cerr<<endl;
|
||||||
|
} else {
|
||||||
|
m_src_pic = XRenderCreatePicture(disp, m_source, format,
|
||||||
|
0, 0);
|
||||||
}
|
}
|
||||||
m_src_pic = XRenderCreatePicture(disp, m_source, format,
|
|
||||||
0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// recreate new alpha
|
// recreate new alpha
|
||||||
|
|
Loading…
Reference in a new issue