From 0927783cce2e2d66a795641c1630cba2bd3bff1c Mon Sep 17 00:00:00 2001 From: Peter Van der Beken Date: Thu, 14 Jan 2010 12:59:53 +0100 Subject: [PATCH] Back out changeset aa4791e4dad9 (Bug 529386 - optimize canvas.width = canvas.width) to fix orange. --- content/canvas/src/nsCanvasRenderingContext2D.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/content/canvas/src/nsCanvasRenderingContext2D.cpp b/content/canvas/src/nsCanvasRenderingContext2D.cpp index d18ae59d3919..94de64c19a33 100644 --- a/content/canvas/src/nsCanvasRenderingContext2D.cpp +++ b/content/canvas/src/nsCanvasRenderingContext2D.cpp @@ -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 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;