<?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>160520</bug_id>
          
          <creation_ts>2016-08-03 13:21:55 -0700</creation_ts>
          <short_desc>Add support for ColorSpaces and deep color to Color.h</short_desc>
          <delta_ts>2018-09-06 19:07:36 -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>Layout and Rendering</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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>
          <dependson>161853</dependson>
    
    <dependson>161855</dependson>
    
    <dependson>161856</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Dean Jackson">dino</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>simon.fraser</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1217102</commentid>
    <comment_count>0</comment_count>
    <who name="Dean Jackson">dino</who>
    <bug_when>2016-08-03 13:21:55 -0700</bug_when>
    <thetext>For extended and deep colors, we&apos;ll need to update Color.h.

We&apos;ll need a reference to a ColorSpace and probably floating point component values.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1217103</commentid>
    <comment_count>1</comment_count>
    <who name="Dean Jackson">dino</who>
    <bug_when>2016-08-03 13:22:12 -0700</bug_when>
    <thetext>&lt;rdar://problem/27667095&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1217104</commentid>
    <comment_count>2</comment_count>
    <who name="Dean Jackson">dino</who>
    <bug_when>2016-08-03 13:22:33 -0700</bug_when>
    <thetext>8/2/16, 4:17 PM Dean Jackson:
Doing some allocation tracking it seems an average page (macrumors daringfireball) has on the order of 3000 - 6000 colors.

8/2/16, 4:19 PM Dean Jackson:
Lea&apos;s amazing http://leaverou.github.io/conic-gradient/ got to about 8200 live color instances.

8/2/16, 4:25 PM Dean Jackson:
Although, that number would probably be smaller if we implemented conic-gradient :)

The single page HTML5 got to about 300,000 colors at its highest point, so an extra 64bit pointer would be about 2.25 Mb of extra memory (double what the current Color is).

8/3/16, 11:14 AM Dean Jackson:
If we start counting unique colors....

daringfireball.net 22
html5 spec 106 (out of 350k creations)
macrumors 76
apple.com/iphone 26
BBC 68
etc

8/3/16, 1:18 PM Dean Jackson:
With discussion from Sam:

Current 
   - 64 bits 
       (32 for inline color, 1 bit for validity)
   - Inline access

Double Size
   - 128 bits 
       (32 for inline color, 1 bit for validity, 64 bits for pointer to extended data)
   - Direct access

   Con: 
       - Double the size
           ~2MB extra on HTML spec test

Atomic Color (the color of tomorrow)
   - 64 bits
       (64 bits for pointer to uniqued color)
   - Indirect access

   Con: 
       - Indirect access might be a perf hit

Tagged pointer
   - 64 bits
       (same as current, except you have a bit which tells you if this is a pointer to the extended data)
   - Direct access after branch

   Con: 
       - Adds a branch to all color access
       - Might not work with current tools

8/3/16, 1:18 PM Dean Jackson:</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1217224</commentid>
    <comment_count>3</comment_count>
    <who name="Dean Jackson">dino</who>
    <bug_when>2016-08-03 14:49:26 -0700</bug_when>
    <thetext>1. Color will get rid of m_isValid and m_color, and use RefPtr&lt;ColorImpl&gt;.

2. isValid() becomes m_colorImpl != nullptr

3. ColorImpl will start with just the RGBA struct (add space and deeper colors later)

4. Table will live in Color.cpp</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1457375</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2018-09-06 19:07:36 -0700</bug_when>
    <thetext>Isn&apos;t this mostly done?</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>