本文整理汇总了C++中ConversionCheckers类的典型用法代码示例。如果您正苦于以下问题:C++ ConversionCheckers类的具体用法?C++ ConversionCheckers怎么用?C++ ConversionCheckers使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ConversionCheckers类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
PassOwnPtr<InterpolationValue> CSSImageListInterpolationType::maybeConvertNeutral(const UnderlyingValue& underlyingValue, ConversionCheckers& conversionCheckers) const
{
if (!underlyingValue) {
conversionCheckers.append(UnderlyingImageListChecker::create(*this, nullptr));
return nullptr;
}
conversionCheckers.append(UnderlyingImageListChecker::create(*this, underlyingValue->clone()));
return underlyingValue->clone();
}
示例2: maybeConvertInherit
InterpolationValue CSSPaintInterpolationType::maybeConvertInherit(const StyleResolverState& state, ConversionCheckers& conversionCheckers) const
{
if (!state.parentStyle())
return nullptr;
StyleColor parentColor;
if (!PaintPropertyFunctions::getColor(cssProperty(), *state.parentStyle(), parentColor)) {
conversionCheckers.append(ParentPaintChecker::create(cssProperty()));
return nullptr;
}
conversionCheckers.append(ParentPaintChecker::create(cssProperty(), parentColor));
return InterpolationValue(CSSColorInterpolationType::createInterpolableColor(parentColor));
}
示例3: maybeConvertSingle
InterpolationValue CSSInterpolationType::maybeConvertSingle(
const PropertySpecificKeyframe& keyframe,
const InterpolationEnvironment& environment,
const InterpolationValue& underlying,
ConversionCheckers& conversionCheckers) const {
const CSSValue* value = toCSSPropertySpecificKeyframe(keyframe).value();
if (!value)
return maybeConvertNeutral(underlying, conversionCheckers);
if (value->isVariableReferenceValue() ||
value->isPendingSubstitutionValue()) {
bool omitAnimationTainted = false;
const CSSValue* resolvedValue =
CSSVariableResolver::resolveVariableReferences(
environment.state(), cssProperty(), *value, omitAnimationTainted);
conversionCheckers.push_back(
ResolvedVariableChecker::create(cssProperty(), value, resolvedValue));
value = resolvedValue;
}
if (value->isInitialValue() ||
(value->isUnsetValue() &&
!CSSPropertyMetadata::isInheritedProperty(cssProperty())))
return maybeConvertInitial(environment.state(), conversionCheckers);
if (value->isInheritedValue() ||
(value->isUnsetValue() &&
CSSPropertyMetadata::isInheritedProperty(cssProperty())))
return maybeConvertInherit(environment.state(), conversionCheckers);
return maybeConvertValue(*value, environment.state(), conversionCheckers);
}
示例4: maybeConvertNeutral
InterpolationValue CSSBasicShapeInterpolationType::maybeConvertNeutral(const InterpolationValue& underlying, ConversionCheckers& conversionCheckers) const
{
// const_cast is for taking refs.
NonInterpolableValue* nonInterpolableValue = const_cast<NonInterpolableValue*>(underlying.nonInterpolableValue.get());
conversionCheckers.append(UnderlyingCompatibilityChecker::create(nonInterpolableValue));
return InterpolationValue(BasicShapeInterpolationFunctions::createNeutralValue(*underlying.nonInterpolableValue), nonInterpolableValue);
}
示例5: maybeConvertInherit
InterpolationValue CSSScaleInterpolationType::maybeConvertInherit(
const StyleResolverState& state,
ConversionCheckers& conversionCheckers) const {
Scale parentScale(state.parentStyle()->scale());
conversionCheckers.append(ParentScaleChecker::create(parentScale));
return InterpolationValue(parentScale.createInterpolableValue());
}
示例6: maybeConvertInherit
InterpolationValue CSSBasicShapeInterpolationType::maybeConvertInherit(const StyleResolverState& state, ConversionCheckers& conversionCheckers) const
{
const BasicShape* shape = BasicShapePropertyFunctions::getBasicShape(cssProperty(), *state.parentStyle());
// const_cast to take a ref.
conversionCheckers.append(InheritedShapeChecker::create(cssProperty(), const_cast<BasicShape*>(shape)));
return BasicShapeInterpolationFunctions::maybeConvertBasicShape(shape, state.parentStyle()->effectiveZoom());
}
示例7: maybeConvertValue
InterpolationValue CSSTransformInterpolationType::maybeConvertValue(
const CSSValue& value,
const StyleResolverState& state,
ConversionCheckers& conversionCheckers) const {
if (value.isValueList()) {
CSSLengthArray lengthArray;
for (const CSSValue* item : toCSSValueList(value)) {
const CSSFunctionValue& transformFunction = toCSSFunctionValue(*item);
if (transformFunction.functionType() == CSSValueMatrix ||
transformFunction.functionType() == CSSValueMatrix3d) {
lengthArray.typeFlags.set(CSSPrimitiveValue::UnitTypePixels);
continue;
}
for (const CSSValue* argument : transformFunction) {
const CSSPrimitiveValue& primitiveValue =
toCSSPrimitiveValue(*argument);
if (!primitiveValue.isLength())
continue;
primitiveValue.accumulateLengthArray(lengthArray);
}
}
std::unique_ptr<InterpolationType::ConversionChecker> lengthUnitsChecker =
LengthUnitsChecker::maybeCreate(std::move(lengthArray), state);
if (lengthUnitsChecker)
conversionCheckers.append(std::move(lengthUnitsChecker));
}
TransformOperations transform;
TransformBuilder::createTransformOperations(
value, state.cssToLengthConversionData(), transform);
return convertTransform(std::move(transform));
}
示例8: maybeConvertInherit
InterpolationValue CSSClipInterpolationType::maybeConvertInherit(const StyleResolverState& state, ConversionCheckers& conversionCheckers) const
{
ClipAutos parentAutos = getClipAutos(*state.parentStyle());
conversionCheckers.append(ParentAutosChecker::create(parentAutos));
if (parentAutos.isAuto)
return nullptr;
return createClipValue(state.parentStyle()->clip(), state.parentStyle()->effectiveZoom());
}
示例9: convertShadowList
PassOwnPtr<InterpolationValue> CSSShadowListInterpolationType::maybeConvertInherit(const StyleResolverState& state, ConversionCheckers& conversionCheckers) const
{
if (!state.parentStyle())
return nullptr;
const ShadowList* parentShadowList = ShadowListPropertyFunctions::getShadowList(cssProperty(), *state.parentStyle());
conversionCheckers.append(ParentShadowListChecker::create(*this, cssProperty(), const_cast<ShadowList*>(parentShadowList))); // Take ref.
return convertShadowList(parentShadowList, state.parentStyle()->effectiveZoom());
}
示例10: addConversionCheckers
void InvalidatableInterpolation::addConversionCheckers(
const InterpolationType& type,
ConversionCheckers& conversionCheckers) const {
for (size_t i = 0; i < conversionCheckers.size(); i++) {
conversionCheckers[i]->setType(type);
m_conversionCheckers.append(std::move(conversionCheckers[i]));
}
}
示例11: maybeConvertInherit
InterpolationValue CSSRotateInterpolationType::maybeConvertInherit(
const StyleResolverState& state,
ConversionCheckers& conversionCheckers) const {
Rotation inheritedRotation = getRotation(*state.parentStyle());
conversionCheckers.push_back(
InheritedRotationChecker::create(inheritedRotation));
return convertRotation(inheritedRotation);
}
示例12: maybeConvertInherit
InterpolationValue CSSTransformInterpolationType::maybeConvertInherit(
const StyleResolverState& state,
ConversionCheckers& conversionCheckers) const {
const TransformOperations& inheritedTransform =
state.parentStyle()->transform();
conversionCheckers.append(
InheritedTransformChecker::create(inheritedTransform));
return convertTransform(inheritedTransform);
}
示例13: create
PassOwnPtr<InterpolationValue> SVGPathInterpolationType::maybeConvertNeutral(const UnderlyingValue& underlyingValue, ConversionCheckers& conversionCheckers) const
{
conversionCheckers.append(UnderlyingPathSegTypesChecker::create(*this, underlyingValue));
OwnPtr<InterpolableList> result = InterpolableList::create(PathComponentIndexCount);
result->set(PathArgsIndex, toInterpolableList(underlyingValue->interpolableValue()).get(PathArgsIndex)->cloneAndZero());
result->set(PathNeutralIndex, InterpolableNumber::create(1));
return InterpolationValue::create(*this, result.release(),
const_cast<NonInterpolableValue*>(underlyingValue->nonInterpolableValue())); // Take ref.
}
示例14: maybeConvertInherit
InterpolationValue CSSColorInterpolationType::maybeConvertInherit(const StyleResolverState& state, ConversionCheckers& conversionCheckers) const
{
if (!state.parentStyle())
return nullptr;
// Visited color can never explicitly inherit from parent visited color so only use the unvisited color.
const StyleColor inheritedColor = ColorPropertyFunctions::getUnvisitedColor(cssProperty(), *state.parentStyle());
conversionCheckers.append(ParentColorChecker::create(cssProperty(), inheritedColor));
return convertStyleColorPair(inheritedColor, inheritedColor);
}
示例15: maybeConvertInherit
InterpolationValue CSSLengthListInterpolationType::maybeConvertInherit(const StyleResolverState& state, ConversionCheckers& conversionCheckers) const
{
Vector<Length> inheritedLengthList;
bool success = LengthListPropertyFunctions::getLengthList(cssProperty(), *state.parentStyle(), inheritedLengthList);
conversionCheckers.append(ParentLengthListChecker::create(cssProperty(), inheritedLengthList));
if (!success)
return nullptr;
return maybeConvertLengthList(inheritedLengthList, state.parentStyle()->effectiveZoom());
}