<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>313600</bug_id>
          
          <creation_ts>2026-04-28 17:30:34 -0700</creation_ts>
          <short_desc>[HDR] Replace ShouldDecodeToHDR with DecodingDestination</short_desc>
          <delta_ts>2026-05-08 10:04:38 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Images</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>301434</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Said Abou-Hallawa">sabouhallawa</reporter>
          <assigned_to name="Said Abou-Hallawa">sabouhallawa</assigned_to>
          <cc>sabouhallawa</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2205585</commentid>
    <comment_count>0</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2026-04-28 17:30:34 -0700</bug_when>
    <thetext>ShouldDecodeToHDR allows two decoding options for HDRness: No and Yes. For ShouldDecodeToHDR::Yes we set the option { key: kCGImageSourceDecodeRequest, value: kCGImageSourceDecodeToHDR } when calling CGImageSourceCreateImageAtIndex() or CGImageSourceCreateThumbnailAtIndex().

For decoding gain-map images, we need a third option. We need to decode the base image but we need to decode the gain-map image as well. For this purpose the enum ShouldDecodeToHDR will be replaced with another enum called DecodingDestination. The values of DecodingDestination are { Base, GainMap, HDR }.

For Base and GainMap, the base image will be decoded, i.e. sending { key: kCGImageSourceDecodeRequest, value: kCGImageSourceDecodeToSDR } to CGImageSource. But for GainMap, the gain-map image will be decoded also. For HDR, { key: kCGImageSourceDecodeRequest, value: kCGImageSourceDecodeToHDR } will be send to CGImageSource.

DecodingDestination::GainMap will be chosen only when the image has a gain-map and the context is remote, i.e. the actual display happens in GPUProcess. If the image has a gain-map but the context is local, DecodingDestination::HDR will be chosen. This means the gain-map is applied in WebContent process in this case.

ImageFrame will now have three slots for three possible destinations. DecodingOptions will hold DecodingDestination and it will use it to check for matching.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2205590</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-04-28 17:41:11 -0700</bug_when>
    <thetext>&lt;rdar://problem/175805956&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2207589</commentid>
    <comment_count>2</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2026-05-05 04:11:31 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/64255</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2209039</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-05-08 10:04:36 -0700</bug_when>
    <thetext>Committed 312893@main (8d2285e7bc8e): &lt;https://commits.webkit.org/312893@main&gt;

Reviewed commits have been landed. Closing PR #64255 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>