<?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>227912</bug_id>
          
          <creation_ts>2021-07-13 11:20:54 -0700</creation_ts>
          <short_desc>Back to front buffer copies in scaled image buffers should not hit the sub image code path</short_desc>
          <delta_ts>2021-07-20 11:21:18 -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>Safari Technology Preview</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Simon Fraser (smfr)">simon.fraser</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>sabouhallawa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>thorton</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1776690</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2021-07-13 11:20:54 -0700</bug_when>
    <thetext>Because of integral sizing of image buffers with fractional scales, we end up hitting the sub image code path here:

  * frame #0: 0x00000001efff61ca WebCore`WebCore::GraphicsContextCG::drawNativeImage(this=0x0000000239dde1a8, nativeImage=0x0000000232bab0c0, imageSize={ width = 1259.0, height = 142.0 }, destRect={ x = 0.0, y = 0.0, width = 392.0, height = 44.0 }, srcRect={ x = 0.0, y = 0.0, width = 1258.32007, height = 141.240005 }, options=0x00007ffee5548f80) at GraphicsContextCG.cpp:309:5
    frame #1: 0x00000001f000c3c6 WebCore`WebCore::ImageBufferCGBackend::draw(this=0x000000023c3142a0, destContext=0x0000000239dde1a8, destRect={ x = 0.0, y = 0.0, width = 392.0, height = 44.0 }, srcRect={ x = 0.0, y = 0.0, width = 392.0, height = 44.0 }, options=0x00007ffee5548f80) at ImageBufferCGBackend.cpp:141:21
    frame #2: 0x00000001c8b688e2 WebKit`WebCore::ConcreteImageBuffer&lt;WebKit::ImageBufferShareableMappedIOSurfaceBackend&gt;::draw(this=0x0000000231eba550, destContext=0x0000000239dde1a8, destRect={ x = 0.0, y = 0.0, width = 392.0, height = 44.0 }, srcRect={ x = 0.0, y = 0.0, width = 392.0, height = 44.0 }, options=0x00007ffee5548f80) at ConcreteImageBuffer.h:144:22
    frame #3: 0x00000001efef9541 WebCore`WebCore::GraphicsContext::drawImageBuffer(this=0x0000000239dde1a8, image=0x0000000231eba550, destination={ x = 0.0, y = 0.0, width = 392.0, height = 44.0 }, source={ x = 0.0, y = 0.0, width = 392.0, height = 44.0 }, options=0x00007ffee5548f80) at GraphicsContext.cpp:579:11
    frame #4: 0x00000001c8e4d22b WebKit`WebKit::RemoteLayerBackingStore::display(this=0x0000000220d39ea0) at RemoteLayerBackingStore.mm:302:17
    frame #5: 0x00000001c9fe27ed WebKit`WebKit::PlatformCALayerRemote::recursiveBuildTransaction(this=0x0000000232b61240, context=0x0000000220da32f0, transaction=0x00007ffee55499f8) at PlatformCALayerRemote.cpp:181:102


This is a waste of cycles; we never want to hit the sub image cache for these copies, and we know we can just splat the whole buffer over.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1778209</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-07-20 11:21:18 -0700</bug_when>
    <thetext>&lt;rdar://problem/80848640&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>