Bug 1631476 - Don't let CanvasRenderingContext2D::EnsureTarget lead to frame capture. r=nical

Differential Revision: https://phabricator.services.mozilla.com/D93066
This commit is contained in:
Andreas Pehrson 2020-10-19 07:48:32 +00:00
Родитель 7449686f82
Коммит 9501bbf843
1 изменённых файлов: 3 добавлений и 0 удалений

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

@ -1316,9 +1316,12 @@ bool CanvasRenderingContext2D::EnsureTarget(const gfx::Rect* aCoveredRect,
if (mCanvasElement) {
mCanvasElement->InvalidateCanvas();
}
// EnsureTarget hasn't drawn anything. Preserve mIsCapturedFrameInvalid.
bool capturedFrameInvalid = mIsCapturedFrameInvalid;
// Calling Redraw() tells our invalidation machinery that the entire
// canvas is already invalid, which can speed up future drawing.
Redraw();
mIsCapturedFrameInvalid = capturedFrameInvalid;
return true;
}