Bug 203884 - [Cairo] Cairo graphics backend uses ImageBuffer::copyImage just to access native image buffer handles
Summary: [Cairo] Cairo graphics backend uses ImageBuffer::copyImage just to access nat...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Lord
Keywords: InRadar
Depends on:
Blocks: 182686
  Show dependency treegraph
Reported: 2019-11-06 02:50 PST by Chris Lord
Modified: 2019-11-06 05:14 PST (History)
10 users (show)

See Also:

Patch (7.06 KB, patch)
2019-11-06 03:01 PST, Chris Lord
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Lord 2019-11-06 02:50:08 PST
This pattern occurs a lot in the Cairo graphics backend:

    RefPtr<Image> image = layerImage.copyImage(DontCopyBackingStore);
    if (!image)

    if (auto surface = image->nativeImageForCurrentFrame()) {

Which is fine on a single thread, but ImageSource is not usable off-main-thread, so any drawing that calls functions that do this will cause an assert on a debug build. I think its use of ImageSource would be safe off-main-thread, but it's overkill just to get the native image handle. This is hampering OffscreenCanvas.
Comment 1 Chris Lord 2019-11-06 03:01:43 PST
Created attachment 382908 [details]
Comment 2 WebKit Commit Bot 2019-11-06 05:13:17 PST
Comment on attachment 382908 [details]

Clearing flags on attachment: 382908

Committed r252136: <https://trac.webkit.org/changeset/252136>
Comment 3 WebKit Commit Bot 2019-11-06 05:13:19 PST
All reviewed patches have been landed.  Closing bug.
Comment 4 Radar WebKit Bug Importer 2019-11-06 05:14:18 PST