<?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>113657</bug_id>
          
          <creation_ts>2013-03-31 01:35:36 -0700</creation_ts>
          <short_desc>SVGImage::nativeImageForCurrentFrame() does not work if using DontCopyBackingStore</short_desc>
          <delta_ts>2023-09-26 02:06:30 -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>SVG</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</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>
          <dependson>113420</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Chris Dumez">cdumez</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>kkinnunen</cc>
    
    <cc>pdr</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>schenney</cc>
    
    <cc>senorblanco</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>866756</commentid>
    <comment_count>0</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2013-03-31 01:35:36 -0700</bug_when>
    <thetext>The current implementation of SVGImage::nativeImageForCurrentFrame() creates a temporary ImageBuffer, draw the SVG to it and then returns a pointer to the native image using:
ImageBuffer::copyImage(CopyBackingStore)-&gt;nativeImageForCurrentFrame();

Using CopyBackingStore here is suboptimal. However, DontCopyBackingStore does not work in this case, at least with Skia implementation. The reason for this is that the underlying SkBitmap pixels do not get copied when creating the new Image but the pixels get freed when the temporary ImageBuffer gets destroyed. Therefore, the returned native image has no valid pixel data.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1059824</commentid>
    <comment_count>1</comment_count>
    <who name="Stephen Chenney">schenney</who>
    <bug_when>2015-01-08 08:36:18 -0800</bug_when>
    <thetext>The Skia limitation is obviously not relevant any more, so maybe this can be fixed for other ports.

Even in Chromium, the Skia limitation is no longer a problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1979039</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-09-21 09:33:06 -0700</bug_when>
    <thetext>https://searchfox.org/wubkat/source/Source/WebCore/svg/graphics/SVGImageForContainer.cpp#57

RefPtr&lt;NativeImage&gt; SVGImageForContainer::nativeImageForCurrentFrame()
{
    return m_image-&gt;nativeImageForCurrentFrame();
}

Do we need to keep this open?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1980107</commentid>
    <comment_count>3</comment_count>
    <who name="Kimmo Kinnunen">kkinnunen</who>
    <bug_when>2023-09-26 02:06:30 -0700</bug_when>
    <thetext>No, this is already fixed by &quot;sinking&quot; the imagebuffer into the native image, which does not incur a copy.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>