зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1109263 - Clamp the reftest drawWindow call to the canvas. r=dbaron
In some cases the area reported by MozAfterPaint can be extremely large. Since that area determines what we pass to drawWindow, we could end up trying to drawWindow an area that is too large for drawWindow to handle. Instead, this patch clamps that area to the canvas size so that we don't unnecessarily try to paint (and fail at painting) the whole invalid area.
This commit is contained in:
Родитель
0ea8e1da1f
Коммит
239293451e
|
@ -1480,6 +1480,12 @@ function UpdateCurrentCanvasForInvalidation(rects)
|
|||
var right = Math.ceil(r.right);
|
||||
var bottom = Math.ceil(r.bottom);
|
||||
|
||||
// Clamp the values to the canvas size
|
||||
left = Math.max(0, Math.min(left, gCurrentCanvas.width));
|
||||
top = Math.max(0, Math.min(top, gCurrentCanvas.height));
|
||||
right = Math.max(0, Math.min(right, gCurrentCanvas.width));
|
||||
bottom = Math.max(0, Math.min(bottom, gCurrentCanvas.height));
|
||||
|
||||
ctx.save();
|
||||
ctx.translate(left, top);
|
||||
DoDrawWindow(ctx, left, top, right - left, bottom - top);
|
||||
|
|
Загрузка…
Ссылка в новой задаче