bug 606730 - Remote thebesLayer BG color rendering always, even if it's not visible, Part 1: Add mLastChild to all ContainerLayer r=roc a=roc

This commit is contained in:
Tatiana Meshkova 2010-11-16 18:33:56 -05:00
Родитель dfacbe1834
Коммит cdf92598c9
5 изменённых файлов: 33 добавлений и 0 удалений

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

@ -590,6 +590,7 @@ public:
Layer* GetNextSibling() { return mNextSibling; }
Layer* GetPrevSibling() { return mPrevSibling; }
virtual Layer* GetFirstChild() { return nsnull; }
virtual Layer* GetLastChild() { return nsnull; }
const gfx3DMatrix& GetTransform() { return mTransform; }
/**
@ -885,6 +886,7 @@ public:
// These getters can be used anytime.
virtual Layer* GetFirstChild() { return mFirstChild; }
virtual Layer* GetLastChild() { return mLastChild; }
const FrameMetrics& GetFrameMetrics() { return mFrameMetrics; }
MOZ_LAYER_DECL_NAME("ContainerLayer", TYPE_CONTAINER)
@ -914,6 +916,7 @@ protected:
ContainerLayer(LayerManager* aManager, void* aImplData)
: Layer(aManager, aImplData),
mFirstChild(nsnull),
mLastChild(nsnull),
mUseIntermediateSurface(PR_FALSE)
{}
@ -931,6 +934,7 @@ protected:
virtual nsACString& PrintInfo(nsACString& aTo, const char* aPrefix);
Layer* mFirstChild;
Layer* mLastChild;
FrameMetrics mFrameMetrics;
PRPackedBool mUseIntermediateSurface;
};

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

@ -226,6 +226,9 @@ ContainerInsertAfter(Layer* aChild, Layer* aAfter, Container* aContainer)
NS_ADDREF(aChild);
aChild->SetParent(aContainer);
if (aAfter == aContainer->mLastChild) {
aContainer->mLastChild = aChild;
}
if (!aAfter) {
aChild->SetNextSibling(aContainer->mFirstChild);
if (aContainer->mFirstChild) {
@ -262,6 +265,8 @@ ContainerRemoveChild(Layer* aChild, Container* aContainer)
}
if (next) {
next->SetPrevSibling(prev);
} else {
aContainer->mLastChild = prev;
}
aChild->SetNextSibling(nsnull);

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

@ -66,6 +66,8 @@ ContainerLayerD3D10::InsertAfter(Layer* aChild, Layer* aAfter)
aChild->SetPrevSibling(nsnull);
if (oldFirstChild) {
oldFirstChild->SetPrevSibling(aChild);
} else {
mLastChild = aChild;
}
NS_ADDREF(aChild);
return;
@ -78,6 +80,8 @@ ContainerLayerD3D10::InsertAfter(Layer* aChild, Layer* aAfter)
aChild->SetNextSibling(oldNextSibling);
if (oldNextSibling) {
oldNextSibling->SetPrevSibling(aChild);
} else {
mLastChild = aChild;
}
aChild->SetPrevSibling(child);
NS_ADDREF(aChild);
@ -94,6 +98,8 @@ ContainerLayerD3D10::RemoveChild(Layer *aChild)
mFirstChild = GetFirstChild()->GetNextSibling();
if (mFirstChild) {
mFirstChild->SetPrevSibling(nsnull);
} else {
mLastChild = nsnull;
}
aChild->SetNextSibling(nsnull);
aChild->SetPrevSibling(nsnull);
@ -109,6 +115,8 @@ ContainerLayerD3D10::RemoveChild(Layer *aChild)
lastChild->SetNextSibling(child->GetNextSibling());
if (child->GetNextSibling()) {
child->GetNextSibling()->SetPrevSibling(lastChild);
} else {
mLastChild = lastChild;
}
child->SetNextSibling(nsnull);
child->SetPrevSibling(nsnull);

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

@ -65,6 +65,8 @@ ContainerLayerD3D9::InsertAfter(Layer* aChild, Layer* aAfter)
aChild->SetPrevSibling(nsnull);
if (oldFirstChild) {
oldFirstChild->SetPrevSibling(aChild);
} else {
mLastChild = aChild;
}
NS_ADDREF(aChild);
return;
@ -77,6 +79,8 @@ ContainerLayerD3D9::InsertAfter(Layer* aChild, Layer* aAfter)
aChild->SetNextSibling(oldNextSibling);
if (oldNextSibling) {
oldNextSibling->SetPrevSibling(aChild);
} else {
mLastChild = aChild;
}
aChild->SetPrevSibling(child);
NS_ADDREF(aChild);
@ -93,6 +97,8 @@ ContainerLayerD3D9::RemoveChild(Layer *aChild)
mFirstChild = GetFirstChild()->GetNextSibling();
if (mFirstChild) {
mFirstChild->SetPrevSibling(nsnull);
} else {
mLastChild = nsnull;
}
aChild->SetNextSibling(nsnull);
aChild->SetPrevSibling(nsnull);
@ -108,6 +114,8 @@ ContainerLayerD3D9::RemoveChild(Layer *aChild)
lastChild->SetNextSibling(child->GetNextSibling());
if (child->GetNextSibling()) {
child->GetNextSibling()->SetPrevSibling(lastChild);
} else {
mLastChild = lastChild;
}
child->SetNextSibling(nsnull);
child->SetPrevSibling(nsnull);

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

@ -52,6 +52,8 @@ ContainerInsertAfter(Container* aContainer, Layer* aChild, Layer* aAfter)
aChild->SetPrevSibling(nsnull);
if (oldFirstChild) {
oldFirstChild->SetPrevSibling(aChild);
} else {
aContainer->mLastChild = aChild;
}
NS_ADDREF(aChild);
return;
@ -64,6 +66,8 @@ ContainerInsertAfter(Container* aContainer, Layer* aChild, Layer* aAfter)
aChild->SetNextSibling(oldNextSibling);
if (oldNextSibling) {
oldNextSibling->SetPrevSibling(aChild);
} else {
aContainer->mLastChild = aChild;
}
aChild->SetPrevSibling(child);
NS_ADDREF(aChild);
@ -81,6 +85,8 @@ ContainerRemoveChild(Container* aContainer, Layer* aChild)
aContainer->mFirstChild = aContainer->GetFirstChild()->GetNextSibling();
if (aContainer->mFirstChild) {
aContainer->mFirstChild->SetPrevSibling(nsnull);
} else {
aContainer->mLastChild = nsnull;
}
aChild->SetNextSibling(nsnull);
aChild->SetPrevSibling(nsnull);
@ -96,6 +102,8 @@ ContainerRemoveChild(Container* aContainer, Layer* aChild)
lastChild->SetNextSibling(child->GetNextSibling());
if (child->GetNextSibling()) {
child->GetNextSibling()->SetPrevSibling(lastChild);
} else {
aContainer->mLastChild = lastChild;
}
child->SetNextSibling(nsnull);
child->SetPrevSibling(nsnull);