diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index cd9f03b4142..c77db3ce68b 100644 --- a/b2g/app/b2g.js +++ b/b2g/app/b2g.js @@ -870,9 +870,9 @@ pref("osfile.reset_worker_delay", 5000); pref("apz.asyncscroll.throttle", 40); pref("apz.pan_repaint_interval", 16); -// Maximum fling velocity in px/ms. Slower devices may need to reduce this +// Maximum fling velocity in inches/ms. Slower devices may need to reduce this // to avoid checkerboarding. Note, float value must be set as a string. -pref("apz.max_velocity_pixels_per_ms", "6.0"); +pref("apz.max_velocity_pixels_per_inch", "0.0375"); // Tweak default displayport values to reduce the risk of running out of // memory when zooming in diff --git a/gfx/layers/ipc/Axis.cpp b/gfx/layers/ipc/Axis.cpp index 3d08ae2faf1..f3a4412beae 100644 --- a/gfx/layers/ipc/Axis.cpp +++ b/gfx/layers/ipc/Axis.cpp @@ -8,6 +8,7 @@ #include // for fabsf, pow, powf #include // for max #include "AsyncPanZoomController.h" // for AsyncPanZoomController +#include "mozilla/layers/APZCTreeManager.h" // for APZCTreeManager #include "FrameMetrics.h" // for FrameMetrics #include "mozilla/Attributes.h" // for MOZ_FINAL #include "mozilla/Preferences.h" // for Preferences @@ -65,9 +66,9 @@ namespace layers { */ /** - * "apz.max_velocity_pixels_per_ms" + * "apz.max_velocity_pixels_per_inch" * - * Maximum velocity in pixels per millisecond. Velocity will be capped at this + * Maximum velocity in inches per millisecond. Velocity will be capped at this * value if a faster fling occurs. Negative values indicate unlimited velocity. * * The default value is -1.0f, set in gfxPrefs.h @@ -84,7 +85,7 @@ Axis::Axis(AsyncPanZoomController* aAsyncPanZoomController) void Axis::UpdateWithTouchAtDevicePoint(int32_t aPos, const TimeDuration& aTimeDelta) { float newVelocity = mAxisLocked ? 0 : (mPos - aPos) / aTimeDelta.ToMilliseconds(); if (gfxPrefs::APZMaxVelocity() > 0.0f) { - newVelocity = std::min(newVelocity, gfxPrefs::APZMaxVelocity()); + newVelocity = std::min(newVelocity, gfxPrefs::APZMaxVelocity() * APZCTreeManager::GetDPI()); } mVelocity = newVelocity; diff --git a/gfx/thebes/gfxPrefs.h b/gfx/thebes/gfxPrefs.h index 8564ef9b3c6..2c93769ae2c 100644 --- a/gfx/thebes/gfxPrefs.h +++ b/gfx/thebes/gfxPrefs.h @@ -106,7 +106,7 @@ private: DECL_GFX_PREF(Once, "apz.fling_friction", APZFlingFriction, float, 0.002f); DECL_GFX_PREF(Once, "apz.fling_stopped_threshold", APZFlingStoppedThreshold, float, 0.01f); DECL_GFX_PREF(Once, "apz.max_event_acceleration", APZMaxEventAcceleration, float, 999.0f); - DECL_GFX_PREF(Once, "apz.max_velocity_pixels_per_ms", APZMaxVelocity, float, -1.0f); + DECL_GFX_PREF(Once, "apz.max_velocity_pixels_per_inch", APZMaxVelocity, float, -1.0f); DECL_GFX_PREF(Once, "apz.max_velocity_queue_size", APZMaxVelocityQueueSize, uint32_t, 5); DECL_GFX_PREF(Once, "gfx.android.rgb16.force", AndroidRGB16Force, bool, false);