Changeset 181910 in webkit
- Timestamp:
- Mar 24, 2015 3:47:53 PM (9 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r181909 r181910 1 2015-03-24 Dan Bernstein <mitz@apple.com> 2 3 WebCore part of <rdar://problem/20282863> Transforms are flattened in snapshots of on-screen WKWebViews 4 https://bugs.webkit.org/show_bug.cgi?id=143023 5 6 Reviewed by Tim Horton. 7 8 * platform/spi/cocoa/QuartzCoreSPI.h: Added the declaration of 9 CARenderServerRenderLayerWithTransform. 10 1 11 2015-03-24 David Hyatt <hyatt@apple.com> 2 12 -
trunk/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h
r181193 r181910 116 116 uint32_t slotId, int32_t ox, int32_t oy, const CATransform3D *); 117 117 118 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); 119 118 120 EXTERN_C NSString * const kCATiledLayerRemoveImmediately; 119 121 -
trunk/Source/WebKit2/ChangeLog
r181907 r181910 1 2015-03-24 Dan Bernstein <mitz@apple.com> 2 3 WebKit2 part of <rdar://problem/20282863> Transforms are flattened in snapshots of on-screen WKWebViews 4 https://bugs.webkit.org/show_bug.cgi?id=143023 5 6 Reviewed by Tim Horton. 7 8 * UIProcess/API/Cocoa/WKWebView.mm: 9 (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): If the view is in a 10 window, use CARenderServerRenderLayerWithTransform to synchronously capture a snapshot of 11 its layer tree into an IOSurfcae, then call the completion handler with an image created 12 from the IOSurface. 13 1 14 2015-03-24 Beth Dakin <bdakin@apple.com> 2 15 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r181836 r181910 78 78 #import <JavaScriptCore/JSContext.h> 79 79 #import <JavaScriptCore/JSValue.h> 80 #import <WebCore/IOSurface.h> 80 81 #import <wtf/HashMap.h> 81 82 #import <wtf/MathExtras.h> … … 2503 2504 return; 2504 2505 } 2505 2506 2507 #if USE(IOSURFACE) 2508 // If we are parented and thus won't incur a significant penalty from paging in tiles, snapshot the view hierarchy directly. 2509 if (self.window) { 2510 float deviceScaleFactor = _page->deviceScaleFactor(); 2511 2512 CGRect imageRectInPoints; 2513 imageRectInPoints.size.width = imageWidth / deviceScaleFactor; 2514 imageRectInPoints.size.height = imageRectInPoints.size.width / rectInViewCoordinates.size.width * rectInViewCoordinates.size.height; 2515 imageRectInPoints.origin.x = rectInViewCoordinates.origin.x / deviceScaleFactor; 2516 imageRectInPoints.origin.y = rectInViewCoordinates.origin.y / deviceScaleFactor; 2517 2518 auto surface = WebCore::IOSurface::create(WebCore::expandedIntSize(WebCore::FloatSize(imageSize)), WebCore::ColorSpaceDeviceRGB); 2519 CATransform3D transform = CATransform3DMakeScale(deviceScaleFactor, deviceScaleFactor, 1); 2520 CARenderServerRenderLayerWithTransform(MACH_PORT_NULL, self.layer.context.contextId, reinterpret_cast<uint64_t>(self.layer), surface->surface(), 0, 0, &transform); 2521 completionHandler(surface->createImage().get()); 2522 2523 return; 2524 } 2525 #endif 2526 2506 2527 void(^copiedCompletionHandler)(CGImageRef) = [completionHandler copy]; 2507 2528 _page->takeSnapshot(WebCore::enclosingIntRect(snapshotRectInContentCoordinates), WebCore::expandedIntSize(WebCore::FloatSize(imageSize)), WebKit::SnapshotOptionsExcludeDeviceScaleFactor, [=](const WebKit::ShareableBitmap::Handle& imageHandle, WebKit::CallbackBase::Error) {
Note: See TracChangeset
for help on using the changeset viewer.