From 328fc74788fd975de4b4091843af18c5d37c7713 Mon Sep 17 00:00:00 2001 From: Anthony Jones Date: Tue, 22 Jan 2013 17:04:41 +1300 Subject: [PATCH] Bug 831973 - Remove extra scroll compensation code; r=roc --- gfx/layers/ipc/CompositorParent.cpp | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/gfx/layers/ipc/CompositorParent.cpp b/gfx/layers/ipc/CompositorParent.cpp index 753d73193754..28788fb6f2d5 100644 --- a/gfx/layers/ipc/CompositorParent.cpp +++ b/gfx/layers/ipc/CompositorParent.cpp @@ -526,8 +526,6 @@ private: if (AsyncPanZoomController* apzc = state->mController) { referent->SetUserData(&sPanZoomUserDataKey, new PanZoomUserData(apzc)); - } else { - CompensateForContentScrollOffset(ref, referent); } } else { ref->DetachReferentLayer(referent); @@ -542,31 +540,6 @@ private: } } - // XXX the fact that we have to do this evidence of bad API design. - void CompensateForContentScrollOffset(Layer* aContainer, - Layer* aShadowContent) - { - ContainerLayer* c = aShadowContent->AsContainerLayer(); - if (!c) { - return; - } - const FrameMetrics& fm = c->GetFrameMetrics(); - gfx3DMatrix m(aContainer->GetTransform()); - m.Translate(gfxPoint3D(-fm.GetScrollOffsetInLayerPixels().x, - -fm.GetScrollOffsetInLayerPixels().y, 0)); - - // The transform already takes the resolution scale into account. Since we - // will apply the resolution scale again when computing the effective - // transform, we must apply the inverse resolution scale here. - m.Scale(1.0f/c->GetPreXScale(), - 1.0f/c->GetPreYScale(), - 1); - m.ScalePost(1.0f/c->GetPostXScale(), - 1.0f/c->GetPostYScale(), - 1); - aContainer->AsShadowLayer()->SetShadowTransform(m); - } - bool IsSameDimension(ScreenOrientation o1, ScreenOrientation o2) { bool isO1portrait = (o1 == eScreenOrientation_PortraitPrimary || o1 == eScreenOrientation_PortraitSecondary); bool isO2portrait = (o2 == eScreenOrientation_PortraitPrimary || o2 == eScreenOrientation_PortraitSecondary);