Bug 217573 - [GPU Process][Resource caching 5/7]: Clean the DisplayList recording of the NativeImage
Summary: [GPU Process][Resource caching 5/7]: Clean the DisplayList recording of the N...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords: InRadar
Depends on: 217566
Blocks: 217342 217596
  Show dependency treegraph
 
Reported: 2020-10-11 01:44 PDT by Said Abou-Hallawa
Modified: 2020-10-19 09:49 PDT (History)
21 users (show)

See Also:


Attachments
Patch (169.38 KB, patch)
2020-10-11 01:46 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (170.26 KB, patch)
2020-10-11 01:55 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch for review (46.57 KB, patch)
2020-10-11 03:01 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (49.40 KB, patch)
2020-10-17 01:48 PDT, Said Abou-Hallawa
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (49.98 KB, patch)
2020-10-17 02:25 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].