Bug 234626

Summary: _paintBehaviorForDestinationContext should consider kCGContextTypeDisplayList type contexts as potentially being snapshots
Product: WebKit Reporter: Matt Woodrow <mattwoodrow>
Component: WebKit APIAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: heycam, sabouhallawa, simon.fraser, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Matt Woodrow 2021-12-22 17:10:00 PST
rdar://83501315

_paintBehaviorForDestinationContext currently always returns `Normal` for contexts that aren't a bitmap context.

AppKit now provides a context that is of type kCGContextTypeDisplayList, and we want to still potentially consider it a snapshot draw (if the other conditions below are met).
Comment 1 Matt Woodrow 2021-12-22 17:14:02 PST
Created attachment 447846 [details]
Patch
Comment 2 Matt Woodrow 2021-12-22 17:15:32 PST
No test yet, but happy to add one if anyone has ideas on how to test this.

Ideally we'd test that images get sync decoded from AppKit, but it might be sufficient to have a unit test that passes a display list context, and confirms that the PaintBehavior::Snapshotting flag is set (if this is observable somehow).
Comment 3 EWS 2022-01-12 14:38:35 PST
Committed r287951 (245980@main): <https://commits.webkit.org/245980@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 447846 [details].