[Webkit-unassigned] [Bug 149814] Compress snapshots on iOS

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 5 13:01:31 PDT 2015


https://bugs.webkit.org/show_bug.cgi?id=149814

--- Comment #6 from Beth Dakin <bdakin at apple.com> ---
(In reply to comment #4)
> Comment on attachment 262453 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=262453&action=review
> 
> > Source/WebCore/platform/graphics/cocoa/IOSurface.h:39
> > +enum class PixelFormatForColor {
> 
> I don't think we need the "ForColor" here, and I think maybe this should be
> inside WebCore::IOSurface? Maybe WebCore::IOSurface::Format?
> 

Fixed! I went with your suggestion.

> > Source/WebCore/platform/graphics/cocoa/IOSurface.h:42
> > +    YUVCompressed
> 
> I don't think we need "compressed" here. I think this should be more
> specific, too: YUV422, or something like that.
> 

Fixed! I again went with your suggestion.

> > Source/WebCore/platform/graphics/cocoa/IOSurface.h:91
> > +    WEBCORE_EXPORT void convertToFormat(PixelFormatForColor, std::function<void(std::unique_ptr<WebCore::IOSurface>)>);
> 
> This should probably be a class method that takes a move-only
> WebCore::IOSurface, so that it's clear that it consumes the surface.
> Otherwise someone could accidentally keep using the now dead surface.
> Something like this:
> 
> WEBCORE_EXPORT static void
> convertToFormat(std::unique_ptr<WebCore::IOSurface>&& inSurface,
> PixelFormatForColor,
> std::function<void(std::unique_ptr<WebCore::IOSurface>)>);
> 

Fixed! Should I move it to the top of the file? It doesn't really matter, but I feel like that is where class methods go.

> > Source/WebCore/platform/graphics/cocoa/IOSurface.mm:264
> > +    static IOSurfaceAcceleratorRef accelerator;
> > +    if (!accelerator) {
> > +        IOSurfaceAcceleratorCreate(nullptr, nullptr, &accelerator);
> > +
> > +        auto runLoopSource = IOSurfaceAcceleratorGetRunLoopSource(accelerator);
> > +        CFRunLoopAddSource(CFRunLoopGetMain(), runLoopSource, kCFRunLoopDefaultMode);
> > +    }
> 
> We should check with the appropriate folks that it's OK to keep one of these
> alive forever. I'm not sure.
> 

Okay…Will follow up on this.

> > Source/WebCore/platform/graphics/cocoa/IOSurface.mm:266
> > +    auto destinationSurface = IOSurface::create(m_size, m_colorSpace, pixelFormat);
> 
> We should bail (call the callback synchronously with the current surface) if
> the pixel formats are the same.
> 
> > Source/WebCore/platform/graphics/cocoa/IOSurface.mm:274
> > +
> 
> no newline here
> 

Fixed!

> > Source/WebCore/platform/graphics/cocoa/IOSurface.mm:282
> > +    IOSurfaceAcceleratorTransformSurface(accelerator, m_surface.get(), destinationIOSurfaceRef, nullptr, nullptr, &completion, nullptr, nullptr);
> 
> Please retrieve the IOReturn from this and from IOSurfaceAcceleratorCreate
> and ASSERT_UNUSED(ret, ret == kIOReturnSuccess); like we do in other places.


Fixed!

Thanks Tim!

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20151005/412c4cc9/attachment.html>


More information about the webkit-unassigned mailing list