mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 883646 - Apply the mDevPixelsPerCSSPixel scaling factor in a few places. r=kentuckyfriedtakahe
This commit is contained in:
parent
1156439ca4
commit
311eecb4d6
@ -408,8 +408,8 @@ ClientLayerManager::ProgressiveUpdateCallback(bool aHasPendingNewThebesContent,
|
||||
// This is derived from the code in
|
||||
// gfx/layers/ipc/CompositorParent.cpp::TransformShadowTree.
|
||||
const gfx3DMatrix& rootTransform = GetRoot()->GetTransform();
|
||||
CSSToLayerScale paintScale = LayerToCSSScale(rootTransform.GetXScale(),
|
||||
rootTransform.GetYScale()).Inverse();
|
||||
CSSToLayerScale paintScale(metrics.mDevPixelsPerCSSPixel / rootTransform.GetXScale(),
|
||||
metrics.mDevPixelsPerCSSPixel / rootTransform.GetYScale());
|
||||
const CSSRect& metricsDisplayPort =
|
||||
(aDrawingCritical && !metrics.mCriticalDisplayPort.IsEmpty()) ?
|
||||
metrics.mCriticalDisplayPort : metrics.mDisplayPort;
|
||||
|
@ -351,12 +351,13 @@ AsyncCompositionManager::ApplyAsyncContentTransformToTree(TimeStamp aCurrentFram
|
||||
|
||||
const gfx3DMatrix& rootTransform = mLayerManager->GetRoot()->GetTransform();
|
||||
const FrameMetrics& metrics = container->GetFrameMetrics();
|
||||
float paintScale = metrics.mDevPixelsPerCSSPixel / rootTransform.GetXScale();
|
||||
CSSRect displayPort(metrics.mCriticalDisplayPort.IsEmpty() ?
|
||||
metrics.mDisplayPort : metrics.mCriticalDisplayPort);
|
||||
gfx::Margin fixedLayerMargins(0, 0, 0, 0);
|
||||
ScreenPoint offset(0, 0);
|
||||
SyncFrameMetrics(scrollOffset, treeTransform.mScale.scale, metrics.mScrollableRect,
|
||||
mLayersUpdated, displayPort, 1 / rootTransform.GetXScale(),
|
||||
mLayersUpdated, displayPort, paintScale,
|
||||
mIsFirstPaint, fixedLayerMargins, offset);
|
||||
|
||||
mIsFirstPaint = false;
|
||||
@ -404,8 +405,8 @@ AsyncCompositionManager::TransformScrollableLayer(Layer* aLayer, const gfx3DMatr
|
||||
|
||||
gfx3DMatrix treeTransform;
|
||||
|
||||
CSSToLayerScale geckoZoom = LayerToCSSScale(aRootTransform.GetXScale(),
|
||||
aRootTransform.GetYScale()).Inverse();
|
||||
CSSToLayerScale geckoZoom(metrics.mDevPixelsPerCSSPixel / aRootTransform.GetXScale(),
|
||||
metrics.mDevPixelsPerCSSPixel / aRootTransform.GetYScale());
|
||||
|
||||
LayerIntPoint scrollOffsetLayerPixels = RoundedToInt(metrics.mScrollOffset * geckoZoom);
|
||||
|
||||
|
@ -1085,12 +1085,6 @@ bool AsyncPanZoomController::SampleContentTransformForFrame(const TimeStamp& aSa
|
||||
// responsibility to schedule a composite.
|
||||
bool requestAnimationFrame = false;
|
||||
|
||||
const gfx3DMatrix& currentTransform = aLayer->GetTransform();
|
||||
|
||||
// Scales on the root layer, on what's currently painted.
|
||||
LayerToCSSScale rootScale(currentTransform.GetXScale(),
|
||||
currentTransform.GetYScale());
|
||||
|
||||
LayerPoint metricsScrollOffset;
|
||||
CSSPoint scrollOffset;
|
||||
CSSToScreenScale localScale;
|
||||
@ -1184,6 +1178,11 @@ bool AsyncPanZoomController::SampleContentTransformForFrame(const TimeStamp& aSa
|
||||
mAsyncScrollTimeout);
|
||||
}
|
||||
|
||||
// Scales on the root layer, on what's currently painted.
|
||||
const gfx3DMatrix& currentTransform = aLayer->GetTransform();
|
||||
LayerToCSSScale rootScale(currentTransform.GetXScale() / frame.mDevPixelsPerCSSPixel,
|
||||
currentTransform.GetYScale() / frame.mDevPixelsPerCSSPixel);
|
||||
|
||||
LayerPoint translation = (scrollOffset / rootScale) - metricsScrollOffset;
|
||||
*aNewTransform = ViewTransform(-translation, localScale);
|
||||
aScrollOffset = scrollOffset * localScale;
|
||||
|
Loading…
Reference in New Issue
Block a user