<?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>76675</bug_id>
          
          <creation_ts>2012-01-19 17:19:09 -0800</creation_ts>
          <short_desc>[chromium] Remove setLayerTreeHost nonsense on lost context</short_desc>
          <delta_ts>2012-01-26 14:47:09 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>528+ (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></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="James Robinson">jamesr</reporter>
          <assigned_to name="James Robinson">jamesr</assigned_to>
          <cc>alokp</cc>
    
    <cc>cc-bugs</cc>
    
    <cc>enne</cc>
    
    <cc>nduca</cc>
    
    <cc>shawnsingh</cc>
    
    <cc>vangelis</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>539170</commentid>
    <comment_count>0</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2012-01-19 17:19:09 -0800</bug_when>
    <thetext>[chromium] Remove setLayerTreeHost nonsense on lost context</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>539171</commentid>
    <comment_count>1</comment_count>
      <attachid>123226</attachid>
    <who name="James Robinson">jamesr</who>
    <bug_when>2012-01-19 17:20:30 -0800</bug_when>
    <thetext>Created attachment 123226
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>539173</commentid>
    <comment_count>2</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2012-01-19 17:22:38 -0800</bug_when>
    <thetext>Pretty simple.  This codepath used to do more back when layers managed their own textures, but since everything either uses managed textures (content/image/video layers) or has its own context lost management (webgl/plugin) we don&apos;t have to do anything special when losing a context.

setLayerTreeHost() is now only called when:
*) A layer enters a tree
*) A layer leaves a tree
*) A layer moves from one tree to another (for example moves from being inside a tab to a window.open()&apos;d popup)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>539177</commentid>
    <comment_count>3</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2012-01-19 17:23:33 -0800</bug_when>
    <thetext>Tested by:

platform/chromium/compositing/*lost-context*

manually opening poster circle, a page with html5 video, and a webgl sample and killing the GPU process</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>539178</commentid>
    <comment_count>4</comment_count>
      <attachid>123226</attachid>
    <who name="Nat Duca">nduca</who>
    <bug_when>2012-01-19 17:23:39 -0800</bug_when>
    <thetext>Comment on attachment 123226
Patch

Looks highly amusing to me. Which should rhyme with LGTM but doesnt.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>539291</commentid>
    <comment_count>5</comment_count>
      <attachid>123226</attachid>
    <who name="Vangelis Kokkevis">vangelis</who>
    <bug_when>2012-01-19 22:59:46 -0800</bug_when>
    <thetext>Comment on attachment 123226
Patch

Do we end up calling evictAndDeleteAllTextures and if so are we trying to delete textures in a context that no longer exists?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>539628</commentid>
    <comment_count>6</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2012-01-20 11:08:29 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; (From update of attachment 123226 [details])
&gt; Do we end up calling evictAndDeleteAllTextures and if so are we trying to delete textures in a context that no longer exists?

We do and we are (relying on all GL calls on a lost context being no-ops, which they are).  We could add a path that goes through the normal eviction path but doesn&apos;t actually issue any GL calls if we were concerned about this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>539660</commentid>
    <comment_count>7</comment_count>
    <who name="Adrienne Walker">enne</who>
    <bug_when>2012-01-20 11:47:07 -0800</bug_when>
    <thetext>LGTM2.  Now that all layer types are using ManagedTexture, this should be safe to do.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>543439</commentid>
    <comment_count>8</comment_count>
    <who name="Alok Priyadarshi">alokp</who>
    <bug_when>2012-01-26 13:38:32 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; Pretty simple.  This codepath used to do more back when layers managed their own textures, but since everything either uses managed textures (content/image/video layers) or has its own context lost management (webgl/plugin) we don&apos;t have to do anything special when losing a context.
&gt; 
&gt; setLayerTreeHost() is now only called when:
&gt; *) A layer enters a tree
&gt; *) A layer leaves a tree
&gt; *) A layer moves from one tree to another (for example moves from being inside a tab to a window.open()&apos;d popup)

This is a good change. I just wanted point out a slightly related bug: https://bugs.webkit.org/show_bug.cgi?id=77135

setLayerTreeHost() also get called even when a layer remains in the same tree:
1. Moving a layer within the tree. See WebCore::RenderLayer::removeOnlyThisLayer().
2. GraphicsLayer::setChildren() removes-adds the layers common in the current child-list and the new child-list

Since setLayerTreeHost(0) also triggers resource cleanup, these two cases sometimes severely affect performance due to unnecessary work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>543503</commentid>
    <comment_count>9</comment_count>
      <attachid>123226</attachid>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2012-01-26 14:42:58 -0800</bug_when>
    <thetext>Comment on attachment 123226
Patch

r=me based on enne&apos;s review.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>543506</commentid>
    <comment_count>10</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2012-01-26 14:47:09 -0800</bug_when>
    <thetext>Committed r106048: &lt;http://trac.webkit.org/changeset/106048&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>123226</attachid>
            <date>2012-01-19 17:20:30 -0800</date>
            <delta_ts>2012-01-26 14:42:58 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-76675-20120119172029.patch</filename>
            <type>text/plain</type>
            <size>1662</size>
            <attacher name="James Robinson">jamesr</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTA1NDU5CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggZDdjOTE0NjIxZmI2OTE3
Yzg3NDhmYTYzZDc3Y2VkNjExYzg2MTcwMi4uYTdkMDljNTkxOGM5NTZkNzAzNjg1YmYxODI0NmI3
YWE0ZTU1NDE1NyAxMDA3NTUKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE2IEBACisyMDEyLTAxLTE5ICBKYW1l
cyBSb2JpbnNvbiAgPGphbWVzckBjaHJvbWl1bS5vcmc+CisKKyAgICAgICAgW2Nocm9taXVtXSBS
ZW1vdmUgc2V0TGF5ZXJUcmVlSG9zdCBub25zZW5zZSBvbiBsb3N0IGNvbnRleHQKKyAgICAgICAg
aHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTc2Njc1CisKKyAgICAgICAg
UmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgVGhpcyBjb2RlIGlzbid0IG5l
ZWRlZCBhbnkgbW9yZS4gT24gYSBsb3N0IGNvbnRleHQgZXZlbnQsIHdlIGRyb3AgYWxsIFRleHR1
cmVNYW5hZ2VyLW1hbmFnZWQgdGV4dHVyZXMgdGhyb3VnaAorICAgICAgICB0aGUgcHJveHkgYW5k
IG5vIGxheWVy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5ZXIKIAogdm9pZCBD
Q0xheWVyVHJlZUhvc3Q6OmRpZFJlY3JlYXRlR3JhcGhpY3NDb250ZXh0KGJvb2wgc3VjY2VzcykK
IHsKLSAgICBpZiAobV9yb290TGF5ZXIpIHsKLSAgICAgICAgbV9yb290TGF5ZXItPnNldExheWVy
VHJlZUhvc3QoMCk7Ci0gICAgICAgIG1fcm9vdExheWVyLT5zZXRMYXllclRyZWVIb3N0KHRoaXMp
OwotICAgIH0KICAgICBtX2NsaWVudC0+ZGlkUmVjcmVhdGVHcmFwaGljc0NvbnRleHQoc3VjY2Vz
cyk7CiB9CiAK
</data>
<flag name="review"
          id="124241"
          type_id="1"
          status="+"
          setter="kbr"
    />
          </attachment>
      

    </bug>

</bugzilla>