<?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>119634</bug_id>
          
          <creation_ts>2013-08-09 11:55:47 -0700</creation_ts>
          <short_desc>[CSS Shapes] Refactor ImageExtractor et al</short_desc>
          <delta_ts>2013-09-05 11:20:29 -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>WebGL</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>116643</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Hans Muller">giles_joplin</reporter>
          <assigned_to name="Hans Muller">giles_joplin</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>915899</commentid>
    <comment_count>0</comment_count>
    <who name="Hans Muller">giles_joplin</who>
    <bug_when>2013-08-09 11:55:47 -0700</bug_when>
    <thetext>The ImageExtractor class, its packImageData() helper function, and related definitions are currently embedded in the GraphicsContext3D class. The proposed Shape from Image patch, https://bugs.webkit.org/show_bug.cgi?id=116643, depends on these classes but not on anything else, not on anything 3D graphics related.  The reviewer for 116643 has asked that ImageExtractor et al be refactored out of the Graphics3D class.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>916275</commentid>
    <comment_count>1</comment_count>
    <who name="Hans Muller">giles_joplin</who>
    <bug_when>2013-08-12 08:16:19 -0700</bug_when>
    <thetext>Separating ImageExtractor et al from GraphicsContext3D would be a big job. Bigger than I&apos;d thought. For example:

- GraphicsContext3D.h defines a huge grab-bag of constants, some of which are used by the pixel reformatting code. 

- GraphicsContext3D.cpp includes two HUGE blocks of file-local definitions in anonymous namespaces. Most of those definitions are used by the image extraction code but probably not all of them.

- The ImageExtractor class depends a native method called extractImage() of which there are at least 7. All of the native code would have to be rearranged.

It might be simpler to render the image instead, despite the extra (ephemeral) memory cost of doing so. I&apos;d suggested doing as much back in May. See the email to Alex and Dirk, subject &quot;Image Processing&quot;, May 22.

Here&apos;s how it might work:

Use ImageBuffer::create() to create an ImageBuffer of the right size.
Draw the Image* with the GraphicsContext returned by imageBuffer-&gt;context().
Use ImageBuffer::getUnmultipliedImageData() to extract the RGBA pixels data. 

There are loads of examples of roughly this kind of thing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>925137</commentid>
    <comment_count>2</comment_count>
    <who name="Hans Muller">giles_joplin</who>
    <bug_when>2013-09-05 11:20:29 -0700</bug_when>
    <thetext>We decided to render images instead of depending on ImageExtractor.  See https://bugs.webkit.org/show_bug.cgi?id=116643</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>