Changeset 271430 in webkit
- Timestamp:
- Jan 12, 2021 9:48:23 PM (3 years ago)
- Location:
- trunk/Source/WebKitLegacy/mac
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKitLegacy/mac/ChangeLog
r271378 r271430 1 2021-01-12 Tim Horton <timothy_horton@apple.com> 2 3 QuickLook snapshots are missing some image content 4 https://bugs.webkit.org/show_bug.cgi?id=220571 5 <rdar://problem/72184373> 6 7 Reviewed by Simon Fraser. 8 9 * WebView/WebFrame.mm: 10 (-[WebFrame _paintBehaviorForDestinationContext:]): 11 Quick Look snapshots use WebView, and call displayRectIgnoringOpacity:inContext: 12 in order to paint it into a bitmap context. However, if the WebView is layer-backed, 13 including for reasons outside of WebKit or Quick Look's control, it currently 14 does a "normal" paint (as opposed to a snapshotting + flattening paint). 15 This results in async image decoding kicking in, which is undesirable 16 for a snapshot, since there is no opportunity to repaint when the decode 17 is complete. 18 19 It is difficult to detect all cases in which WebView is being painted into 20 an offscreen context, but one case that we can easily detect, and which 21 fixes Quick Look, is if the WebView itself is not hosted in a window. 22 23 So, if not hosted in a window, do a snapshotting+flattening paint. 24 1 25 2021-01-11 Alex Christensen <achristensen@webkit.org> 2 26 -
trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm
r271011 r271430 604 604 #endif 605 605 #if PLATFORM(MAC) 606 if ([documentView _web_isDrawingIntoLayer]) 606 // Even if we are layer-backed, we may be painting into an offscreen context. 607 // We can be sure it's an offscreen context if we are not parented in a window, so exclude that case. 608 // This does not cover all cases, such as a parented view being painted into an offscreen context. 609 if ([documentView _web_isDrawingIntoLayer] && documentView.window) 607 610 return WebCore::PaintBehavior::Normal; 608 611 #endif 609 612 } 610 613 611 614 return OptionSet<WebCore::PaintBehavior>(WebCore::PaintBehavior::FlattenCompositingLayers) | WebCore::PaintBehavior::Snapshotting; 612 615 }
Note: See TracChangeset
for help on using the changeset viewer.