fix for animations on linux r=saari sr=waterson bug 73342

This commit is contained in:
pavlov%netscape.com 2001-03-30 08:42:23 +00:00
Родитель 9db6d943f5
Коммит 43c50123d1
1 изменённых файлов: 16 добавлений и 5 удалений

Просмотреть файл

@ -1546,7 +1546,8 @@ nsImageGTK::SetDecodedRect(PRInt32 x1, PRInt32 y1, PRInt32 x2, PRInt32 y2 )
} }
#ifdef USE_IMG2 #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) nscoord aDWidth, nscoord aDHeight)
{ {
nsImageGTK *dest = NS_STATIC_CAST(nsImageGTK *, aDstImage); nsImageGTK *dest = NS_STATIC_CAST(nsImageGTK *, aDstImage);
@ -1554,20 +1555,30 @@ NS_IMETHODIMP nsImageGTK::DrawToImage(nsIImage* aDstImage, nscoord aDX, nscoord
if (!dest) if (!dest)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
if (!dest->mImagePixmap) if (!dest->mImagePixmap) {
dest->CreateOffscreenPixmap(dest->mWidth, dest->mHeight);
}
if (!dest->mImagePixmap) {
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
}
if (!mImagePixmap) if (!mImagePixmap)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
// XXX copy the mask too :-)
GdkGC *gc = gdk_gc_new(dest->mImagePixmap); 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, gdk_window_copy_area(dest->mImagePixmap, gc,
aDX, aDY, aDX, aDY,
mImagePixmap, mImagePixmap,
0, 0, aDWidth, aDHeight); 0, 0, mWidth, mHeight);
gdk_gc_unref(gc); gdk_gc_unref(gc);