As a security precaution, we have turned on the setting "Require API key authentication for API requests" for everyone. If this has broken something, please contact
Last Comment Bug 776310 - Tune flinging friction and logic in AsyncPanZoomController
: Tune flinging friction and logic in AsyncPanZoomController
Product: Core
Classification: Components
Component: Graphics: Layers (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla17
Assigned To: Doug Sherk (:drs) (inactive)
: Milan Sreckovic [:milan]
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:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

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

Description User image 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 User image Doug Sherk (:drs) (inactive) 2012-07-21 20:27:18 PDT
Created attachment 644714 [details] [diff] [review]
Proposed patch
Comment 2 User image 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 User image Doug Sherk (:drs) (inactive) 2012-07-21 22:56:55 PDT
I believe it may have been getting short-circuited.
Comment 4 User image Doug Sherk (:drs) (inactive) 2012-07-22 18:54:08 PDT
Comment 5 User image Ed Morley [:emorley] 2012-07-23 06:41:08 PDT

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