Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Side by Side Diff: Source/core/animation/KeyframeEffectModel.cpp

Issue 1218943002: Compositor animations for Independent CSS Transform Properties (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add Manual Tests and fix bug with cancel tests Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/animation/KeyframeEffectModel.h ('k') | Source/core/style/ComputedStyle.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 void KeyframeEffectModelBase::forceConversionsToAnimatableValues(Element& elemen t, const ComputedStyle* baseStyle) 76 void KeyframeEffectModelBase::forceConversionsToAnimatableValues(Element& elemen t, const ComputedStyle* baseStyle)
77 { 77 {
78 ensureKeyframeGroups(); 78 ensureKeyframeGroups();
79 snapshotCompositableProperties(element, baseStyle); 79 snapshotCompositableProperties(element, baseStyle);
80 ensureInterpolationEffect(&element, baseStyle); 80 ensureInterpolationEffect(&element, baseStyle);
81 } 81 }
82 82
83 void KeyframeEffectModelBase::snapshotCompositableProperties(Element& element, c onst ComputedStyle* baseStyle) 83 void KeyframeEffectModelBase::snapshotCompositableProperties(Element& element, c onst ComputedStyle* baseStyle)
84 { 84 {
85 ensureKeyframeGroups(); 85 ensureKeyframeGroups();
86 for (CSSPropertyID id : CompositorAnimations::CompositableProperties) { 86 for (CSSPropertyID id : CompositorAnimations::compositableProperties) {
87 PropertyHandle property = PropertyHandle(id); 87 PropertyHandle property = PropertyHandle(id);
88 if (!affects(property)) 88 if (!affects(property))
89 continue; 89 continue;
90 for (auto& keyframe : m_keyframeGroups->get(property)->m_keyframes) 90 for (auto& keyframe : m_keyframeGroups->get(property)->m_keyframes)
91 keyframe->populateAnimatableValue(id, element, baseStyle); 91 keyframe->populateAnimatableValue(id, element, baseStyle);
92 } 92 }
93 } 93 }
94 94
95 bool KeyframeEffectModelBase::updateNeutralKeyframeAnimatableValues(CSSPropertyI D property, PassRefPtrWillBeRawPtr<AnimatableValue> value) 95 bool KeyframeEffectModelBase::updateNeutralKeyframeAnimatableValues(CSSPropertyI D property, PassRefPtrWillBeRawPtr<AnimatableValue> value)
96 { 96 {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 for (size_t j = 1; j < i - lastIndex; ++j) 147 for (size_t j = 1; j < i - lastIndex; ++j)
148 result[lastIndex + j]->setOffset(lastOffset + (offset - lastOffs et) * j / (i - lastIndex)); 148 result[lastIndex + j]->setOffset(lastOffset + (offset - lastOffs et) * j / (i - lastIndex));
149 lastIndex = i; 149 lastIndex = i;
150 lastOffset = offset; 150 lastOffset = offset;
151 } 151 }
152 } 152 }
153 153
154 return result; 154 return result;
155 } 155 }
156 156
157 bool KeyframeEffectModelBase::isTransformRelatedEffect() const
158 {
159 return affects(PropertyHandle(CSSPropertyTransform))
160 || affects(PropertyHandle(CSSPropertyRotate))
161 || affects(PropertyHandle(CSSPropertyScale))
162 || affects(PropertyHandle(CSSPropertyTranslate));
163 }
157 164
158 void KeyframeEffectModelBase::ensureKeyframeGroups() const 165 void KeyframeEffectModelBase::ensureKeyframeGroups() const
159 { 166 {
160 if (m_keyframeGroups) 167 if (m_keyframeGroups)
161 return; 168 return;
162 169
163 m_keyframeGroups = adoptPtrWillBeNoop(new KeyframeGroupMap); 170 m_keyframeGroups = adoptPtrWillBeNoop(new KeyframeGroupMap);
164 for (const auto& keyframe : normalizedKeyframes(getFrames())) { 171 for (const auto& keyframe : normalizedKeyframes(getFrames())) {
165 for (const PropertyHandle& property : keyframe->properties()) { 172 for (const PropertyHandle& property : keyframe->properties()) {
166 if (property.isCSSProperty()) 173 if (property.isCSSProperty())
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 } 285 }
279 286
280 DEFINE_TRACE(KeyframeEffectModelBase::PropertySpecificKeyframeGroup) 287 DEFINE_TRACE(KeyframeEffectModelBase::PropertySpecificKeyframeGroup)
281 { 288 {
282 #if ENABLE(OILPAN) 289 #if ENABLE(OILPAN)
283 visitor->trace(m_keyframes); 290 visitor->trace(m_keyframes);
284 #endif 291 #endif
285 } 292 }
286 293
287 } // namespace 294 } // namespace
OLDNEW
« no previous file with comments | « Source/core/animation/KeyframeEffectModel.h ('k') | Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698