Bug 564993. Part 4: Add trivial user-data API so layout can attach data to layers. r=Bas,sr=vlad

This commit is contained in:
Robert O'Callahan 2010-05-21 15:20:48 +12:00
parent 50796fed5f
commit 17458baeb0

View File

@ -293,6 +293,10 @@ public:
virtual Layer* GetFirstChild() { return nsnull; }
const gfx3DMatrix& GetTransform() { return mTransform; }
// This setter and getter can be used anytime.
void SetUserData(void* aData) { mUserData = aData; }
void* GetUserData() { return mUserData; }
/**
* Only the implementation should call this. This is per-implementation
* private data. Normally, all layers with a given layer manager
@ -314,6 +318,7 @@ protected:
mNextSibling(nsnull),
mPrevSibling(nsnull),
mImplData(aImplData),
mUserData(nsnull),
mOpacity(1.0),
mUseClipRect(PR_FALSE),
mIsOpaqueContent(PR_FALSE)
@ -324,6 +329,7 @@ protected:
Layer* mNextSibling;
Layer* mPrevSibling;
void* mImplData;
void* mUserData;
gfx3DMatrix mTransform;
float mOpacity;
nsIntRect mClipRect;