Bug 200093 - [FTW] Use IWICBitmap (rather than ID2D1Bitmap) for NativeImagePtr
Summary: [FTW] Use IWICBitmap (rather than ID2D1Bitmap) for NativeImagePtr
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: Safari 10
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks: 161817
  Show dependency treegraph
 
Reported: 2019-07-24 12:11 PDT by Brent Fulgham
Modified: 2019-08-21 16:30 PDT (History)
10 users (show)

See Also:


Attachments
WIP Patch (67.63 KB, patch)
2019-07-24 14:22 PDT, Brent Fulgham
no flags Details | Formatted Diff | Diff
WIP Patch (65.63 KB, patch)
2019-07-24 16:08 PDT, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (60.30 KB, patch)
2019-07-24 19:53 PDT, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (59.72 KB, patch)
2019-07-24 20:02 PDT, Brent Fulgham
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2019-07-24 12:11:59 PDT
When I wrote the original Direct2D code, I did not realize that the backing memory for the ID2D1Bitmap was inaccessible since it is effectively a representation of GPU memory. There is no API to access or modify the pixels.

Instead, MSDN documentation indicates that we should be using IWICBitmap objects, which are converted to ID2D1Bitmap objects when things are ready to be rendered.

This makes it possible to use the TextureMapper backend to do efficient compositing and tile drawing, since the data backing the bitmap can now be accessed and manipulated, allowing us to support filters and other effects.

This initial naive patch makes the transition, which allows these features to work. There is a lot of room for performance improvements.

It's likely that WebKit bitmaps should be handled more efficiently than this initial patch, and I look forward to DirectX experts to help me do so! (Help, Sony People!)
Comment 1 Brent Fulgham 2019-07-24 14:22:18 PDT
Created attachment 374809 [details]
WIP Patch
Comment 2 Brent Fulgham 2019-07-24 14:23:12 PDT
This initial WIP patch is just to see if I broke WinCairo or AppleWin ports.

I would appreciate input from DirectX experts, though.
Comment 3 Brent Fulgham 2019-07-24 16:08:56 PDT
Created attachment 374824 [details]
WIP Patch
Comment 4 Brent Fulgham 2019-07-24 19:53:02 PDT
Created attachment 374851 [details]
Patch
Comment 5 Brent Fulgham 2019-07-24 20:02:43 PDT
Created attachment 374855 [details]
Patch
Comment 6 WebKit Commit Bot 2019-07-25 15:02:06 PDT
Comment on attachment 374855 [details]
Patch

Clearing flags on attachment: 374855

Committed r247841: <https://trac.webkit.org/changeset/247841>
Comment 7 WebKit Commit Bot 2019-07-25 15:02:08 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2019-07-25 15:03:19 PDT
<rdar://problem/53561473>
Comment 9 Brent Fulgham 2019-08-21 16:30:23 PDT
It turns out that this change is horrible for performance (MotionMark dropped from ~200 down to 4).

I'll be backing a large portion of these changes out in a follow-up.