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

This commit is contained in:
Kartikaya Gupta 2013-06-21 17:03:55 -04:00
Родитель ae3d56cd46
Коммит 38b709e375
3 изменённых файлов: 11 добавлений и 11 удалений

Просмотреть файл

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