зеркало из https://github.com/mozilla/gecko-dev.git
Bug 503177. Don't assert when invalidating on dirty geometry from canvas. r+sr=roc
This commit is contained in:
Родитель
8a8c7231cb
Коммит
edd4d9594a
|
@ -59,6 +59,8 @@
|
|||
|
||||
#include "nsICanvasRenderingContextInternal.h"
|
||||
|
||||
#include "nsLayoutUtils.h"
|
||||
|
||||
#define DEFAULT_CANVAS_WIDTH 300
|
||||
#define DEFAULT_CANVAS_HEIGHT 150
|
||||
|
||||
|
@ -544,7 +546,14 @@ nsHTMLCanvasElement::SetWriteOnly()
|
|||
NS_IMETHODIMP
|
||||
nsHTMLCanvasElement::InvalidateFrame()
|
||||
{
|
||||
nsIFrame *frame = GetPrimaryFrame(Flush_Frames);
|
||||
nsIDocument* doc = GetCurrentDoc();
|
||||
if (!doc) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// 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.
|
||||
nsIFrame *frame = GetPrimaryFrameFor(this, doc);
|
||||
if (frame) {
|
||||
nsRect r = frame->GetRect();
|
||||
r.x = r.y = 0;
|
||||
|
@ -557,8 +566,20 @@ nsHTMLCanvasElement::InvalidateFrame()
|
|||
NS_IMETHODIMP
|
||||
nsHTMLCanvasElement::InvalidateFrameSubrect(const gfxRect& damageRect)
|
||||
{
|
||||
nsIFrame *frame = GetPrimaryFrame(Flush_Frames);
|
||||
nsIDocument* doc = GetCurrentDoc();
|
||||
if (!doc) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// 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.
|
||||
nsIFrame *frame = GetPrimaryFrameFor(this, doc);
|
||||
if (frame) {
|
||||
// Frame might be dirty, but we don't care about that; if the geometry
|
||||
// changes the right invalidates will happen anyway. Don't assert on our
|
||||
// geometry getters.
|
||||
nsAutoDisableGetUsedXAssertions noAssert;
|
||||
|
||||
nsRect contentArea(frame->GetContentRect());
|
||||
nsIntSize size = GetWidthHeight();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче