⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 211126 in webkit


Ignore:
Timestamp:
Jan 24, 2017, 5:44:09 PM (10 years ago)
Author:
Simon Fraser
Message:

[iOS WK2] Avoid IOSurface readback for snapshot creation
https://bugs.webkit.org/show_bug.cgi?id=167397
rdar://problem/30174873

Reviewed by Tim Horton.

Source/WebCore:

Export sinkIntoImage().

  • platform/graphics/cocoa/IOSurface.h:

Source/WebKit2:

Use IOSurface::sinkIntoImage() for snapshots, to avoid GPU readback.

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r211125 r211126  
     12017-01-24  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] Avoid IOSurface readback for snapshot creation
     4        https://bugs.webkit.org/show_bug.cgi?id=167397
     5        rdar://problem/30174873
     6
     7        Reviewed by Tim Horton.
     8
     9        Export sinkIntoImage().
     10
     11        * platform/graphics/cocoa/IOSurface.h:
     12
    1132017-01-24  Brent Fulgham  <bfulgham@apple.com>
    214
  • trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h

    r209369 r211126  
    6363    // the surface, or an expensive GPU readback can result.
    6464    WEBCORE_EXPORT RetainPtr<CGImageRef> createImage();
    65     static RetainPtr<CGImageRef> sinkIntoImage(std::unique_ptr<IOSurface>);
     65    WEBCORE_EXPORT static RetainPtr<CGImageRef> sinkIntoImage(std::unique_ptr<IOSurface>);
    6666
    6767    id asLayerContents() const { return (id)(CFTypeRef)m_surface.get(); }
  • trunk/Source/WebKit2/ChangeLog

    r211121 r211126  
     12017-01-24  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] Avoid IOSurface readback for snapshot creation
     4        https://bugs.webkit.org/show_bug.cgi?id=167397
     5        rdar://problem/30174873
     6
     7        Reviewed by Tim Horton.
     8
     9        Use IOSurface::sinkIntoImage() for snapshots, to avoid GPU readback.
     10
     11        * UIProcess/API/Cocoa/WKWebView.mm:
     12        (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
     13
    1142017-01-24  Tim Horton  <timothy_horton@apple.com>
    215
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

    r211121 r211126  
    44204420        transform = CATransform3DTranslate(transform, -rectInViewCoordinates.origin.x, -rectInViewCoordinates.origin.y, 0);
    44214421        CARenderServerRenderDisplayLayerWithTransformAndTimeOffset(MACH_PORT_NULL, (CFStringRef)display.name, self.layer.context.contextId, reinterpret_cast<uint64_t>(self.layer), surface->surface(), 0, 0, &transform, 0);
    4422         completionHandler(surface->createImage().get());
     4422        completionHandler(WebCore::IOSurface::sinkIntoImage(WTFMove(surface)).get());
    44234423        return;
    44244424    }
Note: See TracChangeset for help on using the changeset viewer.