Bug 883646 - Apply the mDevPixelsPerCSSPixel scaling factor in a few places. r=kentuckyfriedtakahe

This commit is contained in:
Kartikaya Gupta 2013-06-20 16:10:57 -04:00
parent 1156439ca4
commit 311eecb4d6
3 changed files with 11 additions and 11 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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;