本文整理汇总了C++中InterpolationEnvironment类的典型用法代码示例。如果您正苦于以下问题:C++ InterpolationEnvironment类的具体用法?C++ InterpolationEnvironment怎么用?C++ InterpolationEnvironment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了InterpolationEnvironment类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: maybeConvertLength
PassOwnPtr<InterpolationValue> CSSLengthInterpolationType::maybeConvertUnderlyingValue(const InterpolationEnvironment& environment) const
{
Length underlyingLength;
if (!LengthPropertyFunctions::getLength(cssProperty(), *environment.state().style(), underlyingLength))
return nullptr;
return maybeConvertLength(underlyingLength, effectiveZoom(*environment.state().style()));
}
示例2: maybeConvertUnderlyingValue
InterpolationValue CSSLengthListInterpolationType::maybeConvertUnderlyingValue(const InterpolationEnvironment& environment) const
{
Vector<Length> underlyingLengthList;
if (!LengthListPropertyFunctions::getLengthList(cssProperty(), *environment.state().style(), underlyingLengthList))
return nullptr;
return maybeConvertLengthList(underlyingLengthList, environment.state().style()->effectiveZoom());
}
示例3: apply
void CSSBorderImageLengthBoxInterpolationType::apply(
const InterpolableValue& interpolableValue,
const NonInterpolableValue* nonInterpolableValue,
InterpolationEnvironment& environment) const {
const SideNumbers& sideNumbers =
toCSSBorderImageLengthBoxNonInterpolableValue(nonInterpolableValue)
->sideNumbers();
const Vector<RefPtr<NonInterpolableValue>>& nonInterpolableValues =
toCSSBorderImageLengthBoxNonInterpolableValue(nonInterpolableValue)
->sideNonInterpolableValues();
const InterpolableList& list = toInterpolableList(interpolableValue);
const auto& convertSide =
[&sideNumbers, &list, &environment,
&nonInterpolableValues](size_t index) -> BorderImageLength {
if (sideNumbers.isNumber[index])
return clampTo<double>(toInterpolableNumber(list.get(index))->value(), 0);
return LengthInterpolationFunctions::createLength(
*list.get(index), nonInterpolableValues[index].get(),
environment.state().cssToLengthConversionData(), ValueRangeNonNegative);
};
BorderImageLengthBox box(convertSide(SideTop), convertSide(SideRight),
convertSide(SideBottom), convertSide(SideLeft));
BorderImageLengthBoxPropertyFunctions::setBorderImageLengthBox(
cssProperty(), *environment.state().style(), box);
}
示例4: apply
void CSSColorInterpolationType::apply(const InterpolableValue& interpolableValue, const NonInterpolableValue*, InterpolationEnvironment& environment) const
{
const InterpolableList& colorPair = toInterpolableList(interpolableValue);
ASSERT(colorPair.length() == InterpolableColorPairIndexCount);
ColorPropertyFunctions::setUnvisitedColor(cssProperty(), *environment.state().style(),
resolveInterpolableColor(*colorPair.get(Unvisited), environment.state(), false, cssProperty() == CSSPropertyTextDecorationColor));
ColorPropertyFunctions::setVisitedColor(cssProperty(), *environment.state().style(),
resolveInterpolableColor(*colorPair.get(Visited), environment.state(), true, cssProperty() == CSSPropertyTextDecorationColor));
}
示例5: apply
void CSSPaintInterpolationType::apply(
const InterpolableValue& interpolableColor,
const NonInterpolableValue*,
InterpolationEnvironment& environment) const {
PaintPropertyFunctions::setColor(
cssProperty(), *environment.state().style(),
CSSColorInterpolationType::resolveInterpolableColor(interpolableColor,
environment.state()));
}
示例6: apply
void CSSImageInterpolationType::apply(
const InterpolableValue& interpolableValue,
const NonInterpolableValue* nonInterpolableValue,
InterpolationEnvironment& environment) const {
ImagePropertyFunctions::setStyleImage(
cssProperty(), *environment.state().style(),
resolveStyleImage(cssProperty(), interpolableValue, nonInterpolableValue,
environment.state()));
}
示例7: setFlagIfInheritUsed
void InvalidatableInterpolation::setFlagIfInheritUsed(InterpolationEnvironment& environment) const
{
if (!m_property.isCSSProperty() && !m_property.isPresentationAttribute())
return;
if (!environment.state().parentStyle())
return;
const CSSValue* startValue = toCSSPropertySpecificKeyframe(m_startKeyframe)->value();
const CSSValue* endValue = toCSSPropertySpecificKeyframe(m_endKeyframe)->value();
if ((startValue && startValue->isInheritedValue())
|| (endValue && endValue->isInheritedValue())) {
environment.state().parentStyle()->setHasExplicitlyInheritedProperties();
}
}
示例8: isValid
bool isValid(const InterpolationEnvironment& environment, const UnderlyingValue&) const final
{
Length parentLength;
if (!LengthPropertyFunctions::getLength(m_property, *environment.state().parentStyle(), parentLength))
return false;
return parentLength == m_length;
}
示例9: apply
void SVGInterpolationType::apply(
const InterpolableValue& interpolableValue,
const NonInterpolableValue* nonInterpolableValue,
InterpolationEnvironment& environment) const {
environment.svgElement().setWebAnimatedAttribute(
attribute(), appliedSVGValue(interpolableValue, nonInterpolableValue));
}
示例10: isValid
bool isValid(const InterpolationEnvironment& environment, const InterpolationValue& underlying) const final
{
StyleColor parentColor;
if (!PaintPropertyFunctions::getColor(m_property, *environment.state().parentStyle(), parentColor))
return !m_validColor;
return m_validColor && parentColor == m_color;
}
示例11: maybeConvertUnderlyingValue
InterpolationValue CSSImageInterpolationType::maybeConvertUnderlyingValue(
const InterpolationEnvironment& environment) const {
return maybeConvertStyleImage(
ImagePropertyFunctions::getStyleImage(cssProperty(),
*environment.state().style()),
true);
}
示例12: maybeConvertUnderlyingValue
InterpolationValue CSSPaintInterpolationType::maybeConvertUnderlyingValue(const InterpolationEnvironment& environment) const
{
// TODO(alancutter): Support capturing and animating with the visited paint color.
StyleColor underlyingColor;
if (!PaintPropertyFunctions::getColor(cssProperty(), *environment.state().style(), underlyingColor))
return nullptr;
return InterpolationValue(CSSColorInterpolationType::createInterpolableColor(underlyingColor));
}
示例13: apply
void CSSLengthListInterpolationType::apply(const InterpolableValue& interpolableValue, const NonInterpolableValue* nonInterpolableValue, InterpolationEnvironment& environment) const
{
const InterpolableList& interpolableList = toInterpolableList(interpolableValue);
const size_t length = interpolableList.length();
ASSERT(length > 0);
const NonInterpolableList& nonInterpolableList = toNonInterpolableList(*nonInterpolableValue);
ASSERT(nonInterpolableList.length() == length);
Vector<Length> result(length);
for (size_t i = 0; i < length; i++) {
result[i] = CSSLengthInterpolationType::resolveInterpolableLength(
*interpolableList.get(i),
nonInterpolableList.get(i),
environment.state().cssToLengthConversionData(),
m_valueRange);
}
LengthListPropertyFunctions::setLengthList(cssProperty(), *environment.state().style(), std::move(result));
}
示例14: maybeConvertSingle
InterpolationValue SVGInterpolationType::maybeConvertSingle(const PropertySpecificKeyframe& keyframe, const InterpolationEnvironment& environment, const InterpolationValue& underlying, ConversionCheckers& conversionCheckers) const
{
if (keyframe.isNeutral())
return maybeConvertNeutral(underlying, conversionCheckers);
SVGPropertyBase* svgValue = environment.svgBaseValue().cloneForAnimation(toSVGPropertySpecificKeyframe(keyframe).value());
return maybeConvertSVGValue(*svgValue);
}
示例15: convertBorderImageLengthBox
InterpolationValue
CSSBorderImageLengthBoxInterpolationType::maybeConvertUnderlyingValue(
const InterpolationEnvironment& environment) const {
const ComputedStyle& style = *environment.state().style();
return convertBorderImageLengthBox(
BorderImageLengthBoxPropertyFunctions::getBorderImageLengthBox(
cssProperty(), style),
style.effectiveZoom());
}