Bug 77185 - ImageBuffer::draw should deep copy if drawing to an accelerated context
Summary: ImageBuffer::draw should deep copy if drawing to an accelerated context
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Matthew Delaney
Depends on:
Reported: 2012-01-26 22:08 PST by Matthew Delaney
Modified: 2018-12-06 13:57 PST (History)
2 users (show)

See Also:

Patch (3.30 KB, patch)
2012-01-26 22:24 PST, Matthew Delaney
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Delaney 2012-01-26 22:08:13 PST
Currently, ImageBuffer::draw shallow copies itself when it's unaccelerated by wrapping its data provider bits in a CGImage. However, the CG API requires that those bits don't change before it gets a chance to draw with them which is something ImageBuffer very much doesn't guarantee since it's basically intended for the exact opposite purpose. Thus, especially in the case of accelerated canvas there can be image tearing so we need to always do a deep copy if the destination context is accelerated. Unfortunately, due to the nature of this issue it's hard to make any non-flaky test, however the code fix is simple and safe as it was our old path before the shallow copy optimization was introduced.
Comment 1 Matthew Delaney 2012-01-26 22:24:16 PST
Created attachment 124261 [details]
Comment 2 Matthew Delaney 2012-01-26 23:23:28 PST
Committed r106095: <http://trac.webkit.org/changeset/106095>