Last Comment Bug 776310 - Tune flinging friction and logic in AsyncPanZoomController
: Tune flinging friction and logic in AsyncPanZoomController
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Graphics: Layers (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla17
Assigned To: Doug Sherk (:drs) (inactive)
:
Mentors:
Depends on:
Blocks: 745136
  Show dependency treegraph
 
Reported: 2012-07-21 20:24 PDT by Doug Sherk (:drs) (inactive)
Modified: 2012-07-23 06:41 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Proposed patch (3.74 KB, patch)
2012-07-21 20:27 PDT, Doug Sherk (:drs) (inactive)
cjones.bugs: review+
Details | Diff | Splinter Review

Description Doug Sherk (:drs) (inactive) 2012-07-21 20:24:14 PDT
Flings run very slow in no-opt/debug builds and sometimes have logical errors like applying too much resistance during very large time steps that the fling actually goes backwards.

In addition, the frictions values are very far off from being optimal. Now that gralloc has landed on B2G, I can properly tune it. This will probably need additional work in the future.
Comment 1 Doug Sherk (:drs) (inactive) 2012-07-21 20:27:18 PDT
Created attachment 644714 [details] [diff] [review]
Proposed patch
Comment 2 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-07-21 22:49:33 PDT
Comment on attachment 644714 [details] [diff] [review]
Proposed patch

>diff --git a/gfx/layers/ipc/AsyncPanZoomController.cpp b/gfx/layers/ipc/AsyncPanZoomController.cpp

>-  if (!mX.FlingApplyFrictionOrCancel(aDelta) && !mY.FlingApplyFrictionOrCancel(aDelta)) {
>+  bool shouldContinueFlingX = mX.FlingApplyFrictionOrCancel(aDelta),
>+       shouldContinueFlingY = mY.FlingApplyFrictionOrCancel(aDelta);
>+  // If we shouldn't continue the fling, let's just stop and repaint.
>+  if (!shouldContinueFlingX && !shouldContinueFlingY) {

Let's do

  if (mX.Blah() || mY.Blah()) {
Comment 3 Doug Sherk (:drs) (inactive) 2012-07-21 22:56:55 PDT
I believe it may have been getting short-circuited.
Comment 4 Doug Sherk (:drs) (inactive) 2012-07-22 18:54:08 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/8aa24637d3fa
Comment 5 Ed Morley [:emorley] 2012-07-23 06:41:08 PDT
https://hg.mozilla.org/mozilla-central/rev/8aa24637d3fa

Note You need to log in before you can comment on or make changes to this bug.