<?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>25696</bug_id>
          
          <creation_ts>2009-05-11 09:22:36 -0700</creation_ts>
          <short_desc>gtk directfb screen corruption on scrolling of webview</short_desc>
          <delta_ts>2015-04-24 11:52:33 -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>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Gtk</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Luke Kenneth Casson Leighton">lkcl</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>andersca</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>120672</commentid>
    <comment_count>0</comment_count>
    <who name="Luke Kenneth Casson Leighton">lkcl</who>
    <bug_when>2009-05-11 09:22:36 -0700</bug_when>
    <thetext>got a bit of an issue with a directfb gtk app, using a gtk ScrollWindow and a webkit webview widget embedded in it.  mouse and keyboard scroll events give screen corruption when using VESA, IntelFB and also an embedded device (exact details unknown to me).  the amount and nature of the screen corruption that occurs is dependent on how much of the display area is being scrolled (by the mouse or the keyboard) but it varies from black artefacts, blue artefacts, both of width of the entire screen, and clearly distinguishable portions of the web page being viewed being shifted vertically by random offsets.

the corruption DOES NOT occur if:

* the vertical scrollbar position is set _manually_ using value adjustment on the scrollbar:
   m_VerticalAdjustment =
        gtk_scrolled_window_get_vadjustment(
             GTK_SCROLLED_WINDOW(scrolled_window));
   gtk_adjustment_set_value(m_VerticalAdjustment, val + INCR);

* the application is compiled as an X-Windows gtk app.  under these circumstances, no screen corruption occurs at all.


dpkg -l | grep directfb
ii  libcairo-directfb2                   1.8.6-2+b1                           The Cairo 2D vector graphics library DirectFB build (d
ii  libcairo-directfb2-dev               1.8.6-2+b1                           Development files for Cairo graphics library DirectFB 
ii  libdirectfb-1.2-0                    1.2.7-2                              direct frame buffer graphics - shared libraries
ii  libdirectfb-dev                      1.2.7-2                              direct frame buffer graphics library - development fil
ii  libdirectfb-extra                    1.2.7-2                              direct frame buffer graphics - extra providers
ii  libgtk-directfb-2.0-0                2.14.7-5                             The GTK+ graphical user interface library - DirectFB r
ii  libgtk-directfb-2.0-dev              2.14.7-5   


confirmed, also: the standard GtkLauncher application also shows the
exact same screen corruption on scrolling, using mouse or keyboard.
yet, the same GtkLauncher app when compiled using X-libs is fine.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120684</commentid>
    <comment_count>1</comment_count>
    <who name="Luke Kenneth Casson Leighton">lkcl</who>
    <bug_when>2009-05-11 09:47:48 -0700</bug_when>
    <thetext>also related #22540 which also has screen corruption under gtk-directfb.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121532</commentid>
    <comment_count>2</comment_count>
      <attachid>30393</attachid>
    <who name="Luke Kenneth Casson Leighton">lkcl</who>
    <bug_when>2009-05-15 10:13:22 -0700</bug_when>
    <thetext>Created attachment 30393
switches off fine-tuned paint logic, draws whole view, properly

thanks to paul for the guidance and for the leading work / patches on which this is based, paul, the code that you sent me has a bug where the scrollbars on a frame will go &quot;blank&quot; and disappear when you move the mouse over them. the reason is that the empty rect causes the return out of the paint function, prematurely, i fixed this by allowing the scrollbars always to be painted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121538</commentid>
    <comment_count>3</comment_count>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2009-05-15 10:27:12 -0700</bug_when>
    <thetext>Umm why does this have a + on it?  There&apos;s nothing wrong with this cross-platform code, and you&apos;re changing other platform behavior.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121539</commentid>
    <comment_count>4</comment_count>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2009-05-15 10:36:50 -0700</bug_when>
    <thetext>Also, please don&apos;t mark bugs as reviewed if you are not a reviewer.  I&apos;ll give you the benefit of the doubt and assume you meant to set it to ? instead.

Anyway this patch is no good, since it just turns off blitting on scrolling completely.  This isn&apos;t something you should have to do.  All you&apos;re doing is working around bugs in your port&apos;s blitting implementation by doing this when you should be fixing those bugs.

The code that clips is also unnecessary.  As I said on webkit-dev, it is the responsibility of WebKit to clip to the document dirty rect before you even get into ScrollView paint.  Because you can have nested ScrollViews, repeatedly clipping to the document dirty rect is not something that these ScrollViews should need to do.  

Clipping to the visibleContentRect is necessary for each subframe ScrollView because the dirty rect may partially overlap the frame, but clipping to the document dirty rect should not be needed, as it should only happen once.  It is the WebView&apos;s responsibility to do this clipping in your WebKit port.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121540</commentid>
    <comment_count>5</comment_count>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2009-05-15 10:47:30 -0700</bug_when>
    <thetext>If it turns out your port has buggy blitting and you don&apos;t plan on solving the underlying problem, then in your platform-specific code you can always just set the can blit on scroll flag on the ScrollView to false.  That is the best way to disable all blitting without touching the cross-platform code.  Your scrolling performance is not going to be very good, though, if you do this, so I encourage you to try to figure out what is actually wrong with the underlying platform-specific blitting code (a bug in Cairo perhaps?).
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121542</commentid>
    <comment_count>6</comment_count>
    <who name="Luke Kenneth Casson Leighton">lkcl</who>
    <bug_when>2009-05-15 10:51:29 -0700</bug_when>
    <thetext>sorry, dave, i clicked the wrong button.

also - apologies, i do not know the difference between cross-platform code and other platform code.

all i know is that this works, and fixes a really serious show-stopper problem.  just disabling the blitting (with the #if 0) does not fix the problem.

it is unfortunately completely impractical to go digging around in gtk-directfb, it&apos;s _way_ too complex and time-consuming.

so - a minus review means it&apos;s unacceptable, and will thus remain unfixed.

for those people who will be searching desperately on the internet for ways to get their code out the door, and who do not have time to go fixing up gtk-directfb blitting bugs, or to find out what the bloody hell is going on, try this patch: disable the blitting, and also the bit which changes the rectangles.

i don&apos;t understand how it works, and i don&apos;t care: i just know that it works.  if you don&apos;t add the bit which changes the rectangles, you end up with one &quot;flicker&quot; (screen corruption) when you initially start scrolling a Frame, but only when both the horizontal and vertical scrollbars are both at 0, 0 scroll position.

thereafter, there is no further screen corruption, but even that one incident is too much.

patch the rectangles / clipping as shown in this patch and you will get no more flicker.


dave: paul has already mentioned that there is something wrong with the rectangle / clipping.

thank you for mentioning about the setting in scrollview, that will help other people.

right now, we have the solution, and there is not enough time or money to go hunting through a complex set of code like gtk-directfb or cairo-directfb.

so if anyone else would like to follow up on this, this patch highlights where the problems are, and at least provides a decent interim workaround.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1088284</commentid>
    <comment_count>7</comment_count>
    <who name="Anders Carlsson">andersca</who>
    <bug_when>2015-04-24 11:52:33 -0700</bug_when>
    <thetext>Sounds like this is a bug in the DirectFB GTK+ backend.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>30393</attachid>
            <date>2009-05-15 10:13:22 -0700</date>
            <delta_ts>2010-06-10 17:10:50 -0700</delta_ts>
            <desc>switches off fine-tuned paint logic, draws whole view, properly</desc>
            <filename>f</filename>
            <type>text/plain</type>
            <size>2583</size>
            <attacher name="Luke Kenneth Casson Leighton">lkcl</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYkNvcmUvcGxhdGZvcm0vU2Nyb2xsVmlldy5jcHAgYi9XZWJDb3JlL3Bs
YXRmb3JtL1Njcm9sbFZp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X2hvcml6b250YWxTY3JvbGxi
YXItPnBhaW50KGNvbnRleHQsIHNjcm9sbFZpZXdEaXJ0eVJlY3QpOwogICAgICAgICBpZiAobV92
ZXJ0aWNhbFNjcm9sbGJhcikK
</data>
<flag name="review"
          id="15321"
          type_id="1"
          status="-"
          setter="hyatt"
    />
          </attachment>
      

    </bug>

</bugzilla>