зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1418224 Part 2 - Extract ShapeInfo::CreateBasicShape(). r=heycam
MozReview-Commit-ID: DZ1O0CzzsyT --HG-- extra : rebase_source : d5f03aeea3b10810b07fb001b9ff4dbfc7e03c64
This commit is contained in:
Родитель
dd54cdcea0
Коммит
56d6b694a2
|
@ -776,24 +776,8 @@ nsFloatManager::FloatInfo::FloatInfo(nsIFrame* aFrame,
|
|||
aContainerSize);
|
||||
} else if (shapeOutside.GetType() == StyleShapeSourceType::Shape) {
|
||||
const UniquePtr<StyleBasicShape>& basicShape = shapeOutside.GetBasicShape();
|
||||
|
||||
switch (basicShape->GetShapeType()) {
|
||||
case StyleBasicShapeType::Polygon:
|
||||
mShapeInfo =
|
||||
ShapeInfo::CreatePolygon(basicShape, shapeBoxRect, aWM,
|
||||
aContainerSize);
|
||||
break;
|
||||
case StyleBasicShapeType::Circle:
|
||||
case StyleBasicShapeType::Ellipse:
|
||||
mShapeInfo =
|
||||
ShapeInfo::CreateCircleOrEllipse(basicShape, shapeBoxRect, aWM,
|
||||
aContainerSize);
|
||||
break;
|
||||
case StyleBasicShapeType::Inset:
|
||||
mShapeInfo =
|
||||
ShapeInfo::CreateInset(basicShape, shapeBoxRect, aWM, aContainerSize);
|
||||
break;
|
||||
}
|
||||
mShapeInfo = ShapeInfo::CreateBasicShape(basicShape, shapeBoxRect, aWM,
|
||||
aContainerSize);
|
||||
} else {
|
||||
MOZ_ASSERT_UNREACHABLE("Unknown StyleShapeSourceType!");
|
||||
}
|
||||
|
@ -960,6 +944,26 @@ nsFloatManager::ShapeInfo::CreateShapeBox(
|
|||
aWM));
|
||||
}
|
||||
|
||||
/* static */ UniquePtr<nsFloatManager::ShapeInfo>
|
||||
nsFloatManager::ShapeInfo::CreateBasicShape(
|
||||
const UniquePtr<StyleBasicShape>& aBasicShape,
|
||||
const LogicalRect& aShapeBoxRect,
|
||||
WritingMode aWM,
|
||||
const nsSize& aContainerSize)
|
||||
{
|
||||
switch (aBasicShape->GetShapeType()) {
|
||||
case StyleBasicShapeType::Polygon:
|
||||
return CreatePolygon(aBasicShape, aShapeBoxRect, aWM, aContainerSize);
|
||||
case StyleBasicShapeType::Circle:
|
||||
case StyleBasicShapeType::Ellipse:
|
||||
return CreateCircleOrEllipse(aBasicShape, aShapeBoxRect, aWM,
|
||||
aContainerSize);
|
||||
case StyleBasicShapeType::Inset:
|
||||
return CreateInset(aBasicShape, aShapeBoxRect, aWM, aContainerSize);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* static */ UniquePtr<nsFloatManager::ShapeInfo>
|
||||
nsFloatManager::ShapeInfo::CreateInset(
|
||||
const UniquePtr<StyleBasicShape>& aBasicShape,
|
||||
|
|
|
@ -381,6 +381,12 @@ private:
|
|||
mozilla::WritingMode aWM,
|
||||
const nsSize& aContainerSize);
|
||||
|
||||
static mozilla::UniquePtr<ShapeInfo> CreateBasicShape(
|
||||
const mozilla::UniquePtr<mozilla::StyleBasicShape>& aBasicShape,
|
||||
const mozilla::LogicalRect& aShapeBoxRect,
|
||||
mozilla::WritingMode aWM,
|
||||
const nsSize& aContainerSize);
|
||||
|
||||
static mozilla::UniquePtr<ShapeInfo> CreateInset(
|
||||
const mozilla::UniquePtr<mozilla::StyleBasicShape>& aBasicShape,
|
||||
const mozilla::LogicalRect& aShapeBoxRect,
|
||||
|
|
Загрузка…
Ссылка в новой задаче