-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick 83d967c. rdar://118497211
2D Context get/putImageData cache copies cached image data twice https://bugs.webkit.org/show_bug.cgi?id=264927 rdar://118497211 Reviewed by Cameron McCormack. Store the PixelBuffer that was used for putImageData, avoid copying the the ImageData redundantly. Instead of copying during caching, copy with premultiply. This way we omit one memcpy for caching and one premultiply for the real putImageData. To simplify the implementation, removes the conservative approach where the caching would kick in at 3rd putImageData. Just cache the first. * Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::cacheImageDataIfPossible): (WebCore::CanvasRenderingContext2DBase::takeCachedImageDataIfPossible const): (WebCore::CanvasRenderingContext2DBase::putImageData): * Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h: Canonical link: https://commits.webkit.org/270975@main Identifier: 267815.628@safari-7617-branch
- Loading branch information
Dan Robson
committed
Dec 11, 2023
1 parent
8e02aee
commit c52d8a9
Showing
2 changed files
with
77 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters