mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1208636 - Adjust displayport size based on available system memory. r=kats
This commit is contained in:
parent
67b6b9da61
commit
69cfc343d1
@ -6,11 +6,13 @@
|
||||
#include "APZCTreeManager.h"
|
||||
#include "AsyncPanZoomController.h"
|
||||
#include "Compositor.h" // for Compositor
|
||||
#include "gfxPrefs.h" // for gfxPrefs
|
||||
#include "HitTestingTreeNode.h" // for HitTestingTreeNode
|
||||
#include "InputBlockState.h" // for InputBlockState
|
||||
#include "InputData.h" // for InputData, etc
|
||||
#include "Layers.h" // for Layer, etc
|
||||
#include "mozilla/dom/Touch.h" // for Touch
|
||||
#include "mozilla/gfx/Logging.h" // for gfx::TreeLog
|
||||
#include "mozilla/gfx/Point.h" // for Point
|
||||
#include "mozilla/layers/APZThreadUtils.h" // for AssertOnCompositorThread, etc
|
||||
#include "mozilla/layers/AsyncCompositionManager.h" // for ViewTransform
|
||||
@ -24,14 +26,12 @@
|
||||
#include "nsDebug.h" // for NS_WARNING
|
||||
#include "nsPoint.h" // for nsIntPoint
|
||||
#include "nsThreadUtils.h" // for NS_IsMainThread
|
||||
#include "mozilla/gfx/Logging.h" // for gfx::TreeLog
|
||||
#include "UnitTransforms.h" // for ViewAs
|
||||
#include "gfxPrefs.h" // for gfxPrefs
|
||||
#include "OverscrollHandoffState.h" // for OverscrollHandoffState
|
||||
#include "TaskThrottler.h" // for TaskThrottler
|
||||
#include "TreeTraversal.h" // for generic tree traveral algorithms
|
||||
#include "LayersLogging.h" // for Stringify
|
||||
#include "Units.h" // for ParentlayerPixel
|
||||
#include "UnitTransforms.h" // for ViewAs
|
||||
|
||||
#define ENABLE_APZCTM_LOGGING 0
|
||||
// #define ENABLE_APZCTM_LOGGING 1
|
||||
|
@ -63,6 +63,7 @@
|
||||
#include "nsStyleStruct.h" // for nsTimingFunction
|
||||
#include "nsTArray.h" // for nsTArray, nsTArray_Impl, etc
|
||||
#include "nsThreadUtils.h" // for NS_IsMainThread
|
||||
#include "prsystem.h" // for PR_GetPhysicalMemorySize
|
||||
#include "SharedMemoryBasic.h" // for SharedMemoryBasic
|
||||
#include "WheelScrollAnimation.h"
|
||||
|
||||
@ -329,6 +330,11 @@ using mozilla::gfx::PointTyped;
|
||||
* The multiplier we apply to the displayport size if it is not skating (see
|
||||
* documentation for the skate size multipliers above).
|
||||
*
|
||||
* \li\b apz.x_skate_highmem_adjust
|
||||
* \li\b apz.y_skate_highmem_adjust
|
||||
* On high memory systems, we adjust the displayport during skating
|
||||
* to be larger so we can reduce checkerboarding.
|
||||
*
|
||||
* \li\b apz.zoom_animation_duration_ms
|
||||
* This controls how long the zoom-to-rect animation takes.\n
|
||||
* Units: ms
|
||||
@ -344,6 +350,16 @@ StaticAutoPtr<ComputedTimingFunction> gZoomAnimationFunction;
|
||||
*/
|
||||
StaticAutoPtr<ComputedTimingFunction> gVelocityCurveFunction;
|
||||
|
||||
/**
|
||||
* Returns true if this is a high memory system and we can use
|
||||
* extra memory for a larger displayport to reduce checkerboarding.
|
||||
*/
|
||||
static bool gIsHighMemSystem = false;
|
||||
static bool IsHighMemSystem()
|
||||
{
|
||||
return gIsHighMemSystem;
|
||||
}
|
||||
|
||||
/**
|
||||
* Maximum zoom amount, always used, even if a page asks for higher.
|
||||
*/
|
||||
@ -802,6 +818,10 @@ AsyncPanZoomController::InitializeGlobalState()
|
||||
gfxPrefs::APZCurveFunctionX2(),
|
||||
gfxPrefs::APZCurveFunctionY2()));
|
||||
ClearOnShutdown(&gVelocityCurveFunction);
|
||||
|
||||
uint64_t sysmem = PR_GetPhysicalMemorySize();
|
||||
uint64_t threshold = 1LL << 32; // 4 GB in bytes
|
||||
gIsHighMemSystem = sysmem >= threshold;
|
||||
}
|
||||
|
||||
AsyncPanZoomController::AsyncPanZoomController(uint64_t aLayersId,
|
||||
@ -2428,6 +2448,11 @@ CalculateDisplayPortSize(const CSSSize& aCompositionSize,
|
||||
? gfxPrefs::APZYStationarySizeMultiplier()
|
||||
: gfxPrefs::APZYSkateSizeMultiplier();
|
||||
|
||||
if (IsHighMemSystem()) {
|
||||
xMultiplier += gfxPrefs::APZXSkateHighMemAdjust();
|
||||
yMultiplier += gfxPrefs::APZYSkateHighMemAdjust();
|
||||
}
|
||||
|
||||
// Ensure that it is at least as large as the visible area inflated by the
|
||||
// danger zone. If this is not the case then the "AboutToCheckerboard"
|
||||
// function in TiledContentClient.cpp will return true even in the stable
|
||||
|
@ -185,8 +185,10 @@ private:
|
||||
DECL_GFX_PREF(Live, "apz.velocity_bias", APZVelocityBias, float, 1.0f);
|
||||
DECL_GFX_PREF(Live, "apz.velocity_relevance_time_ms", APZVelocityRelevanceTime, uint32_t, 150);
|
||||
DECL_GFX_PREF(Live, "apz.x_skate_size_multiplier", APZXSkateSizeMultiplier, float, 1.5f);
|
||||
DECL_GFX_PREF(Live, "apz.x_skate_highmem_adjust", APZXSkateHighMemAdjust, float, 0.0f);
|
||||
DECL_GFX_PREF(Live, "apz.x_stationary_size_multiplier", APZXStationarySizeMultiplier, float, 3.0f);
|
||||
DECL_GFX_PREF(Live, "apz.y_skate_size_multiplier", APZYSkateSizeMultiplier, float, 2.5f);
|
||||
DECL_GFX_PREF(Live, "apz.y_skate_highmem_adjust", APZYSkateHighMemAdjust, float, 0.0f);
|
||||
DECL_GFX_PREF(Live, "apz.y_stationary_size_multiplier", APZYStationarySizeMultiplier, float, 3.5f);
|
||||
DECL_GFX_PREF(Live, "apz.zoom_animation_duration_ms", APZZoomAnimationDuration, int32_t, 250);
|
||||
|
||||
|
@ -582,6 +582,8 @@ pref("apz.smooth_scroll_repaint_interval", 16);
|
||||
pref("apz.pan_repaint_interval", 16);
|
||||
pref("apz.x_skate_size_multiplier", "2.5");
|
||||
pref("apz.y_skate_size_multiplier", "3.5");
|
||||
pref("apz.x_skate_highmem_adjust", "1.0");
|
||||
pref("apz.y_skate_highmem_adjust", "2.5");
|
||||
#else
|
||||
// Mobile prefs
|
||||
pref("apz.fling_repaint_interval", 75);
|
||||
@ -589,6 +591,8 @@ pref("apz.smooth_scroll_repaint_interval", 75);
|
||||
pref("apz.pan_repaint_interval", 250);
|
||||
pref("apz.x_skate_size_multiplier", "1.5");
|
||||
pref("apz.y_skate_size_multiplier", "2.5");
|
||||
pref("apz.x_skate_highmem_adjust", "0.0");
|
||||
pref("apz.y_skate_highmem_adjust", "0.0");
|
||||
#endif
|
||||
|
||||
// APZ testing (bug 961289)
|
||||
|
Loading…
Reference in New Issue
Block a user