RESOLVED INVALID Bug 113326
[Qt][WK2] Regression(141310): Page flickers during scale animation
https://bugs.webkit.org/show_bug.cgi?id=113326
Summary [Qt][WK2] Regression(141310): Page flickers during scale animation
Andras Becsi
Reported 2013-03-26 10:44:38 PDT
[Qt][WK2] Regression(141310): Page flickers during scale animation
Attachments
Patch (12.10 KB, patch)
2013-03-26 10:46 PDT, Andras Becsi
no flags
Patch (12.99 KB, patch)
2013-03-27 05:12 PDT, Andras Becsi
no flags
Patch (12.96 KB, patch)
2013-04-05 09:41 PDT, Andras Becsi
no flags
Patch (12.99 KB, patch)
2013-04-11 04:27 PDT, Andras Becsi
no flags
Patch (16.95 KB, patch)
2013-04-22 06:25 PDT, Andras Becsi
no flags
Patch (17.04 KB, patch)
2013-05-06 09:33 PDT, Andras Becsi
no flags
Patch (17.03 KB, patch)
2013-05-06 09:44 PDT, Andras Becsi
no flags
Patch (16.95 KB, patch)
2013-05-30 03:00 PDT, Andras Becsi
no flags
Patch (17.03 KB, patch)
2013-05-30 03:12 PDT, Andras Becsi
no flags
Andras Becsi
Comment 1 2013-03-26 10:46:10 PDT
Noam Rosenthal
Comment 2 2013-03-26 10:51:52 PDT
Comment on attachment 195117 [details] Patch I'm ok with the coordinated graphics changes. Can you ask Kenneth/Jocelyn to also look before asking for a WK2 owner sign off?
Andras Becsi
Comment 3 2013-03-26 10:53:31 PDT
(In reply to comment #2) > (From update of attachment 195117 [details]) > I'm ok with the coordinated graphics changes. Can you ask Kenneth/Jocelyn to also look before asking for a WK2 owner sign off? Thanks, Jocelyn could you take a look?
EFL EWS Bot
Comment 4 2013-03-26 11:27:06 PDT
Andras Becsi
Comment 5 2013-03-26 11:29:34 PDT
(In reply to comment #4) > (From update of attachment 195117 [details]) > Attachment 195117 [details] did not pass efl-ews (efl): > Output: http://webkit-commit-queue.appspot.com/results/17236651 Hmm, EFL seems to depend on the wrong behaviour. I'll have to check what's going on there.
Andras Becsi
Comment 6 2013-03-27 05:12:13 PDT
Andras Becsi
Comment 7 2013-03-27 06:22:39 PDT
(In reply to comment #6) > Created an attachment (id=195282) [details] > Patch Fixed the EFL build.
Jocelyn Turcotte
Comment 8 2013-03-27 06:44:27 PDT
Comment on attachment 195282 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=195282&action=review LGTM but here is something that would be nice to verify twice: > Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:140 > + m_drawingAreaProxy->page()->scalePage(scale, roundedIntPoint(rect.location())); > m_drawingAreaProxy->page()->process()->send(Messages::CoordinatedLayerTreeHost::SetVisibleContentsRect(rect, trajectoryVector), m_drawingAreaProxy->page()->pageID()); This might still create the issue that the scale change might trigger a layer flush with a visibleRect's size that is not matching the scale. For example, if you're zommed out and your page coord visible rect is 500x500 with a scale of 0.5 (a window size of 250x250), zooming in would trigger a tile update using a visibleRect of 125x125 with a scale of 2 (again 250x250). If the scale change does trigger a layer flush before the matching visibleRect update message is handled, you'll end up rendering a 500x500 rect with a scale of 2: 1000x1000 for the viewport. 2000x2000 if you take into account the TiledBackingStore 2x cover rect multiplier. Could you verify with some printf in TiledBackingStore::createTiles that the tilesToCreateCount isn't growing astronomically when zooming in? We might not hit that case by luck since a flush is scheduled back on the event loop, giving time to the visible rect update message to be handled, but I'm not sure.
Jocelyn Turcotte
Comment 9 2013-03-27 06:45:52 PDT
The PageViewportController::didChangeContentsVisibility call still in the PageViewportControllerClientEfl::setViewportPosition PVC callback could cause problems with this patch. So hopefully somebody will be testing zooming with EFL.
Andras Becsi
Comment 10 2013-03-27 07:17:45 PDT
(In reply to comment #9) > The PageViewportController::didChangeContentsVisibility call still in the PageViewportControllerClientEfl::setViewportPosition PVC callback could cause problems with this patch. So hopefully somebody will be testing zooming with EFL. Qt also has that call indirectlz through the contentX and contentY change notifications, but EFL needs to call it directly. I did not see any issues there but it would be good if someone could verify.
Andras Becsi
Comment 11 2013-03-27 09:02:55 PDT
(In reply to comment #8) > (From update of attachment 195282 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=195282&action=review > > LGTM but here is something that would be nice to verify twice: > > > Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:140 > > + m_drawingAreaProxy->page()->scalePage(scale, roundedIntPoint(rect.location())); > > m_drawingAreaProxy->page()->process()->send(Messages::CoordinatedLayerTreeHost::SetVisibleContentsRect(rect, trajectoryVector), m_drawingAreaProxy->page()->pageID()); > > This might still create the issue that the scale change might trigger a layer flush with a visibleRect's size that is not matching the scale. > For example, if you're zommed out and your page coord visible rect is 500x500 with a scale of 0.5 (a window size of 250x250), zooming in would trigger a tile update using a visibleRect of 125x125 with a scale of 2 (again 250x250). > > If the scale change does trigger a layer flush before the matching visibleRect update message is handled, you'll end up rendering a 500x500 rect with a scale of 2: 1000x1000 for the viewport. 2000x2000 if you take into account the TiledBackingStore 2x cover rect multiplier. > > Could you verify with some printf in TiledBackingStore::createTiles that the tilesToCreateCount isn't growing astronomically when zooming in? We might not hit that case by luck since a flush is scheduled back on the event loop, giving time to the visible rect update message to be handled, but I'm not sure. I couldn't produce such a scenario. The tile creation always started after the visibleRect update was processed but never in between the scale setting and the visible rect update. I do not have a concept of astronomical in this context but the biggest number of tilesToCreateCount in TiledBackingStore::createTiles was 10 during double-tap zoom-in.
Jocelyn Turcotte
Comment 12 2013-04-02 11:04:02 PDT
Comment on attachment 195282 [details] Patch LGTM for Qt, I'm still not sure for EFL so I think it would be best to get their blessing too.
Jocelyn Turcotte
Comment 13 2013-04-02 11:05:02 PDT
(In reply to comment #11) > I couldn't produce such a scenario. The tile creation always started after the visibleRect update was processed but never in between the scale setting and the visible rect update. > > I do not have a concept of astronomical in this context but the biggest number of tilesToCreateCount in TiledBackingStore::createTiles was 10 during double-tap zoom-in. Ok in any case the patch is an improvement in that regard, thanks for checking.
Andras Becsi
Comment 14 2013-04-03 02:35:36 PDT
(In reply to comment #12) > (From update of attachment 195282 [details]) > LGTM for Qt, I'm still not sure for EFL so I think it would be best to get their blessing too. Kenneth, could you check this for EFL with one of your magic manual tests? I ran a quick test with an EFL build and did not see suspicious behaviour.
Andras Becsi
Comment 15 2013-04-05 05:03:03 PDT
Ping for review?
Andras Becsi
Comment 16 2013-04-05 09:41:55 PDT
Andras Becsi
Comment 17 2013-04-05 09:43:55 PDT
(In reply to comment #16) > Created an attachment (id=196645) [details] > Patch Updated to apply on ToT.
Mikhail Pozdnyakov
Comment 18 2013-04-08 02:04:52 PDT
Comment on attachment 196645 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=196645&action=review > Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:45 > + , m_lastSentScale(0) ah another scale :( but isn't it the same as pagescalefactor from page proxy?
Andras Becsi
Comment 19 2013-04-08 06:05:00 PDT
Comment on attachment 196645 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=196645&action=review >> Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:45 >> + , m_lastSentScale(0) > > ah another scale :( but isn't it the same as pagescalefactor from page proxy? It is technically the same scale factor, but the represented state is different. In theory I could put a scale and scroll position equality check to WebPageProxy::scalePage, but WebPageProxy::m_pageScaleFactor has to be initialized to 1, since it is exposed, so an initial scale setting of 1 would not reach the web process causing behavior change and potential problems. I also think that the name makes the state this variable represents clear, but I could rename it to something like m_lastCommittedPageScaleFactor, if you think it confusing.
Andras Becsi
Comment 20 2013-04-11 04:27:14 PDT
Jocelyn Turcotte
Comment 21 2013-04-17 05:19:43 PDT
Comment on attachment 197573 [details] Patch r=me, just make sure you get an WK2 owner to look at it. (CC'd Benjamin)
Benjamin Poulain
Comment 22 2013-04-17 13:44:36 PDT
Comment on attachment 197573 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=197573&action=review I have two little issues with this patch: I think the method is badly named. Something named "setVisibleContentsRect" should take a rect, not a rect, a scale and a "trajectoryVector" (I assume normalized). You should either split it in three method calls, or look for a more descriptive name. The scale of 1 passed for the page scale factor is really weird. I don't really understand why that would be correct. For example, a page has a scale of 0.3, the user resize the view, shouldn't the scale be re-computed for the viewport parameters? > Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:102 > + float m_lastSentPageScaleFactor; float->double (the page scale factor is typed double).
Andras Becsi
Comment 23 2013-04-17 15:33:30 PDT
(In reply to comment #22) > (From update of attachment 197573 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=197573&action=review > > I have two little issues with this patch: > > I think the method is badly named. > Something named "setVisibleContentsRect" should take a rect, not a rect, a scale and a "trajectoryVector" (I assume normalized). It is not normalized at this point yet. Normalization happens in TiledBackingStore::setTrajectoryVector. > You should either split it in three method calls, or look for a more descriptive name. I'll try to come up with a more descriptive name. > > The scale of 1 passed for the page scale factor is really weird. I don't really understand why that would be correct. For example, a page has a scale of 0.3, the user resize the view, shouldn't the scale be re-computed for the viewport parameters? > We only set the scale to 1 for the "legacy" webview (no fixed layout, i.e. traditional desktop behaviour as well as the QRawWebView). For the QML WebView (with fixed layout) we recalculate each time something changes (see PageViewportController::syncVisibleContents). > > Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:102 > > + float m_lastSentPageScaleFactor; > > float->double (the page scale factor is typed double). Thanks for catching this.
Andras Becsi
Comment 24 2013-04-22 06:25:02 PDT
Jocelyn Turcotte
Comment 25 2013-04-30 01:36:29 PDT
Comment on attachment 199021 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=199021&action=review > Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:131 > +void CoordinatedLayerTreeHostProxy::updateVisibleContentsState(const FloatRect& visibleContetsRect, double pageScaleFactor, const FloatPoint& trajectoryVector) visibleConte*n*tsRect You could also name the method updateContentsVisibility to match PageViewportController::didChangeContentsVisibility
Andras Becsi
Comment 26 2013-05-06 09:33:49 PDT
EFL EWS Bot
Comment 27 2013-05-06 09:38:48 PDT
Andras Becsi
Comment 28 2013-05-06 09:44:18 PDT
Jocelyn Turcotte
Comment 29 2013-05-07 08:22:56 PDT
Comment on attachment 200710 [details] Patch lgtm. Benjamin, could you check again?
Andras Becsi
Comment 30 2013-05-30 03:00:27 PDT
Andras Becsi
Comment 31 2013-05-30 03:01:05 PDT
(In reply to comment #30) > Created an attachment (id=203331) [details] > Patch Updated to ToT.
EFL EWS Bot
Comment 32 2013-05-30 03:09:40 PDT
Andras Becsi
Comment 33 2013-05-30 03:12:16 PDT
Anders Carlsson
Comment 34 2013-10-02 21:32:20 PDT
Comment on attachment 203336 [details] Patch Qt has been removed, clearing review flags.
Allan Sandfeld Jensen
Comment 35 2013-10-03 05:08:12 PDT
I don't see the flicker currently in qt5x2 branch. Is this patch still needed and should we apply it to branch?
Jocelyn Turcotte
Comment 36 2014-02-03 03:25:26 PST
=== Bulk closing of Qt bugs === If you believe that this bug report is still relevant for a non-Qt port of webkit.org, please re-open it and remove [Qt] from the summary. If you believe that this is still an important QtWebKit bug, please fill a new report at https://bugreports.qt-project.org and add a link to this issue. See http://qt-project.org/wiki/ReportingBugsInQt for additional guidelines.
Note You need to log in before you can comment on or make changes to this bug.