Bug 225813

Summary: Use PixelBufferFormat to specify ImageBuffer::getPixelBuffer destination format allowing for more control over data conversion
Product: WebKit Reporter: Sam Weinig <sam>
Component: New BugsAssignee: Sam Weinig <sam>
Status: RESOLVED FIXED    
Severity: Normal CC: alecflett, beidson, cdumez, changseok, darin, dino, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, jsbell, kondapallykalyan, pdr, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 225140    
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch
none
Patch none

Description Sam Weinig 2021-05-14 10:15:37 PDT
Use PixelBufferFormat to specify ImageBuffer::getPixelData destination format allowing for more control over data conversion
Comment 1 Sam Weinig 2021-05-14 10:42:56 PDT Comment hidden (obsolete)
Comment 2 Sam Weinig 2021-05-14 11:28:25 PDT Comment hidden (obsolete)
Comment 3 Sam Weinig 2021-05-14 12:15:15 PDT Comment hidden (obsolete)
Comment 4 Sam Weinig 2021-05-14 12:58:17 PDT
Created attachment 428647 [details]
Patch
Comment 5 Darin Adler 2021-05-14 15:40:10 PDT
Comment on attachment 428647 [details]
Patch

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

Nice improvement here.

> Source/WebCore/platform/graphics/ImageBufferBackend.cpp:181
> +    unsigned sourceBytesPerRow = 4 * sourcePixelBuffer.size().width();

auto?

> Source/WebCore/platform/graphics/ImageBufferBackend.cpp:182
> +    const uint8_t* sourceRows = sourcePixelBuffer.data().data() + sourceRectClipped.y() * sourceBytesPerRow + sourceRectClipped.x() * 4;

auto?

> Source/WebCore/platform/graphics/ImageBufferBackend.cpp:187
> +    PixelBufferFormat sourceFormat = sourcePixelBuffer.format();

auto?
Comment 6 EWS 2021-05-14 18:00:06 PDT
Committed r277525 (237753@main): <https://commits.webkit.org/237753@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 428647 [details].
Comment 7 Radar WebKit Bug Importer 2021-05-14 18:01:18 PDT
<rdar://problem/78040673>
Comment 8 Sam Weinig 2021-05-15 09:51:14 PDT
(In reply to Darin Adler from comment #5)
> Comment on attachment 428647 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=428647&action=review
> 
> Nice improvement here.
> 
> > Source/WebCore/platform/graphics/ImageBufferBackend.cpp:181
> > +    unsigned sourceBytesPerRow = 4 * sourcePixelBuffer.size().width();
> 
> auto?
> 
> > Source/WebCore/platform/graphics/ImageBufferBackend.cpp:182
> > +    const uint8_t* sourceRows = sourcePixelBuffer.data().data() + sourceRectClipped.y() * sourceBytesPerRow + sourceRectClipped.x() * 4;
> 
> auto?
> 
> > Source/WebCore/platform/graphics/ImageBufferBackend.cpp:187
> > +    PixelBufferFormat sourceFormat = sourcePixelBuffer.format();
> 
> auto?

I didn't ignore these by the way, they are fixed in a different way in my next change (https://bugs.webkit.org/show_bug.cgi?id=225841) and since that was already building, I figured I'd leave well enough alone on this one.