Bug 217573

Summary: [GPU Process][Resource caching 5/7]: Clean the DisplayList recording of the NativeImage
Product: WebKit Reporter: Said Abou-Hallawa <sabouhallawa>
Component: Layout and RenderingAssignee: Said Abou-Hallawa <sabouhallawa>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, bfulgham, calvaris, cdumez, cgarcia, eric.carlson, ews-watchlist, glenn, gustavo, gyuyoung.kim, japhet, jer.noble, menard, philipj, pnormand, ryuan.choi, sergio, simon.fraser, vjaquez, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 217566    
Bug Blocks: 217342, 217596    
Attachments:
Description Flags
Patch
none
Patch
none
Patch for review
none
Patch
ews-feeder: commit-queue-
Patch none

Description Said Abou-Hallawa 2020-10-11 01:44:41 PDT
-- Move the definition of NativeImagePtr to a separate header file.
-- Remove the class ImageHandle and allow encoding and decoding NativeImagePtr directly.
-- Remove the compilation directives around the DisplayList::DrawNativeImage item and the method drawNativeImage().
-- Move the drawNativeImage() methods to the sources of their callers.
-- In the case of recording the drawing commands, make GraphicsContext::drawImage() process drawing the images such that primitives drawing commands are recorded. For example a BitmapImage will render a NativeImage eventually. And SVGImage will record its render tree.
Comment 1 Said Abou-Hallawa 2020-10-11 01:46:45 PDT
Created attachment 411041 [details]
Patch
Comment 2 Said Abou-Hallawa 2020-10-11 01:55:19 PDT
Created attachment 411042 [details]
Patch
Comment 3 Said Abou-Hallawa 2020-10-11 03:01:24 PDT
Created attachment 411044 [details]
Patch for review
Comment 4 Said Abou-Hallawa 2020-10-17 01:48:22 PDT
Created attachment 411660 [details]
Patch
Comment 5 Said Abou-Hallawa 2020-10-17 02:25:21 PDT
Created attachment 411662 [details]
Patch
Comment 6 Simon Fraser (smfr) 2020-10-17 11:05:08 PDT
Comment on attachment 411662 [details]
Patch

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

> Source/WebCore/platform/graphics/BitmapImage.cpp:218
> +    // Subsampling may have given us an image that is smaller than size().
> +    IntSize subsampledImageSize = nativeImageSize(image);
> +    if (options.orientation().usesWidthAsHeight())
> +        subsampledImageSize = subsampledImageSize.transposedSize();
> +
> +    // srcRect is in the coordinates of the unsubsampled image, so we have to map it to the subsampled image.
> +    FloatRect adjustedSrcRect = srcRect;
> +    if (subsampledImageSize != srcSize)
> +        adjustedSrcRect = mapRect(srcRect, FloatRect({ }, srcSize), FloatRect({ }, subsampledImageSize));

What justifies this code being here and not inside GraphicsContext::drawNativeImage?
Comment 7 Radar WebKit Bug Importer 2020-10-18 01:45:14 PDT
<rdar://problem/70415273>
Comment 8 Said Abou-Hallawa 2020-10-19 09:34:49 PDT
Comment on attachment 411662 [details]
Patch

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

>> Source/WebCore/platform/graphics/BitmapImage.cpp:218
>> +        adjustedSrcRect = mapRect(srcRect, FloatRect({ }, srcSize), FloatRect({ }, subsampledImageSize));
> 
> What justifies this code being here and not inside GraphicsContext::drawNativeImage?

I will move this code to GraphicsContext::drawNativeImage() in bug 217596.
Comment 9 EWS 2020-10-19 09:49:05 PDT
Committed r268669: <https://trac.webkit.org/changeset/268669>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 411662 [details].