зеркало из https://github.com/mozilla/gecko-dev.git
Pass back an error when allocating offscreen fails on GTK. bug=70424 r=pavlov@netscape.com, sr=attinasi@netscape.com
This commit is contained in:
Родитель
25161eec21
Коммит
fb44a17136
|
@ -265,6 +265,8 @@ NS_IMETHODIMP nsDrawingSurfaceGTK :: Init(GdkDrawable *aDrawable, GdkGC *aGC)
|
|||
gdk_image_destroy(mImage);
|
||||
mImage = nsnull;
|
||||
|
||||
g_return_val_if_fail(mPixmap != nsnull, NS_ERROR_FAILURE);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -779,6 +779,7 @@ NS_IMETHODIMP nsRenderingContextGTK::CreateDrawingSurface(nsRect *aBounds,
|
|||
g_return_val_if_fail (aBounds != NULL, NS_ERROR_FAILURE);
|
||||
g_return_val_if_fail ((aBounds->width > 0) && (aBounds->height > 0), NS_ERROR_FAILURE);
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
nsDrawingSurfaceGTK *surf = new nsDrawingSurfaceGTK();
|
||||
|
||||
if (surf)
|
||||
|
@ -786,12 +787,14 @@ NS_IMETHODIMP nsRenderingContextGTK::CreateDrawingSurface(nsRect *aBounds,
|
|||
NS_ADDREF(surf);
|
||||
if (!mGC)
|
||||
UpdateGC();
|
||||
surf->Init(mGC, aBounds->width, aBounds->height, aSurfFlags);
|
||||
rv = surf->Init(mGC, aBounds->width, aBounds->height, aSurfFlags);
|
||||
} else {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
aSurface = (nsDrawingSurface)surf;
|
||||
|
||||
return NS_OK;
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsRenderingContextGTK::DestroyDrawingSurface(nsDrawingSurface aDS)
|
||||
|
|
Загрузка…
Ссылка в новой задаче