mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 913443 - Extract layer hint calculation. r=roc
This commit is contained in:
parent
3e610f145e
commit
6cfa76525a
@ -698,6 +698,9 @@ public:
|
||||
protected:
|
||||
friend class PaintedLayerData;
|
||||
|
||||
LayerManager::PaintedLayerCreationHint
|
||||
GetLayerCreationHint(const nsIFrame* aAnimatedGeometryRoot);
|
||||
|
||||
/**
|
||||
* Grab the next recyclable PaintedLayer, or create one if there are no
|
||||
* more recyclable PaintedLayers. Does any necessary invalidation of
|
||||
@ -1681,6 +1684,22 @@ InvalidateEntirePaintedLayer(PaintedLayer* aLayer, const nsIFrame* aAnimatedGeom
|
||||
ResetScrollPositionForLayerPixelAlignment(aAnimatedGeometryRoot);
|
||||
}
|
||||
|
||||
LayerManager::PaintedLayerCreationHint
|
||||
ContainerState::GetLayerCreationHint(const nsIFrame* aAnimatedGeometryRoot)
|
||||
{
|
||||
// Check whether the layer will be scrollable. This is used as a hint to
|
||||
// influence whether tiled layers are used or not.
|
||||
if (mParameters.mInLowPrecisionDisplayPort) {
|
||||
return LayerManager::SCROLLABLE;
|
||||
}
|
||||
nsIFrame* animatedGeometryRootParent = aAnimatedGeometryRoot->GetParent();
|
||||
if (animatedGeometryRootParent &&
|
||||
animatedGeometryRootParent->GetType() == nsGkAtoms::scrollFrame) {
|
||||
return LayerManager::SCROLLABLE;
|
||||
}
|
||||
return LayerManager::NONE;
|
||||
}
|
||||
|
||||
already_AddRefed<PaintedLayer>
|
||||
ContainerState::CreateOrRecyclePaintedLayer(const nsIFrame* aAnimatedGeometryRoot,
|
||||
const nsIFrame* aReferenceFrame,
|
||||
@ -1694,15 +1713,8 @@ ContainerState::CreateOrRecyclePaintedLayer(const nsIFrame* aAnimatedGeometryRoo
|
||||
|
||||
// Check whether the layer will be scrollable. This is used as a hint to
|
||||
// influence whether tiled layers are used or not.
|
||||
LayerManager::PaintedLayerCreationHint creationHint = LayerManager::NONE;
|
||||
if (mParameters.mInLowPrecisionDisplayPort ) {
|
||||
creationHint = LayerManager::SCROLLABLE;
|
||||
}
|
||||
nsIFrame* animatedGeometryRootParent = aAnimatedGeometryRoot->GetParent();
|
||||
if (animatedGeometryRootParent &&
|
||||
animatedGeometryRootParent->GetType() == nsGkAtoms::scrollFrame) {
|
||||
creationHint = LayerManager::SCROLLABLE;
|
||||
}
|
||||
LayerManager::PaintedLayerCreationHint creationHint =
|
||||
GetLayerCreationHint(aAnimatedGeometryRoot);
|
||||
|
||||
if (mNextFreeRecycledPaintedLayer < mRecycledPaintedLayers.Length()) {
|
||||
// Try to recycle a layer
|
||||
|
Loading…
Reference in New Issue
Block a user