Bug 1058664 - Update the LD transform to go with the changes in bug 1052063. r=botond

This commit is contained in:
Kartikaya Gupta 2014-08-28 20:11:07 -04:00
parent 2c9ce1520b
commit 4c6b48d9b8

View File

@ -2397,9 +2397,20 @@ Matrix4x4 AsyncPanZoomController::GetNontransientAsyncTransform() {
Matrix4x4 AsyncPanZoomController::GetTransformToLastDispatchedPaint() {
ReentrantMonitorAutoEnter lock(mMonitor);
LayerPoint scrollChange = (mLastContentPaintMetrics.GetScrollOffset() - mLastDispatchedPaintMetrics.GetScrollOffset())
* mLastContentPaintMetrics.LayersPixelsPerCSSPixel();
// Technically we should be taking the scroll delta in the coordinate space
// of transformed layer pixels (i.e. this layer's LayerPixels, with the layer
// transform applied). However in the absence of actual CSS transforms, we
// can use the parent-layer space instead.
// When we fix bug 993525 and properly support CSS transforms we might have
// to revisit this.
ParentLayerPoint scrollChange =
(mLastContentPaintMetrics.GetScrollOffset() - mLastDispatchedPaintMetrics.GetScrollOffset())
* mLastContentPaintMetrics.mDevPixelsPerCSSPixel
* mLastContentPaintMetrics.GetParentResolution();
float zoomChange = mLastContentPaintMetrics.GetZoom().scale / mLastDispatchedPaintMetrics.GetZoom().scale;
return Matrix4x4().Translate(scrollChange.x, scrollChange.y, 0) *
Matrix4x4().Scale(zoomChange, zoomChange, 1);
}