Bug 797942 - Update compositor size on SIZE_CHANGED or SetCompositor, but only at startup; r=snorp

This commit is contained in:
Geoff Brown 2012-10-23 13:53:00 -06:00
Родитель fbbae394e8
Коммит 1b26174e2e
1 изменённых файлов: 13 добавлений и 0 удалений

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

@ -771,6 +771,13 @@ nsWindow::OnGlobalAndroidEvent(AndroidGeckoEvent *ae)
if (ae->Type() == AndroidGeckoEvent::FORCED_RESIZE || nw != gAndroidBounds.width ||
nh != gAndroidBounds.height) {
if (sCompositorParent != 0 && gAndroidBounds.width == 0) {
// Propagate size change to compositor. This is sometimes essential
// on startup, because the window size may not have been available
// when the compositor was created.
ScheduleResumeComposition(nw, nh);
}
gAndroidBounds.width = nw;
gAndroidBounds.height = nh;
@ -2242,8 +2249,14 @@ void
nsWindow::SetCompositor(mozilla::layers::CompositorParent* aCompositorParent,
mozilla::layers::CompositorChild* aCompositorChild)
{
bool sizeChangeNeeded = (aCompositorParent && !sCompositorParent && gAndroidBounds.width != 0);
sCompositorParent = aCompositorParent;
sCompositorChild = aCompositorChild;
if (sizeChangeNeeded) {
ScheduleResumeComposition(gAndroidBounds.width, gAndroidBounds.height);
}
}
void