本文整理汇总了C++中OwnPtrWillBeRawPtr::set方法的典型用法代码示例。如果您正苦于以下问题:C++ OwnPtrWillBeRawPtr::set方法的具体用法?C++ OwnPtrWillBeRawPtr::set怎么用?C++ OwnPtrWillBeRawPtr::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OwnPtrWillBeRawPtr
的用法示例。
在下文中一共展示了OwnPtrWillBeRawPtr::set方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toCSSShadowValue
PassOwnPtrWillBeRawPtr<InterpolableValue> ShadowStyleInterpolation::toInterpolableValue(const CSSValue& value, NonInterpolableType& nonInterpolableData)
{
OwnPtrWillBeRawPtr<InterpolableList> result = InterpolableList::create(5);
const CSSShadowValue* shadowValue = toCSSShadowValue(&value);
ASSERT(shadowValue);
result->set(0, lengthToInterpolableValue(shadowValue->x));
result->set(1, lengthToInterpolableValue(shadowValue->y));
result->set(2, lengthToInterpolableValue(shadowValue->blur));
result->set(3, lengthToInterpolableValue(shadowValue->spread));
if (shadowValue->color && ColorStyleInterpolation::canCreateFrom(*shadowValue->color))
result->set(4, ColorStyleInterpolation::colorToInterpolableValue(*shadowValue->color));
if (shadowValue->style)
nonInterpolableData = (shadowValue->style->getValueID() == CSSValueInset);
else
nonInterpolableData = false;
return result.release();
}
示例2: toCSSPrimitiveValue
PassOwnPtrWillBeRawPtr<InterpolableValue> LengthStyleInterpolation::lengthToInterpolableValue(CSSValue* value)
{
OwnPtrWillBeRawPtr<InterpolableList> result = InterpolableList::create(CSSPrimitiveValue::LengthUnitTypeCount);
CSSPrimitiveValue* primitive = toCSSPrimitiveValue(value);
CSSLengthArray array;
for (size_t i = 0; i < CSSPrimitiveValue::LengthUnitTypeCount; i++)
array.append(0);
primitive->accumulateLengthArray(array);
for (size_t i = 0; i < CSSPrimitiveValue::LengthUnitTypeCount; i++)
result->set(i, InterpolableNumber::create(array.at(i)));
return result.release();
}
示例3: interpolateLists
TEST_F(AnimationInterpolableValueTest, NestedList)
{
OwnPtrWillBeRawPtr<InterpolableList> listA = InterpolableList::create(3);
listA->set(0, InterpolableNumber::create(0));
OwnPtrWillBeRawPtr<InterpolableList> subListA = InterpolableList::create(1);
subListA->set(0, InterpolableNumber::create(100));
listA->set(1, subListA.release());
listA->set(2, InterpolableBool::create(false));
OwnPtrWillBeRawPtr<InterpolableList> listB = InterpolableList::create(3);
listB->set(0, InterpolableNumber::create(100));
OwnPtrWillBeRawPtr<InterpolableList> subListB = InterpolableList::create(1);
subListB->set(0, InterpolableNumber::create(50));
listB->set(1, subListB.release());
listB->set(2, InterpolableBool::create(true));
RefPtrWillBeRawPtr<Interpolation> i = interpolateLists(listA.release(), listB.release(), 0.5);
InterpolableList* outList = toInterpolableList(interpolationValue(*i.get()));
EXPECT_FLOAT_EQ(50, toInterpolableNumber(outList->get(0))->value());
EXPECT_FLOAT_EQ(75, toInterpolableNumber(toInterpolableList(outList->get(1))->get(0))->value());
EXPECT_TRUE(toInterpolableBool(outList->get(2))->value());
}
示例4: create
PassOwnPtrWillBeRawPtr<InterpolableValue> InterpolableList::interpolate(const InterpolableValue &to, const double progress) const
{
const InterpolableList* toList = toInterpolableList(&to);
ASSERT(toList->m_size == m_size);
if (!progress) {
return create(*this);
}
if (progress == 1) {
return InterpolableList::create(*toList);
}
OwnPtrWillBeRawPtr<InterpolableList> result = create(m_size);
for (size_t i = 0; i < m_size; i++) {
ASSERT(m_values[i]);
ASSERT(toList->m_values[i]);
result->set(i, m_values[i]->interpolate(*(toList->m_values[i]), progress));
}
return result.release();
}