Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick 26aaa25. rdar://122309325
REGRESSION(267824@main): Changing HTMLCanvasElement width, height causes intermediate buffer allocations https://bugs.webkit.org/show_bug.cgi?id=268745 rdar://122309325 Reviewed by Simon Fraser. Resizing is intended to leave the buffer unallocated, so that sequential width, height assignments will not allocate multiple times. This intention was nullified by CanvasRenderingContext2DBase::reset(). Calling resetTransform redundantly would recreate the buffer immediately from width, height attribute setters. The transform reset is redundant, the context transform is reset when the context state saver is restored and re-saved. Clearing the canvas doesn't need to use public CanvasRenderingContext2DBase::clearCanvas() that will mutate the context state. The state is in known state with initial transform, and thus it doesn't need transform mutation. * Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::reset): Canonical link: https://commits.webkit.org/274135@main Identifier: 272448.548@safari-7618-branch
- Loading branch information