本文整理汇总了C++中FillLayer::type方法的典型用法代码示例。如果您正苦于以下问题:C++ FillLayer::type方法的具体用法?C++ FillLayer::type怎么用?C++ FillLayer::type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FillLayer
的用法示例。
在下文中一共展示了FillLayer::type方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mapFillMaskSourceType
void CSSToStyleMap::mapFillMaskSourceType(CSSPropertyID, FillLayer& layer, const CSSValue& value)
{
EMaskSourceType type = FillLayer::initialFillMaskSourceType(layer.type());
if (value.isInitialValue()) {
layer.setMaskSourceType(type);
return;
}
if (!is<CSSPrimitiveValue>(value))
return;
switch (downcast<CSSPrimitiveValue>(value).getValueID()) {
case CSSValueAlpha:
type = EMaskSourceType::MaskAlpha;
break;
case CSSValueLuminance:
type = EMaskSourceType::MaskLuminance;
break;
case CSSValueAuto:
break;
default:
ASSERT_NOT_REACHED();
}
layer.setMaskSourceType(type);
}
示例2: mapFillYPosition
void CSSToStyleMap::mapFillYPosition(CSSPropertyID propertyID, FillLayer& layer, const CSSValue& value)
{
if (value.isInitialValue()) {
layer.setYPosition(FillLayer::initialFillYPosition(layer.type()));
return;
}
if (!is<CSSPrimitiveValue>(value))
return;
auto* primitiveValue = &downcast<CSSPrimitiveValue>(value);
Pair* pair = primitiveValue->getPairValue();
if (pair) {
ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPositionY || propertyID == CSSPropertyWebkitMaskPositionY);
primitiveValue = pair->second();
}
Length length;
if (primitiveValue->isLength())
length = primitiveValue->computeLength<Length>(m_resolver->state().cssToLengthConversionData());
else if (primitiveValue->isPercentage())
length = Length(primitiveValue->getDoubleValue(), Percent);
else if (primitiveValue->isCalculatedPercentageWithLength())
length = Length(primitiveValue->cssCalcValue()->createCalculationValue(m_resolver->state().cssToLengthConversionData()));
else
return;
layer.setYPosition(length);
if (pair)
layer.setBackgroundYOrigin(*pair->first());
}
示例3: mapFillSize
void CSSToStyleMap::mapFillSize(CSSPropertyID, FillLayer& layer, const CSSValue& value)
{
if (value.isInitialValue()) {
layer.setSize(FillLayer::initialFillSize(layer.type()));
return;
}
if (!is<CSSPrimitiveValue>(value))
return;
auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
FillSize fillSize;
switch (primitiveValue.getValueID()) {
case CSSValueContain:
fillSize.type = Contain;
break;
case CSSValueCover:
fillSize.type = Cover;
break;
default:
ASSERT(fillSize.type == SizeLength);
if (!convertToLengthSize(primitiveValue, m_resolver->state().cssToLengthConversionData(), fillSize.size))
return;
break;
}
layer.setSize(fillSize);
}
示例4: mapFillImage
void CSSToStyleMap::mapFillImage(CSSPropertyID property, FillLayer& layer, CSSValue& value)
{
if (value.isInitialValue()) {
layer.setImage(FillLayer::initialFillImage(layer.type()));
return;
}
layer.setImage(styleImage(property, value));
}
示例5: mapFillClip
void CSSToStyleMap::mapFillClip(CSSPropertyID, FillLayer& layer, const CSSValue& value)
{
if (value.isInitialValue()) {
layer.setClip(FillLayer::initialFillClip(layer.type()));
return;
}
if (!is<CSSPrimitiveValue>(value))
return;
layer.setClip(downcast<CSSPrimitiveValue>(value));
}
示例6: mapFillRepeatY
void CSSToStyleMap::mapFillRepeatY(CSSPropertyID propertyID, FillLayer& layer, const CSSValue& value)
{
if (value.treatAsInitialValue(propertyID)) {
layer.setRepeatY(FillLayer::initialFillRepeatY(layer.type()));
return;
}
if (!is<CSSPrimitiveValue>(value))
return;
layer.setRepeatY(downcast<CSSPrimitiveValue>(value));
}
示例7: mapFillAttachment
void CSSToStyleMap::mapFillAttachment(CSSPropertyID, FillLayer& layer, const CSSValue& value)
{
if (value.isInitialValue()) {
layer.setAttachment(FillLayer::initialFillAttachment(layer.type()));
return;
}
if (!is<CSSPrimitiveValue>(value))
return;
switch (downcast<CSSPrimitiveValue>(value).getValueID()) {
case CSSValueFixed:
layer.setAttachment(FixedBackgroundAttachment);
break;
case CSSValueScroll:
layer.setAttachment(ScrollBackgroundAttachment);
break;
case CSSValueLocal:
layer.setAttachment(LocalBackgroundAttachment);
break;
default:
return;
}
}