зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1026315 - Remove PercentageHashKey; r=dbaron
This commit is contained in:
Родитель
6bc9caf270
Коммит
4798898a62
|
@ -325,35 +325,6 @@ nsAnimationManager::CheckAnimationRule(nsStyleContext* aStyleContext,
|
|||
return GetAnimationRule(aElement, aStyleContext->GetPseudoType());
|
||||
}
|
||||
|
||||
class PercentageHashKey : public PLDHashEntryHdr
|
||||
{
|
||||
public:
|
||||
typedef const float& KeyType;
|
||||
typedef const float* KeyTypePointer;
|
||||
|
||||
PercentageHashKey(KeyTypePointer aKey) : mValue(*aKey) { }
|
||||
PercentageHashKey(const PercentageHashKey& toCopy) : mValue(toCopy.mValue) { }
|
||||
~PercentageHashKey() { }
|
||||
|
||||
KeyType GetKey() const { return mValue; }
|
||||
bool KeyEquals(KeyTypePointer aKey) const { return *aKey == mValue; }
|
||||
|
||||
static KeyTypePointer KeyToPointer(KeyType aKey) { return &aKey; }
|
||||
static PLDHashNumber HashKey(KeyTypePointer aKey) {
|
||||
static_assert(sizeof(PLDHashNumber) == sizeof(uint32_t),
|
||||
"this hash function assumes PLDHashNumber is uint32_t");
|
||||
static_assert(PLDHashNumber(-1) > PLDHashNumber(0),
|
||||
"this hash function assumes PLDHashNumber is uint32_t");
|
||||
float key = *aKey;
|
||||
NS_ABORT_IF_FALSE(0.0f <= key && key <= 1.0f, "out of range");
|
||||
return PLDHashNumber(key * UINT32_MAX);
|
||||
}
|
||||
enum { ALLOW_MEMMOVE = true };
|
||||
|
||||
private:
|
||||
const float mValue;
|
||||
};
|
||||
|
||||
struct KeyframeData {
|
||||
float mKey;
|
||||
uint32_t mIndex; // store original order since sort algorithm is not stable
|
||||
|
@ -469,8 +440,6 @@ nsAnimationManager::BuildAnimations(nsStyleContext* aStyleContext,
|
|||
float key = keys[keyIdx];
|
||||
// FIXME (spec): The spec doesn't say what to do with
|
||||
// out-of-range keyframes. We'll ignore them.
|
||||
// (And PercentageHashKey currently assumes we either ignore or
|
||||
// clamp them.)
|
||||
if (0.0f <= key && key <= 1.0f) {
|
||||
KeyframeData *data = sortedKeyframes.AppendElement();
|
||||
data->mKey = key;
|
||||
|
|
Загрузка…
Ссылка в новой задаче