<?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>161683</bug_id>
          
          <creation_ts>2016-09-07 02:11:48 -0700</creation_ts>
          <short_desc>[GTK] Clarify frame callbacks behaviour in Wayland compositor</short_desc>
          <delta_ts>2016-09-07 08:56:41 -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>WebKitGTK</component>
          <version>WebKit Local 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="Emanuele Aina">emanuele.aina</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>cgarcia</cc>
    
    <cc>commit-queue</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1227117</commentid>
    <comment_count>0</comment_count>
    <who name="Emanuele Aina">emanuele.aina</who>
    <bug_when>2016-09-07 02:11:48 -0700</bug_when>
    <thetext>The way we fire frame callbacks in the nested Wayland compositor can be puzzling to developers expecting Wayland semantics, but since we have our own mechanism to handle synchronization we don&apos;t care much
about them. Adding a comment would avoid surprised Wayland developers.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1227118</commentid>
    <comment_count>1</comment_count>
      <attachid>288124</attachid>
    <who name="Emanuele Aina">emanuele.aina</who>
    <bug_when>2016-09-07 02:12:50 -0700</bug_when>
    <thetext>Created attachment 288124
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1227124</commentid>
    <comment_count>2</comment_count>
      <attachid>288124</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2016-09-07 02:33:03 -0700</bug_when>
    <thetext>Comment on attachment 288124
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=288124&amp;action=review

&gt; w/Source/WebKit2/UIProcess/gtk/WaylandCompositor.cpp:237
&gt; +    // From a Wayland point-of-view firing frame callbacks here is very weird,
&gt; +    // but our WebProcess clients don&apos;t rely on them for synchronization and
&gt; +    // set the EGL swap interval to zero, relying on the RenderNextFrame events
&gt; +    // in the WebKit IPC instead

The comment adds more confusion to me. It says that the firing frame callbacks here is weird, but it doesn&apos;t say why or where they should be fired. The only reason why I didn&apos;t remove all frame callbacks handling from the nested compositor is because I was not sure we can rely that eglSwapInterval is always going to work for all drivers. But if it works, frame callbacks are never emitted, so this list is always empty. The reason why we do this, is not because we rely on RenderNextFrame events, adn there isn&apos;t any WebKit IPC involved. The reason is that we are rendering to an offscreen context always in the web process, and when we have to render a new frame, we schedule a redraw in the web view, and then we render in the screen. So syncing to vblank in the web process doesn&apos;t help, because we will not render at that time to the screen, we will render into the offscreen context, and the  schedule a redraw on the widget. It&apos;s at that point where we want to vblank sync, and that&apos;s already done by GTK+. This avoids unnecessary throttling in the web process. When there&apos;s a new frame rendered in the web process, eglSwapBuffers is what triggers the repaint in the nested compositor using the wayland protocol, not the WebKit IPC.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1227129</commentid>
    <comment_count>3</comment_count>
    <who name="Emanuele Aina">emanuele.aina</who>
    <bug_when>2016-09-07 02:48:03 -0700</bug_when>
    <thetext>Frame callbacks should be fired where you know the compositor has used the committed content. E.g. in Weston it the place where it has queued the GL commands to update the screen and so the next screen update contents have been locked in place.

To be specific, it should not just be any screen update, it should be the particular update that first uses the content from the same commit as where the frame callback was filed. Frame callbacks should also not be fired if the surface is not shown.

What I was trying to say is that despite frame callbacks being the main throttling mechanism in normal Wayland usage, we don&apos;t need them for that purpose as throttling is already handled elsewhere by WebKit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1227148</commentid>
    <comment_count>4</comment_count>
      <attachid>288131</attachid>
    <who name="Emanuele Aina">emanuele.aina</who>
    <bug_when>2016-09-07 06:20:13 -0700</bug_when>
    <thetext>Created attachment 288131
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1227151</commentid>
    <comment_count>5</comment_count>
      <attachid>288131</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2016-09-07 06:37:33 -0700</bug_when>
    <thetext>Comment on attachment 288131
Patch

Much clearer, thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1227181</commentid>
    <comment_count>6</comment_count>
      <attachid>288131</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-09-07 08:56:38 -0700</bug_when>
    <thetext>Comment on attachment 288131
Patch

Clearing flags on attachment: 288131

Committed r205547: &lt;http://trac.webkit.org/changeset/205547&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1227182</commentid>
    <comment_count>7</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-09-07 08:56:41 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>288124</attachid>
            <date>2016-09-07 02:12:50 -0700</date>
            <delta_ts>2016-09-07 06:20:04 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-161683-20160907111025.patch</filename>
            <type>text/plain</type>
            <size>1929</size>
            <attacher name="Emanuele Aina">emanuele.aina</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjA1NDcyCmRpZmYgLS1naXQgYy9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IG91ciBXZWJQcm9jZXNzIGNsaWVudHMgZG9uJ3QgcmVs
eSBvbiB0aGVtIGZvciBzeW5jaHJvbml6YXRpb24gYW5kCisgICAgLy8gc2V0IHRoZSBFR0wgc3dh
cCBpbnRlcnZhbCB0byB6ZXJvLCByZWx5aW5nIG9uIHRoZSBSZW5kZXJOZXh0RnJhbWUgZXZlbnRz
CisgICAgLy8gaW4gdGhlIFdlYktpdCBJUEMgaW5zdGVhZAogICAgIGF1dG8gbGlzdCA9IFdURk1v
dmUobV9mcmFtZUNhbGxiYWNrTGlzdCk7CiAgICAgZm9yIChhdXRvKiByZXNvdXJjZSA6IGxpc3Qp
IHsKICAgICAgICAgd2xfY2FsbGJhY2tfc2VuZF9kb25lKHJlc291cmNlLCAwKTsK
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>288131</attachid>
            <date>2016-09-07 06:20:13 -0700</date>
            <delta_ts>2016-09-07 08:56:38 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-161683-20160907151748.patch</filename>
            <type>text/plain</type>
            <size>1964</size>
            <attacher name="Emanuele Aina">emanuele.aina</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjA1NTM5CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViS2l0Mi9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViS2l0Mi9DaGFuZ2VMb2cKaW5kZXggMGViMTc4YjMzNjc0YjBi
YzUwZmVmNmNlMzQ2MWMxOWJlYjA2MjQ3Ni4uM2MwZWJjNzlhNmMwODk3MTRmZGNmZDBjOTZlOGRi
ZTI4MjU3ZjhhOCAxMDA2NDQKLS0tIGEvU291cmNlL1dlYktpdDIvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJLaXQyL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE4IEBACisyMDE2LTA5LTA2ICBFbWFu
dWVsZSBBaW5hICA8ZW1hbnVlb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