RESOLVED FIXED Bug 200093
[FTW] Use IWICBitmap (rather than ID2D1Bitmap) for NativeImagePtr
https://bugs.webkit.org/show_bug.cgi?id=200093
Summary [FTW] Use IWICBitmap (rather than ID2D1Bitmap) for NativeImagePtr
Brent Fulgham
Reported 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!)
Attachments
WIP Patch (67.63 KB, patch)
2019-07-24 14:22 PDT, Brent Fulgham
no flags
WIP Patch (65.63 KB, patch)
2019-07-24 16:08 PDT, Brent Fulgham
no flags
Patch (60.30 KB, patch)
2019-07-24 19:53 PDT, Brent Fulgham
no flags
Patch (59.72 KB, patch)
2019-07-24 20:02 PDT, Brent Fulgham
no flags
Brent Fulgham
Comment 1 2019-07-24 14:22:18 PDT
Created attachment 374809 [details] WIP Patch
Brent Fulgham
Comment 2 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.
Brent Fulgham
Comment 3 2019-07-24 16:08:56 PDT
Created attachment 374824 [details] WIP Patch
Brent Fulgham
Comment 4 2019-07-24 19:53:02 PDT
Brent Fulgham
Comment 5 2019-07-24 20:02:43 PDT
WebKit Commit Bot
Comment 6 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>
WebKit Commit Bot
Comment 7 2019-07-25 15:02:08 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 8 2019-07-25 15:03:19 PDT
Brent Fulgham
Comment 9 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.
Note You need to log in before you can comment on or make changes to this bug.