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.
Created attachment 124261 [details] Patch
Committed r106095: <http://trac.webkit.org/changeset/106095>