Bug 831973 - Remove extra scroll compensation code; r=roc

This commit is contained in:
Anthony Jones 2013-01-22 17:04:41 +13:00
Родитель f1e304e86c
Коммит 328fc74788
1 изменённых файлов: 0 добавлений и 27 удалений

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

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