macro to handle type-casting for SkFlattenable::Deserialize
Bug: skia: Change-Id: If64f166cc03c32b7423361178d319474be063f19 Reviewed-on: https://skia-review.googlesource.com/87260 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
This commit is contained in:
parent
5c6ac64516
commit
92a2cfbcce
@ -64,6 +64,12 @@ struct SkDeserialProcs;
|
||||
} \
|
||||
Type getFlattenableType() const override { \
|
||||
return k##flattenable##_Type; \
|
||||
} \
|
||||
static sk_sp<flattenable> Deserialize(const void* data, size_t size, \
|
||||
const SkDeserialProcs* procs = nullptr) { \
|
||||
return sk_sp<flattenable>(static_cast<flattenable*>( \
|
||||
SkFlattenable::Deserialize( \
|
||||
k##flattenable##_Type, data, size, procs).release()));\
|
||||
}
|
||||
|
||||
/** \class SkFlattenable
|
||||
|
@ -19,6 +19,5 @@ SkFlattenable* SkValidatingDeserializeFlattenable(const void* data, size_t size,
|
||||
}
|
||||
|
||||
sk_sp<SkImageFilter> SkValidatingDeserializeImageFilter(const void* data, size_t size) {
|
||||
auto flat = SkFlattenable::Deserialize(SkFlattenable::kSkImageFilter_Type, data, size);
|
||||
return sk_sp<SkImageFilter>(static_cast<SkImageFilter*>(flat.release()));
|
||||
return SkImageFilter::Deserialize(data, size);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user