зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1854467 - Avoid using ExtractSubrect with OffscreenCanvas. r=gfx-reviewers,jrmuizel
With OffscreenCanvas, mCanvasElement may be null, so we need to check for that case when deciding whether or not we need to use ExtractSubrect when calling DrawImage. Differential Revision: https://phabricator.services.mozilla.com/D188877
This commit is contained in:
Родитель
163fd5a55a
Коммит
f475176d43
|
@ -5461,7 +5461,8 @@ void CanvasRenderingContext2D::DrawImage(const CanvasImageSource& aImage,
|
|||
|
||||
if (srcSurf) {
|
||||
gfx::Rect sourceRect(aSx, aSy, aSw, aSh);
|
||||
if (element == mCanvasElement) {
|
||||
if ((element && element == mCanvasElement) ||
|
||||
(offscreenCanvas && offscreenCanvas == mOffscreenCanvas)) {
|
||||
// srcSurf is a snapshot of mTarget. If we draw to mTarget now, we'll
|
||||
// trigger a COW copy of the whole canvas into srcSurf. That's a huge
|
||||
// waste if sourceRect doesn't cover the whole canvas.
|
||||
|
|
Загрузка…
Ссылка в новой задаче