本文整理汇总了C++中InterpolationEnvironment::state方法的典型用法代码示例。如果您正苦于以下问题:C++ InterpolationEnvironment::state方法的具体用法?C++ InterpolationEnvironment::state怎么用?C++ InterpolationEnvironment::state使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InterpolationEnvironment
的用法示例。
在下文中一共展示了InterpolationEnvironment::state方法的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: 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()));
}
示例3: 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));
}
示例4: apply
void CSSPaintInterpolationType::apply(
const InterpolableValue& interpolableColor,
const NonInterpolableValue*,
InterpolationEnvironment& environment) const {
PaintPropertyFunctions::setColor(
cssProperty(), *environment.state().style(),
CSSColorInterpolationType::resolveInterpolableColor(interpolableColor,
environment.state()));
}
示例5: 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();
}
}
示例6: 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;
}
示例7: 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;
}
示例8: maybeConvertUnderlyingValue
InterpolationValue CSSImageInterpolationType::maybeConvertUnderlyingValue(
const InterpolationEnvironment& environment) const {
return maybeConvertStyleImage(
ImagePropertyFunctions::getStyleImage(cssProperty(),
*environment.state().style()),
true);
}
示例9: 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));
}
示例10: 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));
}
示例11: apply
void CSSScaleInterpolationType::apply(
const InterpolableValue& interpolableValue,
const NonInterpolableValue*,
InterpolationEnvironment& environment) const {
Scale scale(interpolableValue);
environment.state().style()->setScale(ScaleTransformOperation::create(
scale.array[0], scale.array[1], scale.array[2],
TransformOperation::Scale3D));
}
示例12: convertBorderImageLengthBox
InterpolationValue
CSSBorderImageLengthBoxInterpolationType::maybeConvertUnderlyingValue(
const InterpolationEnvironment& environment) const {
const ComputedStyle& style = *environment.state().style();
return convertBorderImageLengthBox(
BorderImageLengthBoxPropertyFunctions::getBorderImageLengthBox(
cssProperty(), style),
style.effectiveZoom());
}
示例13: apply
void CSSTransformInterpolationType::apply(
const InterpolableValue& interpolableValue,
const NonInterpolableValue* untypedNonInterpolableValue,
InterpolationEnvironment& environment) const {
double progress = toInterpolableNumber(interpolableValue).value();
const CSSTransformNonInterpolableValue& nonInterpolableValue =
toCSSTransformNonInterpolableValue(*untypedNonInterpolableValue);
environment.state().style()->setTransform(
nonInterpolableValue.getInterpolatedTransform(progress));
}
示例14: isValid
bool isValid(const InterpolationEnvironment& environment,
const InterpolationValue& underlying) const final {
const StyleImage* inheritedImage = ImagePropertyFunctions::getStyleImage(
m_property, *environment.state().parentStyle());
if (!m_inheritedImage && !inheritedImage)
return true;
if (!m_inheritedImage || !inheritedImage)
return false;
return *m_inheritedImage == *inheritedImage;
}
示例15: apply
void CSSImageListInterpolationType::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);
StyleImageList imageList(length);
for (size_t i = 0; i < length; i++)
imageList[i] = CSSImageInterpolationType::resolveStyleImage(cssProperty(), *interpolableList.get(i), nonInterpolableList.get(i), environment.state());
ImageListPropertyFunctions::setImageList(cssProperty(), *environment.state().style(), imageList);
}