本文整理汇总了C++中SkDisplayable::dirty方法的典型用法代码示例。如果您正苦于以下问题:C++ SkDisplayable::dirty方法的具体用法?C++ SkDisplayable::dirty怎么用?C++ SkDisplayable::dirty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkDisplayable
的用法示例。
在下文中一共展示了SkDisplayable::dirty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deepCopy
SkDisplayable* SkDisplayable::deepCopy(SkAnimateMaker* maker) {
SkDisplayTypes type = getType();
if (type == SkType_Unknown) {
SkASSERT(0);
return NULL;
}
SkDisplayable* copy = SkDisplayType::CreateInstance(maker, type);
int index = -1;
int propIndex = 0;
const SkMemberInfo* info;
do {
info = copy->getMember(++index);
if (info == NULL)
break;
if (info->fType == SkType_MemberProperty) {
SkScriptValue value;
if (getProperty(propIndex, &value))
copy->setProperty(propIndex, value);
propIndex++;
continue;
}
if (info->fType == SkType_MemberFunction)
continue;
if (info->fType == SkType_Array) {
SkTDOperandArray* array = (SkTDOperandArray*) info->memberData(this);
int arrayCount;
if (array == NULL || (arrayCount = array->count()) == 0)
continue;
SkTDOperandArray* copyArray = (SkTDOperandArray*) info->memberData(copy);
copyArray->setCount(arrayCount);
SkDisplayTypes elementType;
if (type == SkType_Array) {
SkDisplayArray* dispArray = (SkDisplayArray*) this;
elementType = dispArray->values.getType();
} else
elementType = info->arrayType();
size_t elementSize = SkMemberInfo::GetSize(elementType);
size_t byteSize = elementSize * arrayCount;
memcpy(copyArray->begin(), array->begin(), byteSize);
continue;
}
if (SkDisplayType::IsDisplayable(maker, info->fType)) {
SkDisplayable** displayable = (SkDisplayable**) info->memberData(this);
if (*displayable == NULL || *displayable == (SkDisplayable*) -1)
continue;
SkDisplayable* deeper = (*displayable)->deepCopy(maker);
info->setMemberData(copy, deeper, sizeof(deeper));
continue;
}
if (info->fType == SkType_String || info->fType == SkType_DynamicString) {
SkString* string;
info->getString(this, &string);
info->setString(copy, string);
continue;
}
void* data = info->memberData(this);
size_t size = SkMemberInfo::GetSize(info->fType);
info->setMemberData(copy, data, size);
} while (true);
copy->dirty();
return copy;
}