Bug 80593
| Summary: | Unnecessary discard of image buffer with idempotent canvas size change | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Tom Hudson <tomhudson> |
| Component: | Canvas | Assignee: | Tom Hudson <tomhudson> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | CC: | bfulgham |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | All | ||
| OS: | Unspecified | ||
Tom Hudson
canvas.width = canvas.width has become an accepted shorthand for clearing the canvas.
WebCore::HTMLCanvasElement::parseAttribute() calls reset() every time the width or height is set from JavaScript. That calls setSurfaceSize(), which forcibly throws away the WebCore::ImageBuffer, even when the width or height isn't actually changing.
Most of the calls in reset() check to make sure that size() != oldSize; if we could extend that to being *all* the calls, we ought to be able to avoid destroying and recreating the ImageBuffer, which has a measurable performance impact on Chromium and may be thrashing textures in the driver for hardware-accelerated canvas rendering.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Brent Fulgham
It looks like this suggestion was done in Bug 80871.
*** This bug has been marked as a duplicate of bug 80871 ***