mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 539356 - Part 14 - Handle multiple widget layer managers retaining data for the same frame. r=roc
This commit is contained in:
parent
4dffec4e63
commit
b7ecd3eb49
@ -45,11 +45,11 @@ public:
|
|||||||
mFramesWithLayers.Init();
|
mFramesWithLayers.Init();
|
||||||
}
|
}
|
||||||
~LayerManagerData() {
|
~LayerManagerData() {
|
||||||
|
MOZ_COUNT_DTOR(LayerManagerData);
|
||||||
// Remove display item data properties now, since we won't be able
|
// Remove display item data properties now, since we won't be able
|
||||||
// to find these frames again without mFramesWithLayers.
|
// to find these frames again without mFramesWithLayers.
|
||||||
mFramesWithLayers.EnumerateEntries(
|
mFramesWithLayers.EnumerateEntries(
|
||||||
FrameLayerBuilder::RemoveDisplayItemDataForFrame, this);
|
FrameLayerBuilder::RemoveDisplayItemDataForFrame, this);
|
||||||
MOZ_COUNT_DTOR(LayerManagerData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -59,6 +59,14 @@ public:
|
|||||||
bool mInvalidateAllLayers;
|
bool mInvalidateAllLayers;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* static */ void
|
||||||
|
FrameLayerBuilder::DestroyDisplayItemDataFor(nsIFrame* aFrame)
|
||||||
|
{
|
||||||
|
FrameProperties props = aFrame->Properties();
|
||||||
|
props.Delete(LayerManagerDataProperty());
|
||||||
|
props.Delete(LayerManagerSecondaryDataProperty());
|
||||||
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
// a global cache of image containers used for mask layers
|
// a global cache of image containers used for mask layers
|
||||||
@ -519,6 +527,61 @@ ThebesDisplayItemLayerUserData* GetThebesDisplayItemLayerUserData(Layer* aLayer)
|
|||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
|
|
||||||
PRUint8 gLayerManagerLayerBuilder;
|
PRUint8 gLayerManagerLayerBuilder;
|
||||||
|
PRUint8 gLayerManagerSecondary;
|
||||||
|
|
||||||
|
bool FrameLayerBuilder::sWidgetManagerSecondary = nsnull;
|
||||||
|
|
||||||
|
/* static */ const FramePropertyDescriptor*
|
||||||
|
FrameLayerBuilder::GetDescriptorForManager(LayerManager* aManager)
|
||||||
|
{
|
||||||
|
bool secondary = sWidgetManagerSecondary;
|
||||||
|
if (aManager) {
|
||||||
|
secondary = !!static_cast<LayerManagerSecondary*>(aManager->GetUserData(&gLayerManagerSecondary));
|
||||||
|
}
|
||||||
|
|
||||||
|
return secondary ? LayerManagerSecondaryDataProperty() : LayerManagerDataProperty();
|
||||||
|
}
|
||||||
|
|
||||||
|
LayerManagerData*
|
||||||
|
FrameLayerBuilder::GetManagerData(nsIFrame* aFrame, LayerManager* aManager)
|
||||||
|
{
|
||||||
|
FrameProperties props = aFrame->Properties();
|
||||||
|
return static_cast<LayerManagerData*>(props.Get(GetDescriptorForManager(aManager)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
FrameLayerBuilder::SetManagerData(nsIFrame* aFrame, LayerManagerData* aData)
|
||||||
|
{
|
||||||
|
FrameProperties props = aFrame->Properties();
|
||||||
|
const FramePropertyDescriptor* desc = GetDescriptorForManager(nsnull);
|
||||||
|
|
||||||
|
props.Remove(desc);
|
||||||
|
if (aData) {
|
||||||
|
props.Set(desc, aData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
FrameLayerBuilder::ClearManagerData(nsIFrame* aFrame)
|
||||||
|
{
|
||||||
|
SetManagerData(aFrame, nsnull);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
FrameLayerBuilder::ClearManagerData(nsIFrame* aFrame, LayerManagerData* aData)
|
||||||
|
{
|
||||||
|
NS_ABORT_IF_FALSE(aData, "Must have a widget manager to check for manager data!");
|
||||||
|
|
||||||
|
FrameProperties props = aFrame->Properties();
|
||||||
|
if (aData == static_cast<LayerManagerData*>(props.Get(LayerManagerDataProperty()))) {
|
||||||
|
props.Remove(LayerManagerDataProperty());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (aData == static_cast<LayerManagerData*>(props.Get(LayerManagerSecondaryDataProperty()))) {
|
||||||
|
props.Remove(LayerManagerSecondaryDataProperty());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* static */ void
|
/* static */ void
|
||||||
FrameLayerBuilder::Shutdown()
|
FrameLayerBuilder::Shutdown()
|
||||||
@ -685,6 +748,9 @@ FrameLayerBuilder::DidBeginRetainedLayerTransaction(LayerManager* aManager)
|
|||||||
(aManager->GetUserData(&gLayerManagerUserData));
|
(aManager->GetUserData(&gLayerManagerUserData));
|
||||||
if (data) {
|
if (data) {
|
||||||
mInvalidateAllLayers = data->mInvalidateAllLayers;
|
mInvalidateAllLayers = data->mInvalidateAllLayers;
|
||||||
|
} else {
|
||||||
|
data = new LayerManagerData();
|
||||||
|
aManager->SetUserData(&gLayerManagerUserData, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -723,13 +789,10 @@ FrameLayerBuilder::WillEndTransaction()
|
|||||||
// We need to save the data we'll need to support retaining.
|
// We need to save the data we'll need to support retaining.
|
||||||
LayerManagerData* data = static_cast<LayerManagerData*>
|
LayerManagerData* data = static_cast<LayerManagerData*>
|
||||||
(mRetainingManager->GetUserData(&gLayerManagerUserData));
|
(mRetainingManager->GetUserData(&gLayerManagerUserData));
|
||||||
if (data) {
|
NS_ASSERTION(data, "Must have data!");
|
||||||
// Update all the frames that used to have layers.
|
// Update all the frames that used to have layers.
|
||||||
data->mFramesWithLayers.EnumerateEntries(UpdateDisplayItemDataForFrame, this);
|
data->mFramesWithLayers.EnumerateEntries(UpdateDisplayItemDataForFrame, this);
|
||||||
} else {
|
|
||||||
data = new LayerManagerData();
|
|
||||||
mRetainingManager->SetUserData(&gLayerManagerUserData, data);
|
|
||||||
}
|
|
||||||
// Now go through all the frames that didn't have any retained
|
// Now go through all the frames that didn't have any retained
|
||||||
// display items before, and record those retained display items.
|
// display items before, and record those retained display items.
|
||||||
// This also empties mNewDisplayItemData.
|
// This also empties mNewDisplayItemData.
|
||||||
@ -767,27 +830,23 @@ FrameLayerBuilder::UpdateDisplayItemDataForFrame(DisplayItemDataEntry* aEntry,
|
|||||||
{
|
{
|
||||||
FrameLayerBuilder* builder = static_cast<FrameLayerBuilder*>(aUserArg);
|
FrameLayerBuilder* builder = static_cast<FrameLayerBuilder*>(aUserArg);
|
||||||
nsIFrame* f = aEntry->GetKey();
|
nsIFrame* f = aEntry->GetKey();
|
||||||
FrameProperties props = f->Properties();
|
|
||||||
DisplayItemDataEntry* newDisplayItems =
|
DisplayItemDataEntry* newDisplayItems =
|
||||||
builder ? builder->mNewDisplayItemData.GetEntry(f) : nsnull;
|
builder ? builder->mNewDisplayItemData.GetEntry(f) : nsnull;
|
||||||
LayerManagerData* managerData = static_cast<LayerManagerData*>
|
LayerManagerData* managerData = static_cast<LayerManagerData*>
|
||||||
(builder->GetRetainingLayerManager()->GetUserData(&gLayerManagerUserData));
|
(builder->GetRetainingLayerManager()->GetUserData(&gLayerManagerUserData));
|
||||||
LayerManagerData* data = static_cast<LayerManagerData*>(props.Get(LayerManagerDataProperty()));
|
LayerManagerData* data = GetManagerData(f);
|
||||||
if (!newDisplayItems || newDisplayItems->mData.IsEmpty()) {
|
if (!newDisplayItems || newDisplayItems->mData.IsEmpty()) {
|
||||||
// This frame was visible, but isn't anymore.
|
// This frame was visible, but isn't anymore.
|
||||||
if (newDisplayItems) {
|
if (newDisplayItems) {
|
||||||
builder->mNewDisplayItemData.RawRemoveEntry(newDisplayItems);
|
builder->mNewDisplayItemData.RawRemoveEntry(newDisplayItems);
|
||||||
}
|
}
|
||||||
if (data == managerData) {
|
if (data == managerData) {
|
||||||
props.Remove(LayerManagerDataProperty());
|
ClearManagerData(f);
|
||||||
}
|
}
|
||||||
return PL_DHASH_REMOVE;
|
return PL_DHASH_REMOVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data) {
|
SetManagerData(f, managerData);
|
||||||
props.Remove(LayerManagerDataProperty());
|
|
||||||
}
|
|
||||||
props.Set(LayerManagerDataProperty(), managerData);
|
|
||||||
|
|
||||||
// Steal the list of display item layers
|
// Steal the list of display item layers
|
||||||
aEntry->mData.SwapElements(newDisplayItems->mData);
|
aEntry->mData.SwapElements(newDisplayItems->mData);
|
||||||
@ -805,12 +864,7 @@ FrameLayerBuilder::RemoveDisplayItemDataForFrame(DisplayItemDataEntry* aEntry,
|
|||||||
// If this was called from a frame destructor then the prop is definitely already gone,
|
// If this was called from a frame destructor then the prop is definitely already gone,
|
||||||
// and we could crash trying to check. See the definition of sDestroyedFrame.
|
// and we could crash trying to check. See the definition of sDestroyedFrame.
|
||||||
if (f != sDestroyedFrame) {
|
if (f != sDestroyedFrame) {
|
||||||
FrameProperties props = f->Properties();
|
ClearManagerData(f, managerData);
|
||||||
bool found;
|
|
||||||
LayerManagerData* data = static_cast<LayerManagerData*>(props.Get(LayerManagerDataProperty()));
|
|
||||||
if (data == managerData) {
|
|
||||||
props.Remove(LayerManagerDataProperty(), &found);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return PL_DHASH_REMOVE;
|
return PL_DHASH_REMOVE;
|
||||||
}
|
}
|
||||||
@ -821,7 +875,6 @@ FrameLayerBuilder::StoreNewDisplayItemData(DisplayItemDataEntry* aEntry,
|
|||||||
{
|
{
|
||||||
LayerManagerData* data = static_cast<LayerManagerData*>(aUserArg);
|
LayerManagerData* data = static_cast<LayerManagerData*>(aUserArg);
|
||||||
nsIFrame* f = aEntry->GetKey();
|
nsIFrame* f = aEntry->GetKey();
|
||||||
FrameProperties props = f->Properties();
|
|
||||||
// Remember that this frame has display items in retained layers
|
// Remember that this frame has display items in retained layers
|
||||||
NS_ASSERTION(!data->mFramesWithLayers.GetEntry(f),
|
NS_ASSERTION(!data->mFramesWithLayers.GetEntry(f),
|
||||||
"We shouldn't get here if we're already in mFramesWithLayers");
|
"We shouldn't get here if we're already in mFramesWithLayers");
|
||||||
@ -833,21 +886,36 @@ FrameLayerBuilder::StoreNewDisplayItemData(DisplayItemDataEntry* aEntry,
|
|||||||
// When a frame has multiple layer managers (main, inactive, svg), we
|
// When a frame has multiple layer managers (main, inactive, svg), we
|
||||||
// only need to store the outermost one since that will be enough to
|
// only need to store the outermost one since that will be enough to
|
||||||
// invalidate the entire region covered by all the children.
|
// invalidate the entire region covered by all the children.
|
||||||
props.Remove(LayerManagerDataProperty());
|
SetManagerData(f, data);
|
||||||
props.Set(LayerManagerDataProperty(), data);
|
|
||||||
return PL_DHASH_REMOVE;
|
return PL_DHASH_REMOVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attempts to find the LayerManagerData for the widget manager
|
||||||
|
* for the given frame, nsnull otherwise.
|
||||||
|
*/
|
||||||
|
static LayerManagerData*
|
||||||
|
GetDefaultLayerManagerDataForFrame(nsIFrame* aFrame)
|
||||||
|
{
|
||||||
|
FrameProperties props = aFrame->Properties();
|
||||||
|
return static_cast<LayerManagerData*>(props.Get(FrameLayerBuilder::LayerManagerDataProperty()));
|
||||||
|
}
|
||||||
|
|
||||||
/* static */ FrameLayerBuilder::DisplayItemData*
|
/* static */ FrameLayerBuilder::DisplayItemData*
|
||||||
FrameLayerBuilder::GetDisplayItemDataForManager(nsIFrame* aFrame, PRUint32 aDisplayItemKey, LayerManager* aManager)
|
FrameLayerBuilder::GetDisplayItemDataForManager(nsIFrame* aFrame, PRUint32 aDisplayItemKey, LayerManager* aManager)
|
||||||
{
|
{
|
||||||
LayerManagerData* managerData = static_cast<LayerManagerData*>
|
LayerManagerData *data;
|
||||||
(aManager->GetUserData(&gLayerManagerUserData));
|
if (!aManager) {
|
||||||
if (!managerData) {
|
data = GetDefaultLayerManagerDataForFrame(aFrame);
|
||||||
|
} else {
|
||||||
|
data = static_cast<LayerManagerData*>(aManager->GetUserData(&gLayerManagerUserData));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
return nsnull;
|
return nsnull;
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayItemDataEntry *entry = managerData->mFramesWithLayers.GetEntry(aFrame);
|
DisplayItemDataEntry *entry = data->mFramesWithLayers.GetEntry(aFrame);
|
||||||
if (!entry) {
|
if (!entry) {
|
||||||
return nsnull;
|
return nsnull;
|
||||||
}
|
}
|
||||||
@ -910,8 +978,7 @@ FrameLayerBuilder::GetOldLayerFor(nsIFrame* aFrame, PRUint32 aDisplayItemKey, ns
|
|||||||
/* static */ Layer*
|
/* static */ Layer*
|
||||||
FrameLayerBuilder::GetDebugOldLayerFor(nsIFrame* aFrame, PRUint32 aDisplayItemKey)
|
FrameLayerBuilder::GetDebugOldLayerFor(nsIFrame* aFrame, PRUint32 aDisplayItemKey)
|
||||||
{
|
{
|
||||||
FrameProperties props = aFrame->Properties();
|
LayerManagerData* data = GetManagerData(aFrame);
|
||||||
LayerManagerData* data = static_cast<LayerManagerData*>(props.Get(LayerManagerDataProperty()));
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
return nsnull;
|
return nsnull;
|
||||||
}
|
}
|
||||||
@ -2553,24 +2620,20 @@ FrameLayerBuilder::InvalidateAllLayers(LayerManager* aManager)
|
|||||||
Layer*
|
Layer*
|
||||||
FrameLayerBuilder::GetDedicatedLayer(nsIFrame* aFrame, PRUint32 aDisplayItemKey)
|
FrameLayerBuilder::GetDedicatedLayer(nsIFrame* aFrame, PRUint32 aDisplayItemKey)
|
||||||
{
|
{
|
||||||
FrameProperties props = aFrame->Properties();
|
//TODO: This isn't completely correct, since a frame could exist as a layer
|
||||||
LayerManagerData* data = static_cast<LayerManagerData*>(props.Get(LayerManagerDataProperty()));
|
// in the normal widget manager, and as a different layer (or no layer)
|
||||||
|
// in the secondary manager
|
||||||
|
|
||||||
|
DisplayItemData *data = GetDisplayItemDataForManager(aFrame, aDisplayItemKey, nsnull);
|
||||||
if (!data) {
|
if (!data) {
|
||||||
return nsnull;
|
return nsnull;
|
||||||
}
|
}
|
||||||
DisplayItemDataEntry *entry = data->mFramesWithLayers.GetEntry(aFrame);
|
|
||||||
if (!entry) {
|
Layer* layer = data->mLayer;
|
||||||
return nsnull;
|
if (!layer->HasUserData(&gColorLayerUserData) &&
|
||||||
}
|
!layer->HasUserData(&gImageLayerUserData) &&
|
||||||
|
!layer->HasUserData(&gThebesDisplayItemLayerUserData)) {
|
||||||
for (PRUint32 i = 0; i < entry->mData.Length(); ++i) {
|
return layer;
|
||||||
if (entry->mData.ElementAt(i).mDisplayItemKey == aDisplayItemKey) {
|
|
||||||
Layer* layer = entry->mData.ElementAt(i).mLayer;
|
|
||||||
if (!layer->HasUserData(&gColorLayerUserData) &&
|
|
||||||
!layer->HasUserData(&gImageLayerUserData) &&
|
|
||||||
!layer->HasUserData(&gThebesDisplayItemLayerUserData))
|
|
||||||
return layer;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return nsnull;
|
return nsnull;
|
||||||
}
|
}
|
||||||
@ -2580,23 +2643,12 @@ FrameLayerBuilder::GetThebesLayerResolutionForFrame(nsIFrame* aFrame,
|
|||||||
double* aXres, double* aYres,
|
double* aXres, double* aYres,
|
||||||
gfxPoint* aPoint)
|
gfxPoint* aPoint)
|
||||||
{
|
{
|
||||||
nsRefPtr<LayerManager> layerManager;
|
LayerManagerData *data = GetDefaultLayerManagerDataForFrame(aFrame);
|
||||||
nsIFrame* referenceFrame = nsLayoutUtils::GetDisplayRootFrame(aFrame);
|
if (!data) {
|
||||||
nsIWidget* window = referenceFrame->GetNearestWidget();
|
|
||||||
if (window) {
|
|
||||||
layerManager = window->GetLayerManager();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!layerManager) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
LayerManagerData* managerData = static_cast<LayerManagerData*>
|
|
||||||
(layerManager->GetUserData(&gLayerManagerUserData));
|
|
||||||
if (!managerData) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayItemDataEntry *entry = managerData->mFramesWithLayers.GetEntry(aFrame);
|
DisplayItemDataEntry *entry = data->mFramesWithLayers.GetEntry(aFrame);
|
||||||
if (!entry)
|
if (!entry)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -40,6 +40,10 @@ enum LayerState {
|
|||||||
};
|
};
|
||||||
|
|
||||||
extern PRUint8 gLayerManagerLayerBuilder;
|
extern PRUint8 gLayerManagerLayerBuilder;
|
||||||
|
extern PRUint8 gLayerManagerSecondary;
|
||||||
|
|
||||||
|
class LayerManagerSecondary : public layers::LayerUserData {
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The FrameLayerBuilder belongs to an nsDisplayListBuilder and is
|
* The FrameLayerBuilder belongs to an nsDisplayListBuilder and is
|
||||||
@ -263,6 +267,47 @@ public:
|
|||||||
nsIFrame* aContainerLayerFrame,
|
nsIFrame* aContainerLayerFrame,
|
||||||
LayerState aLayerState);
|
LayerState aLayerState);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the current top-level LayerManager for the widget being
|
||||||
|
* painted.
|
||||||
|
*/
|
||||||
|
static void SetWidgetLayerManager(LayerManager* aManager)
|
||||||
|
{
|
||||||
|
LayerManagerSecondary* secondary =
|
||||||
|
static_cast<LayerManagerSecondary*>(aManager->GetUserData(&gLayerManagerSecondary));
|
||||||
|
sWidgetManagerSecondary = !!secondary;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the frame property descriptor for the given manager, or for the current
|
||||||
|
* widget layer manager if nsnull is passed.
|
||||||
|
*/
|
||||||
|
static const FramePropertyDescriptor* GetDescriptorForManager(LayerManager* aManager);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the LayerManagerData for a given frame and layer manager. If no layer manager
|
||||||
|
* is passed, then the current widget layer manager is used.
|
||||||
|
*/
|
||||||
|
static LayerManagerData* GetManagerData(nsIFrame* aFrame, LayerManager* aManager = nsnull);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the LayerManagerData for a given frame and current widget layer manager.
|
||||||
|
* This replaces any existing data for the same frame/layer manager pair.
|
||||||
|
*/
|
||||||
|
static void SetManagerData(nsIFrame* aFrame, LayerManagerData* aData);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears the current LayerManagerData for the given frame and current widget
|
||||||
|
* layer manager.
|
||||||
|
*/
|
||||||
|
static void ClearManagerData(nsIFrame* aFrame);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears any references to the given LayerManagerData for the given frame
|
||||||
|
* and belonging to any layer manager.
|
||||||
|
*/
|
||||||
|
static void ClearManagerData(nsIFrame* aFrame, LayerManagerData* aData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given a frame and a display item key that uniquely identifies a
|
* Given a frame and a display item key that uniquely identifies a
|
||||||
* display item for the frame, find the layer that was last used to
|
* display item for the frame, find the layer that was last used to
|
||||||
@ -293,10 +338,7 @@ public:
|
|||||||
* Destroy any stored LayerManagerDataProperty and the associated data for
|
* Destroy any stored LayerManagerDataProperty and the associated data for
|
||||||
* aFrame.
|
* aFrame.
|
||||||
*/
|
*/
|
||||||
static void DestroyDisplayItemDataFor(nsIFrame* aFrame)
|
static void DestroyDisplayItemDataFor(nsIFrame* aFrame);
|
||||||
{
|
|
||||||
aFrame->Properties().Delete(LayerManagerDataProperty());
|
|
||||||
}
|
|
||||||
|
|
||||||
LayerManager* GetRetainingLayerManager() { return mRetainingManager; }
|
LayerManager* GetRetainingLayerManager() { return mRetainingManager; }
|
||||||
|
|
||||||
@ -425,6 +467,12 @@ public:
|
|||||||
return !(*this == aOther);
|
return !(*this == aOther);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
NS_DECLARE_FRAME_PROPERTY_WITH_FRAME_IN_DTOR(LayerManagerDataProperty,
|
||||||
|
RemoveFrameFromLayerManager)
|
||||||
|
|
||||||
|
NS_DECLARE_FRAME_PROPERTY_WITH_FRAME_IN_DTOR(LayerManagerSecondaryDataProperty,
|
||||||
|
RemoveFrameFromLayerManager)
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
@ -472,12 +520,12 @@ protected:
|
|||||||
*/
|
*/
|
||||||
bool mUsed;
|
bool mUsed;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// LayerManagerData needs to see DisplayItemDataEntry.
|
||||||
|
friend class LayerManagerData;
|
||||||
|
|
||||||
static void RemoveFrameFromLayerManager(nsIFrame* aFrame, void* aPropertyValue);
|
static void RemoveFrameFromLayerManager(nsIFrame* aFrame, void* aPropertyValue);
|
||||||
|
|
||||||
NS_DECLARE_FRAME_PROPERTY_WITH_FRAME_IN_DTOR(LayerManagerDataProperty,
|
|
||||||
RemoveFrameFromLayerManager)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We accumulate DisplayItemData elements in a hashtable during
|
* We accumulate DisplayItemData elements in a hashtable during
|
||||||
* the paint process, and store them in the frame property only when
|
* the paint process, and store them in the frame property only when
|
||||||
@ -505,9 +553,6 @@ protected:
|
|||||||
enum { ALLOW_MEMMOVE = false };
|
enum { ALLOW_MEMMOVE = false };
|
||||||
};
|
};
|
||||||
|
|
||||||
// LayerManagerData needs to see DisplayItemDataEntry.
|
|
||||||
friend class LayerManagerData;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores DisplayItemData associated with aFrame, stores the data in
|
* Stores DisplayItemData associated with aFrame, stores the data in
|
||||||
* mNewDisplayItemData.
|
* mNewDisplayItemData.
|
||||||
@ -681,6 +726,12 @@ protected:
|
|||||||
|
|
||||||
PRUint32 mContainerLayerGeneration;
|
PRUint32 mContainerLayerGeneration;
|
||||||
PRUint32 mMaxContainerLayerGeneration;
|
PRUint32 mMaxContainerLayerGeneration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* True if the current top-level LayerManager for the widget being
|
||||||
|
* painted is marked as being a 'secondary' LayerManager.
|
||||||
|
*/
|
||||||
|
static bool sWidgetManagerSecondary;
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline FrameLayerBuilder *GetLayerBuilderForManager(layers::LayerManager* aManager)
|
static inline FrameLayerBuilder *GetLayerBuilderForManager(layers::LayerManager* aManager)
|
||||||
|
@ -564,6 +564,7 @@ void nsDisplayList::PaintForFrame(nsDisplayListBuilder* aBuilder,
|
|||||||
"Must call ComputeVisibility before calling Paint");
|
"Must call ComputeVisibility before calling Paint");
|
||||||
|
|
||||||
nsRefPtr<LayerManager> layerManager;
|
nsRefPtr<LayerManager> layerManager;
|
||||||
|
bool widgetTransaction = false;
|
||||||
bool allowRetaining = false;
|
bool allowRetaining = false;
|
||||||
bool doBeginTransaction = true;
|
bool doBeginTransaction = true;
|
||||||
nsIView *view = nsnull;
|
nsIView *view = nsnull;
|
||||||
@ -577,6 +578,8 @@ void nsDisplayList::PaintForFrame(nsDisplayListBuilder* aBuilder,
|
|||||||
layerManager = window->GetLayerManager(&allowRetaining);
|
layerManager = window->GetLayerManager(&allowRetaining);
|
||||||
if (layerManager) {
|
if (layerManager) {
|
||||||
doBeginTransaction = !(aFlags & PAINT_EXISTING_TRANSACTION);
|
doBeginTransaction = !(aFlags & PAINT_EXISTING_TRANSACTION);
|
||||||
|
FrameLayerBuilder::SetWidgetLayerManager(layerManager);
|
||||||
|
widgetTransaction = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user