зеркало из https://github.com/mozilla/pjs.git
fix for animations on linux r=saari sr=waterson bug 73342
This commit is contained in:
Родитель
9db6d943f5
Коммит
43c50123d1
|
@ -1546,7 +1546,8 @@ nsImageGTK::SetDecodedRect(PRInt32 x1, PRInt32 y1, PRInt32 x2, PRInt32 y2 )
|
|||
}
|
||||
|
||||
#ifdef USE_IMG2
|
||||
NS_IMETHODIMP nsImageGTK::DrawToImage(nsIImage* aDstImage, nscoord aDX, nscoord aDY,
|
||||
NS_IMETHODIMP nsImageGTK::DrawToImage(nsIImage* aDstImage,
|
||||
nscoord aDX, nscoord aDY,
|
||||
nscoord aDWidth, nscoord aDHeight)
|
||||
{
|
||||
nsImageGTK *dest = NS_STATIC_CAST(nsImageGTK *, aDstImage);
|
||||
|
@ -1554,20 +1555,30 @@ NS_IMETHODIMP nsImageGTK::DrawToImage(nsIImage* aDstImage, nscoord aDX, nscoord
|
|||
if (!dest)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
if (!dest->mImagePixmap)
|
||||
if (!dest->mImagePixmap) {
|
||||
dest->CreateOffscreenPixmap(dest->mWidth, dest->mHeight);
|
||||
}
|
||||
|
||||
if (!dest->mImagePixmap) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (!mImagePixmap)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
// XXX copy the mask too :-)
|
||||
|
||||
GdkGC *gc = gdk_gc_new(dest->mImagePixmap);
|
||||
|
||||
if (mAlphaDepth == 1)
|
||||
CreateAlphaBitmap(mWidth, mHeight);
|
||||
|
||||
if (mAlphaPixmap) {
|
||||
SetupGCForAlpha(gc, 0, 0);
|
||||
}
|
||||
|
||||
gdk_window_copy_area(dest->mImagePixmap, gc,
|
||||
aDX, aDY,
|
||||
mImagePixmap,
|
||||
0, 0, aDWidth, aDHeight);
|
||||
0, 0, mWidth, mHeight);
|
||||
|
||||
gdk_gc_unref(gc);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче