Back out changeset aa4791e4dad9 (Bug 529386 - optimize canvas.width = canvas.width) to fix orange.

This commit is contained in:
Peter Van der Beken 2010-01-14 12:59:53 +01:00
Родитель 306469ad68
Коммит 0927783cce
1 изменённых файлов: 2 добавлений и 4 удалений

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

@ -842,10 +842,6 @@ nsCanvasRenderingContext2D::Redraw(const gfxRect& r)
NS_IMETHODIMP
nsCanvasRenderingContext2D::SetDimensions(PRInt32 width, PRInt32 height)
{
// Avoid creating a new surface if the dimensions are not changing
if (mWidth == width && mHeight == height)
return InitializeWithSurface(NULL, mSurface, width, height);
Destroy();
nsRefPtr<gfxASurface> surface;
@ -868,6 +864,8 @@ nsCanvasRenderingContext2D::SetDimensions(PRInt32 width, PRInt32 height)
NS_IMETHODIMP
nsCanvasRenderingContext2D::InitializeWithSurface(nsIDocShell *docShell, gfxASurface *surface, PRInt32 width, PRInt32 height) {
Destroy();
NS_ASSERTION(!docShell ^ !mCanvasElement, "Cannot set both docshell and canvas element");
mDocShell = docShell;