Clean up APZCTM initialization on Android. (bug 1110540 part 3, r=kats)

This commit is contained in:
David Anderson 2014-12-15 01:49:51 -08:00
parent d556e1e7b3
commit 2a09e33abb
2 changed files with 20 additions and 9 deletions

View File

@ -2496,18 +2496,26 @@ nsWindow::NewCompositorParent(int aSurfaceWidth, int aSurfaceHeight)
mozilla::layers::APZCTreeManager*
nsWindow::GetAPZCTreeManager()
{
if (!sApzcTreeManager) {
CompositorParent* compositor = sCompositorParent;
if (!compositor) {
return nullptr;
}
uint64_t rootLayerTreeId = compositor->RootLayerTreeId();
CompositorParent::SetControllerForLayerTree(rootLayerTreeId, mozilla::widget::android::APZCCallbackHandler::GetInstance());
sApzcTreeManager = CompositorParent::GetAPZCTreeManager(rootLayerTreeId);
}
return sApzcTreeManager;
}
void
nsWindow::ConfigureAPZCTreeManager()
{
nsBaseWidget::ConfigureAPZCTreeManager();
if (!sApzcTreeManager) {
sApzcTreeManager = mAPZC;
}
}
already_AddRefed<GeckoContentController>
nsWindow::CreateRootContentController()
{
nsRefPtr<widget::android::APZCCallbackHandler> controller =
widget::android::APZCCallbackHandler::GetInstance();
return controller.forget();
}
uint64_t
nsWindow::RootLayerTreeId()
{

View File

@ -174,6 +174,9 @@ protected:
void PostFlushIMEChanges();
void FlushIMEChanges();
void ConfigureAPZCTreeManager() MOZ_OVERRIDE;
already_AddRefed<GeckoContentController> CreateRootContentController() MOZ_OVERRIDE;
// Call this function when the users activity is the direct cause of an
// event (like a keypress or mouse click).
void UserActivity();