Bug 92499 - [chromium] Convert screen space scroll gestures to layer space
Summary: [chromium] Convert screen space scroll gestures to layer space
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sami Kyöstilä
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-27 06:07 PDT by Sami Kyöstilä
Modified: 2012-08-20 04:02 PDT (History)
8 users (show)

See Also:


Attachments
Patch (27.98 KB, patch)
2012-07-27 06:18 PDT, Sami Kyöstilä
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from gce-cr-linux-01 (316.92 KB, application/zip)
2012-07-27 07:51 PDT, WebKit Review Bot
no flags Details
Patch (46.43 KB, patch)
2012-08-16 06:22 PDT, Sami Kyöstilä
no flags Details | Formatted Diff | Diff
Patch (47.16 KB, patch)
2012-08-16 07:08 PDT, Sami Kyöstilä
no flags Details | Formatted Diff | Diff
Patch (47.15 KB, patch)
2012-08-20 02:25 PDT, Sami Kyöstilä
no flags Details | Formatted Diff | Diff
Patch (47.15 KB, patch)
2012-08-20 03:10 PDT, Sami Kyöstilä
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sami Kyöstilä 2012-07-27 06:07:20 PDT
[chromium] Convert screen space scroll gestures to layer space
Comment 1 Sami Kyöstilä 2012-07-27 06:18:39 PDT
Created attachment 154925 [details]
Patch

Work-in-progress. Still trying to improve the diagonal scroll behavior
Comment 2 WebKit Review Bot 2012-07-27 07:51:16 PDT
Comment on attachment 154925 [details]
Patch

Attachment 154925 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/13373427

New failing tests:
CCLayerTreeHostImplTest.scrollRotatedLayer
Comment 3 WebKit Review Bot 2012-07-27 07:51:19 PDT
Created attachment 154950 [details]
Archive of layout-test-results from gce-cr-linux-01

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: gce-cr-linux-01  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-2.6.39-gcg-201203291735-x86_64-with-Ubuntu-10.04-lucid
Comment 4 Shawn Singh 2012-07-31 16:04:36 PDT
Comment on attachment 154925 [details]
Patch

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

> Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:919
> +    FloatPoint actualScreenSpaceEndPoint = CCMathUtil::projectPoint(layerImpl.screenSpaceTransform(), actualLocalEndPoint, endClipped);

shouldn't this be layerImpl.screenSpaceTransform().inverse() ??

> Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:921
> +    if (endClipped)
> +        return FloatSize();

I think this is a reasonable thing to do for production code, but I personally don't ever expect this to happen.   If you find this case happening (after resolving the previous comment), could you please send me some information about the screenSpacePoint, screenSpaceDelta, and all the transforms?  I think this would be an important scenario to understand if it happens, since it shouldn't happen.  On the other hand, I'm not certain enough that it would be wrong, so an ASSERT is not appropriate until we check when this case might occur.
Comment 5 Sami Kyöstilä 2012-08-14 04:27:52 PDT
(In reply to comment #4)
> > Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:919
> > +    FloatPoint actualScreenSpaceEndPoint = CCMathUtil::projectPoint(layerImpl.screenSpaceTransform(), actualLocalEndPoint, endClipped);
> 
> shouldn't this be layerImpl.screenSpaceTransform().inverse() ??

How so? We're going from local layer coordinates to screen coordinates, so as far as I can tell the forward screen space transform is what we need, right?

> > Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:921
> > +    if (endClipped)
> > +        return FloatSize();
> 
> I think this is a reasonable thing to do for production code, but I personally don't ever expect this to happen.   If you find this case happening (after resolving the previous comment), could you please send me some information about the screenSpacePoint, screenSpaceDelta, and all the transforms?  I think this would be an important scenario to understand if it happens, since it shouldn't happen.  On the other hand, I'm not certain enough that it would be wrong, so an ASSERT is not appropriate until we check when this case might occur.

This was just a safeguard -- I haven't actually seen this happening. Sounds like it would be useful to catch these cases, so I'll add a debug assertion here (and retain the early-out to ensure things keep working on release mode).
Comment 6 Dana Jansens 2012-08-15 09:04:21 PDT
(In reply to comment #5)
> (In reply to comment #4)
> > > Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:919
> > > +    FloatPoint actualScreenSpaceEndPoint = CCMathUtil::projectPoint(layerImpl.screenSpaceTransform(), actualLocalEndPoint, endClipped);
> > 
> > shouldn't this be layerImpl.screenSpaceTransform().inverse() ??
> 
> How so? We're going from local layer coordinates to screen coordinates, so as far as I can tell the forward screen space transform is what we need, right?

If so, then you wan mapPoint not projectPoint I believe.
Comment 7 Sami Kyöstilä 2012-08-15 09:54:41 PDT
(In reply to comment #6)
> If so, then you wan mapPoint not projectPoint I believe.

Ah, that makes much more sense, thanks!
Comment 8 Sami Kyöstilä 2012-08-16 06:22:01 PDT
Created attachment 158796 [details]
Patch
Comment 9 Hans Wennborg 2012-08-16 06:55:20 PDT
Comment on attachment 158796 [details]
Patch

I can't really contribute anything here, but here are some drive-by nits anyway :)

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

> Source/WebCore/platform/graphics/chromium/cc/CCInputHandler.h:58
> +    // Scroll the layer selected with scrollBegin() starting from the given

ultra ultra nit: i'd go for "the selected layer" over "the layer selected"

> Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:899
> +static FloatSize scrollLayerWithScreenSpaceDelta(CCLayerImpl& layerImpl,

nit: no need to break the line here, i think

> Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp:162
> +        layer->setPosition(FloatPoint(0, 0));

maybe just FloatPoint() ?
Comment 10 Sami Kyöstilä 2012-08-16 07:07:38 PDT
(In reply to comment #9)
> I can't really contribute anything here, but here are some drive-by nits anyway :)

Any and all nits are welcome :)

> View in context: https://bugs.webkit.org/attachment.cgi?id=158796&action=review
> 
> > Source/WebCore/platform/graphics/chromium/cc/CCInputHandler.h:58
> > +    // Scroll the layer selected with scrollBegin() starting from the given
> 
> ultra ultra nit: i'd go for "the selected layer" over "the layer selected"

Yeah, that's a little awkward. Rephrasing.
 
> > Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:899
> > +static FloatSize scrollLayerWithScreenSpaceDelta(CCLayerImpl& layerImpl,
> 
> nit: no need to break the line here, i think

Done.

> > Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp:162
> > +        layer->setPosition(FloatPoint(0, 0));
> 
> maybe just FloatPoint() ?

True. I think I'll just drop this since the position is implicitly at (0, 0).
Comment 11 Sami Kyöstilä 2012-08-16 07:08:23 PDT
Created attachment 158810 [details]
Patch
Comment 12 WebKit Review Bot 2012-08-19 12:27:35 PDT
Comment on attachment 158810 [details]
Patch

Rejecting attachment 158810 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:
eded at 1149 (offset 20 lines).
Hunk #22 succeeded at 1161 (offset 20 lines).
Hunk #23 succeeded at 1175 (offset 20 lines).
patching file Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
patching file Source/WebKit/chromium/tests/CCMathUtilTest.cpp
patching file Source/WebKit/chromium/tests/WebCompositorInputHandlerImplTest.cpp

Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--force', u'--reviewer', u'James Robi..." exit_code: 1 cwd: /mnt/git/webkit-commit-queue/

Full output: http://queues.webkit.org/results/13537465
Comment 13 Sami Kyöstilä 2012-08-20 02:25:01 PDT
Created attachment 159377 [details]
Patch

Rebased.
Comment 14 WebKit Review Bot 2012-08-20 03:07:26 PDT
Comment on attachment 159377 [details]
Patch

Rejecting attachment 159377 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 1

ERROR: /mnt/git/webkit-commit-queue/Source/WebKit/chromium/ChangeLog neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive).

Full output: http://queues.webkit.org/results/13542266
Comment 15 Sami Kyöstilä 2012-08-20 03:10:27 PDT
Created attachment 159382 [details]
Patch

Also update the second ChangeLog.
Comment 16 WebKit Review Bot 2012-08-20 04:01:57 PDT
Comment on attachment 159382 [details]
Patch

Clearing flags on attachment: 159382

Committed r126018: <http://trac.webkit.org/changeset/126018>
Comment 17 WebKit Review Bot 2012-08-20 04:02:02 PDT
All reviewed patches have been landed.  Closing bug.