Bug 224526

Summary: Disable hardware JPEG decoding on x86 Mac for WK1
Product: WebKit Reporter: Said Abou-Hallawa <sabouhallawa>
Component: ImagesAssignee: Said Abou-Hallawa <sabouhallawa>
Status: RESOLVED INVALID    
Severity: Normal CC: sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=216377
Attachments:
Description Flags
Patch sam: review-, ews-feeder: commit-queue-

Description Said Abou-Hallawa 2021-04-13 20:55:17 PDT
Similar to bug 216377, we need to disable hardware JPEG decoding on x86 Mac for WK1 also. Some of the pre-installed apps, which use WK1, have experienced perf regression because of hardware JPEG decoding. WebKit does not own the decision whether an image is worth hardware decoding or not. This decision depends on heuristics which are run by system underlying frameworks.
Comment 1 Said Abou-Hallawa 2021-04-13 21:05:00 PDT
<rdar://74939829>
Comment 2 Said Abou-Hallawa 2021-04-13 21:09:11 PDT
Created attachment 425948 [details]
Patch
Comment 3 Sam Weinig 2021-04-14 19:40:04 PDT
Comment on attachment 425948 [details]
Patch

Will this disable it for the whole process? Or just WebKit’s uses?
Comment 4 Said Abou-Hallawa 2021-04-15 18:29:08 PDT
I think it will disable if for the whole process. The image decoding happens underneath WebKit. The only way to disable the HW decoding is do this globally. Do you think there will be a problem with doing this?
Comment 5 Sam Weinig 2021-04-17 12:03:14 PDT
Comment on attachment 425948 [details]
Patch

You need to do this without effecting the whole process. Loading WebKit should not change the behavior of code / frameworks that happen to be running in the same app.
Comment 6 Sam Weinig 2021-04-17 12:04:03 PDT
(In reply to Said Abou-Hallawa from comment #4)
> I think it will disable if for the whole process. The image decoding happens
> underneath WebKit. The only way to disable the HW decoding is do this
> globally. Do you think there will be a problem with doing this?

Yep. We really can't do that. You will need to ask for API/SPI to disable it on a per-call basis.
Comment 7 Said Abou-Hallawa 2021-05-05 12:36:27 PDT
(In reply to Sam Weinig from comment #6)
> (In reply to Said Abou-Hallawa from comment #4)
> > I think it will disable if for the whole process. The image decoding happens
> > underneath WebKit. The only way to disable the HW decoding is do this
> > globally. Do you think there will be a problem with doing this?
> 
> Yep. We really can't do that. You will need to ask for API/SPI to disable it
> on a per-call basis.

I agree. I think the approach of this patch is incorrect.