Changeset View
Changeset View
Standalone View
Standalone View
libkwineffects/anidata.cpp
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Line(s) | |||||
74 | , startTime(0) | 74 | , startTime(0) | ||
75 | , waitAtSource(false) | 75 | , waitAtSource(false) | ||
76 | , keepAlive(true) | 76 | , keepAlive(true) | ||
77 | { | 77 | { | ||
78 | } | 78 | } | ||
79 | 79 | | |||
80 | AniData::AniData(AnimationEffect::Attribute a, int meta_, const FPx2 &to_, | 80 | AniData::AniData(AnimationEffect::Attribute a, int meta_, const FPx2 &to_, | ||
81 | int delay, const FPx2 &from_, bool waitAtSource_, | 81 | int delay, const FPx2 &from_, bool waitAtSource_, | ||
82 | FullScreenEffectLockPtr fullScreenEffectLock_, bool keepAlive, | 82 | FullScreenEffectLockPtr fullScreenEffectLock_, bool keepAlive, | ||
83 | PreviousWindowPixmapLockPtr previousWindowPixmapLock_) | 83 | PreviousWindowPixmapLockPtr previousWindowPixmapLock_) | ||
zzag: Heh, the good old "should I pass a shared pointer by value or const reference?"
The reasoning… | |||||
aacid: fair enough, i'm now moving these ptrs instead of const &-ing them | |||||
84 | : attribute(a) | 84 | : attribute(a) | ||
85 | , from(from_) | 85 | , from(from_) | ||
86 | , to(to_) | 86 | , to(to_) | ||
87 | , meta(meta_) | 87 | , meta(meta_) | ||
88 | , startTime(AnimationEffect::clock() + delay) | 88 | , startTime(AnimationEffect::clock() + delay) | ||
89 | , fullScreenEffectLock(fullScreenEffectLock_) | 89 | , fullScreenEffectLock(std::move(fullScreenEffectLock_)) | ||
90 | , waitAtSource(waitAtSource_) | 90 | , waitAtSource(waitAtSource_) | ||
91 | , keepAlive(keepAlive) | 91 | , keepAlive(keepAlive) | ||
92 | , previousWindowPixmapLock(previousWindowPixmapLock_) | 92 | , previousWindowPixmapLock(std::move(previousWindowPixmapLock_)) | ||
93 | { | 93 | { | ||
94 | } | 94 | } | ||
95 | 95 | | |||
96 | bool AniData::isActive() const | 96 | bool AniData::isActive() const | ||
97 | { | 97 | { | ||
98 | if (!timeLine.done()) { | 98 | if (!timeLine.done()) { | ||
99 | return true; | 99 | return true; | ||
100 | } | 100 | } | ||
Show All 33 Lines |
Heh, the good old "should I pass a shared pointer by value or const reference?"
The reasoning why these are not passed by const ref is to express that AniData will share ownership of the locks.