Bug 808305 - Pass a gfx::Rect instead of a gfxRect in InvalidateCanvasContent; r=Bas

This commit is contained in:
Ms2ger 2012-11-04 09:05:25 +01:00
parent ee963a3a4e
commit 25935ac099
3 changed files with 14 additions and 10 deletions

View File

@ -792,10 +792,7 @@ CanvasRenderingContext2D::Redraw(const mgfx::Rect &r)
nsSVGEffects::InvalidateDirectRenderingObservers(mCanvasElement);
gfxRect tmpR = ThebesRect(r);
mCanvasElement->InvalidateCanvasContent(&tmpR);
return;
mCanvasElement->InvalidateCanvasContent(&r);
}
void

View File

@ -23,10 +23,16 @@ class nsITimerCallback;
class nsIPropertyBag;
namespace mozilla {
namespace layers {
class CanvasLayer;
class LayerManager;
}
namespace gfx {
struct Rect;
}
}
class nsHTMLCanvasElement : public nsGenericHTMLElement,
@ -85,7 +91,7 @@ public:
* Notify that some canvas content has changed and the window may
* need to be updated. aDamageRect is in canvas coordinates.
*/
void InvalidateCanvasContent(const gfxRect* aDamageRect);
void InvalidateCanvasContent(const mozilla::gfx::Rect* aDamageRect);
/*
* Notify that we need to repaint the entire canvas, including updating of
* the layer tree.

View File

@ -8,6 +8,9 @@
#include "mozilla/Base64.h"
#include "mozilla/CheckedInt.h"
#include "mozilla/gfx/Rect.h"
#include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "nsNetUtil.h"
#include "nsDOMFile.h"
@ -21,8 +24,6 @@
#include "nsJSUtils.h"
#include "nsMathUtils.h"
#include "nsStreamUtils.h"
#include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "nsFrameManager.h"
#include "nsDisplayList.h"
@ -889,7 +890,7 @@ nsHTMLCanvasElement::SetWriteOnly()
}
void
nsHTMLCanvasElement::InvalidateCanvasContent(const gfxRect* damageRect)
nsHTMLCanvasElement::InvalidateCanvasContent(const gfx::Rect* damageRect)
{
// We don't need to flush anything here; if there's no frame or if
// we plan to reframe we don't need to invalidate it anyway.
@ -904,10 +905,10 @@ nsHTMLCanvasElement::InvalidateCanvasContent(const gfxRect* damageRect)
nsIntSize size = GetWidthHeight();
if (size.width != 0 && size.height != 0) {
gfxRect realRect(*damageRect);
gfx::Rect realRect(*damageRect);
realRect.RoundOut();
// then make it a nsRect
// then make it a nsIntRect
nsIntRect invalRect(realRect.X(), realRect.Y(),
realRect.Width(), realRect.Height());