Bug 823066 - Provide API for CompositorParent to use custom AsyncPanZoomController. r=drs

--HG--
extra : rebase_source : b2bfaa468261d0a270719215c2bf89c361d0145e
This commit is contained in:
Oleg Romashin 2012-12-20 14:37:20 -08:00
parent 81c076fba4
commit a233ad4a43
2 changed files with 13 additions and 1 deletions

View File

@ -791,8 +791,16 @@ CompositorParent::ApplyAsyncContentTransformToTree(TimeStamp aCurrentFrame,
return appliedTransform;
}
AsyncPanZoomController* controller = nullptr;
// Check if an AsyncPanZoomController is attached to this layer.
if (LayerUserData* data = aLayer->GetUserData(&sPanZoomUserDataKey)) {
AsyncPanZoomController* controller = static_cast<PanZoomUserData*>(data)->mController;
controller = static_cast<PanZoomUserData*>(data)->mController;
} else {
// Check if a derived implementation provides a default AsyncPanZoomController.
controller = GetDefaultPanZoomController();
}
if (controller) {
ShadowLayer* shadow = aLayer->AsShadowLayer();
gfx3DMatrix newTransform;

View File

@ -171,6 +171,10 @@ protected:
virtual void SyncViewportInfo(const nsIntRect& aDisplayPort, float aDisplayResolution, bool aLayersUpdated,
nsIntPoint& aScrollOffset, float& aScaleX, float& aScaleY);
void SetEGLSurfaceSize(int width, int height);
// If SetPanZoomControllerForLayerTree is not set, Compositor will use
// derived class AsyncPanZoomController transformations.
// Compositor will not own AsyncPanZoomController here.
virtual AsyncPanZoomController* GetDefaultPanZoomController() { return nullptr; }
private:
void PauseComposition();