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

Unified Diff: Source/core/animation/CompositorAnimations.cpp

Issue 1299323005: blink: Add backdrop-filter support (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: one more Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/animation/CompositorAnimations.cpp
diff --git a/Source/core/animation/CompositorAnimations.cpp b/Source/core/animation/CompositorAnimations.cpp
index 0c4154e14425832dd124b969c5bfa6742194d828..b675ed830aaf1e9e8313a1cc628e212054acfe3b 100644
--- a/Source/core/animation/CompositorAnimations.cpp
+++ b/Source/core/animation/CompositorAnimations.cpp
@@ -116,6 +116,7 @@ bool hasIncompatibleAnimations(const Element& targetElement, const Animation& an
const bool affectsOpacity = effectToAdd.affects(PropertyHandle(CSSPropertyOpacity));
const bool affectsTransform = effectToAdd.isTransformRelatedEffect();
const bool affectsFilter = effectToAdd.affects(PropertyHandle(CSSPropertyWebkitFilter));
+ const bool affectsBackdropFilter = effectToAdd.affects(PropertyHandle(CSSPropertyBackdropFilter));
chrishtr 2015/09/26 00:50:33 Should we support compositor animations of backgro
if (!targetElement.hasAnimations())
return false;
@@ -130,7 +131,8 @@ bool hasIncompatibleAnimations(const Element& targetElement, const Animation& an
if ((affectsOpacity && attachedAnimation->affects(targetElement, CSSPropertyOpacity))
|| (affectsTransform && isTransformRelatedAnimation(targetElement, attachedAnimation))
- || (affectsFilter && attachedAnimation->affects(targetElement, CSSPropertyWebkitFilter)))
+ || (affectsFilter && attachedAnimation->affects(targetElement, CSSPropertyWebkitFilter))
+ || (affectsBackdropFilter && attachedAnimation->affects(targetElement, CSSPropertyBackdropFilter)))
return true;
}
@@ -161,13 +163,14 @@ bool CompositorAnimations::isCompositableProperty(CSSPropertyID property)
return false;
}
-const CSSPropertyID CompositorAnimations::compositableProperties[6] = {
+const CSSPropertyID CompositorAnimations::compositableProperties[7] = {
CSSPropertyOpacity,
CSSPropertyRotate,
CSSPropertyScale,
CSSPropertyTransform,
CSSPropertyTranslate,
- CSSPropertyWebkitFilter
+ CSSPropertyWebkitFilter,
+ CSSPropertyBackdropFilter
};
bool CompositorAnimations::getAnimatedBoundingBox(FloatBox& box, const EffectModel& effect, double minValue, double maxValue) const
@@ -271,7 +274,8 @@ bool CompositorAnimations::isCandidateForAnimationOnCompositor(const Timing& tim
if (toAnimatableTransform(keyframe->getAnimatableValue().get())->transformOperations().dependsOnBoxSize())
return false;
break;
- case CSSPropertyWebkitFilter: {
+ case CSSPropertyWebkitFilter:
+ case CSSPropertyBackdropFilter: {
const FilterOperations& operations = toAnimatableFilterOperations(keyframe->getAnimatableValue().get())->operations();
if (operations.hasFilterThatMovesPixels())
return false;
@@ -301,8 +305,9 @@ bool CompositorAnimations::isCandidateForAnimationOnCompositor(const Timing& tim
void CompositorAnimations::cancelIncompatibleAnimationsOnCompositor(const Element& targetElement, const Animation& animationToAdd, const EffectModel& effectToAdd)
{
const bool affectsOpacity = effectToAdd.affects(PropertyHandle(CSSPropertyOpacity));
- const bool affectsTransform = effectToAdd.isTransformRelatedEffect();
+ const bool affectsTransform = effectToAdd.isTransformRelatedEffect();
const bool affectsFilter = effectToAdd.affects(PropertyHandle(CSSPropertyWebkitFilter));
+ const bool affectsBackdropFilter = effectToAdd.affects(PropertyHandle(CSSPropertyBackdropFilter));
if (!targetElement.hasAnimations())
return;
@@ -317,7 +322,8 @@ void CompositorAnimations::cancelIncompatibleAnimationsOnCompositor(const Elemen
if ((affectsOpacity && attachedAnimation->affects(targetElement, CSSPropertyOpacity))
|| (affectsTransform && isTransformRelatedAnimation(targetElement, attachedAnimation))
- || (affectsFilter && attachedAnimation->affects(targetElement, CSSPropertyWebkitFilter)))
+ || (affectsFilter && attachedAnimation->affects(targetElement, CSSPropertyWebkitFilter))
+ || (affectsBackdropFilter && attachedAnimation->affects(targetElement, CSSPropertyBackdropFilter)))
attachedAnimation->cancelAnimationOnCompositor();
}
}
@@ -680,7 +686,8 @@ void CompositorAnimationsImpl::getAnimationOnCompositor(const Timing& timing, in
curve = adoptPtr(floatCurve);
break;
}
- case CSSPropertyWebkitFilter: {
+ case CSSPropertyWebkitFilter:
+ case CSSPropertyBackdropFilter: {
targetProperty = WebCompositorAnimation::TargetPropertyFilter;
WebFilterAnimationCurve* filterCurve = Platform::current()->compositorSupport()->createFilterAnimationCurve();
addKeyframesToCurve(*filterCurve, values, timing);
« no previous file with comments | « Source/core/animation/CompositorAnimations.h ('k') | Source/core/animation/DeferredLegacyStyleInterpolationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698