2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Removed anim::cvalue and ColorAnimation, all done by fvalue now.

Also moved style::interpolate to anim::color/anim::pen/anim::brush.
This commit is contained in:
John Preston
2016-11-07 14:24:19 +03:00
parent 0326976473
commit 23c2e5364a
55 changed files with 483 additions and 602 deletions

View File

@@ -52,8 +52,9 @@ struct lambda_wrap_helper_base {
const call_type call;
const destruct_type destruct;
static constexpr size_t kFullStorageSize = sizeof(void*) + 24U;
static constexpr size_t kFullStorageSize = 24U + sizeof(void*);
static constexpr size_t kStorageSize = kFullStorageSize - sizeof(void*);
using alignment = uint64;
template <typename Lambda>
using IsLarge = std_::integral_constant<bool, !(sizeof(std_::decay_simple_t<Lambda>) <= kStorageSize)>;
@@ -144,7 +145,7 @@ struct lambda_wrap_helper_move_impl<Lambda, std_::false_type, Return, Args...> :
new (lambda) JustLambda(static_cast<JustLambda&&>(*source_lambda));
}
static void construct_move_lambda_method(void *lambda, void *source) {
static_assert(alignof(JustLambda) <= alignof(void*), "Bad lambda alignment.");
static_assert(alignof(JustLambda) <= alignof(typename Parent::alignment), "Bad lambda alignment.");
auto space = sizeof(JustLambda);
auto aligned = std_::align(alignof(JustLambda), space, lambda, space);
t_assert(aligned == lambda);
@@ -219,7 +220,7 @@ struct lambda_wrap_helper_copy_impl<Lambda, std_::false_type, Return, Args...> :
new (lambda) JustLambda(static_cast<const JustLambda &>(*source_lambda));
}
static void construct_copy_lambda_method(void *lambda, const void *source) {
static_assert(alignof(JustLambda) <= alignof(void*), "Bad lambda alignment.");
static_assert(alignof(JustLambda) <= alignof(typename Parent::alignment), "Bad lambda alignment.");
auto space = sizeof(JustLambda);
auto aligned = std_::align(alignof(JustLambda), space, lambda, space);
t_assert(aligned == lambda);
@@ -318,10 +319,12 @@ protected:
lambda_unique(const BaseHelper *helper, const Private &) : helper_(helper) {
}
const BaseHelper *helper_;
static_assert(BaseHelper::kStorageSize % sizeof(void*) == 0, "Bad pointer size.");
void *(storage_[BaseHelper::kStorageSize / sizeof(void*)]);
union {
void *(storage_[BaseHelper::kStorageSize / sizeof(void*)]);
typename BaseHelper::alignment alignment_;
};
const BaseHelper *helper_;
};