Bug 718014 - Restrict dirty rect to subrect of tile texture

--HG--
extra : rebase_source : bbe56fd271b08e908eb301b5b0839a80bce139fb
This commit is contained in:
James Willcox 2012-01-18 10:41:30 -05:00
parent fdd7a080be
commit 4c88772ec9

View File

@ -1188,6 +1188,8 @@ nsWindow::OnDraw(AndroidGeckoEvent *ae)
AndroidBridge::Bridge()->GetSoftwareLayerClient();
client.BeginDrawing(gAndroidBounds.width, gAndroidBounds.height);
nsIntRect dirtyRect = ae->Rect().Intersect(nsIntRect(0, 0, gAndroidBounds.width, gAndroidBounds.height));
nsAutoString metadata;
unsigned char *bits = NULL;
if (sHasDirectTexture) {
@ -1196,7 +1198,7 @@ nsWindow::OnDraw(AndroidGeckoEvent *ae)
sDirectTexture->Reallocate(gAndroidBounds.width, gAndroidBounds.height);
}
sDirectTexture->Lock(AndroidGraphicBuffer::UsageSoftwareWrite, ae->Rect(), &bits);
sDirectTexture->Lock(AndroidGraphicBuffer::UsageSoftwareWrite, dirtyRect, &bits);
} else {
bits = client.LockBufferBits();
}
@ -1229,7 +1231,7 @@ nsWindow::OnDraw(AndroidGeckoEvent *ae)
break;
} else {
targetSurface->SetDeviceOffset(gfxPoint(-x, -y));
DrawTo(targetSurface, ae->Rect());
DrawTo(targetSurface, dirtyRect);
}
}
}
@ -1246,7 +1248,7 @@ nsWindow::OnDraw(AndroidGeckoEvent *ae)
client.UnlockBuffer();
}
client.EndDrawing(ae->Rect(), metadata);
client.EndDrawing(dirtyRect, metadata);
return;
#endif