Bug 143023 - Transforms are flattened in snapshots of on-screen WKWebViews
Summary: Transforms are flattened in snapshots of on-screen WKWebViews
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: mitz
URL:
Keywords: InRadar
Depends on:
Blocks: 145076
  Show dependency treegraph
 
Reported: 2015-03-24 15:26 PDT by mitz
Modified: 2015-05-15 15:53 PDT (History)
1 user (show)

See Also:


Attachments
Have the render server capture a layer tree snapshot if the view is on-screen (4.64 KB, patch)
2015-03-24 15:39 PDT, mitz
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2015-03-24 15:26:15 PDT
-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:] gives a software rendering of the view, which flattens transforms, even when the view is on-screen and the render server can capture the unflattened layers.
Comment 1 mitz 2015-03-24 15:27:59 PDT
<rdar://problem/20282863>
Comment 2 mitz 2015-03-24 15:39:10 PDT
Created attachment 249358 [details]
Have the render server capture a layer tree snapshot if the view is on-screen
Comment 3 Tim Horton 2015-03-24 15:45:16 PDT
Comment on attachment 249358 [details]
Have the render server capture a layer tree snapshot if the view is on-screen

(Anders had some comments on IRC).
Comment 4 Anders Carlsson 2015-03-24 15:45:55 PDT
Comment on attachment 249358 [details]
Have the render server capture a layer tree snapshot if the view is on-screen

View in context: https://bugs.webkit.org/attachment.cgi?id=249358&action=review

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:2518
> +        std::unique_ptr<WebCore::IOSurface> surface = WebCore::IOSurface::create(WebCore::expandedIntSize(WebCore::FloatSize(imageSize)), WebCore::ColorSpaceDeviceRGB);

Please use auto here.

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:2521
> +        completionHandler(surface->createImage().autorelease());

Please don't autorelease the image.
Comment 5 mitz 2015-03-24 15:48:50 PDT
Fixed in <http://trac.webkit.org/r181910>.
Comment 6 Alexey Proskuryakov 2015-03-24 22:06:42 PDT
iOS EWS is still broken: https://webkit-queues.appspot.com/results/5624952967397376

In file included from /Volumes/Data/EWS/WebKit/Source/WebCore/platform/ios/LegacyTileCache.mm:38:
/Volumes/Data/EWS/WebKit/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h:121:118: error: unknown type name 'IOSurfaceRef'
EXTERN_C void CARenderServerRenderLayerWithTransform(mach_port_t server_port, uint32_t client_id, uint64_t layer_id, IOSurfaceRef iosurface, int32_t ox, int32_t oy, const CATransform3D *matrix);
Comment 7 mitz 2015-03-24 22:13:51 PDT
(In reply to comment #6)
> iOS EWS is still broken:
> https://webkit-queues.appspot.com/results/5624952967397376
> 
> In file included from
> /Volumes/Data/EWS/WebKit/Source/WebCore/platform/ios/LegacyTileCache.mm:38:
> /Volumes/Data/EWS/WebKit/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h:
> 121:118: error: unknown type name 'IOSurfaceRef'
> EXTERN_C void CARenderServerRenderLayerWithTransform(mach_port_t
> server_port, uint32_t client_id, uint64_t layer_id, IOSurfaceRef iosurface,
> int32_t ox, int32_t oy, const CATransform3D *matrix);

Tried to fix that in <http://trac.webkit.org/r181931>.
Comment 8 Alexey Proskuryakov 2015-03-24 22:29:31 PDT
That broke the Mac build (all open source ones at least).
Comment 9 mitz 2015-03-24 22:30:07 PDT
And again in <http://trac.webkit.org/r181933>.