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

Unified Diff: Source/core/rendering/style/ShadowData.cpp

Issue 38823002: Web Animations CSS: Support animation of {text,box,-webkit-box}-shadow and fix blur clamping (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: use 0 instead of PassRefPtr<..>() Created 7 years, 2 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
« no previous file with comments | « Source/core/rendering/style/ShadowData.h ('k') | Source/core/rendering/style/ShadowList.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/style/ShadowData.cpp
diff --git a/Source/core/rendering/style/ShadowData.cpp b/Source/core/rendering/style/ShadowData.cpp
index 56d6610bedc332b49281b1f702e948d7c708bcf0..7f81d909f6bd37d52a1a0ad6f1d6171e2223fff4 100644
--- a/Source/core/rendering/style/ShadowData.cpp
+++ b/Source/core/rendering/style/ShadowData.cpp
@@ -22,6 +22,8 @@
#include "config.h"
#include "core/rendering/style/ShadowData.h"
+#include "platform/animation/AnimationUtilities.h"
+
namespace WebCore {
bool ShadowData::operator==(const ShadowData& o) const
@@ -33,4 +35,16 @@ bool ShadowData::operator==(const ShadowData& o) const
&& m_color == o.m_color;
}
+ShadowData ShadowData::blend(const ShadowData& from, double progress) const
+{
+ if (style() != from.style())
+ return *this;
+
+ return ShadowData(WebCore::blend(from.location(), location(), progress),
+ clampTo<int>(WebCore::blend(from.blur(), blur(), progress), 0),
+ WebCore::blend(from.spread(), spread(), progress),
+ style(),
+ WebCore::blend(from.color(), color(), progress));
+}
+
} // namespace WebCore
« no previous file with comments | « Source/core/rendering/style/ShadowData.h ('k') | Source/core/rendering/style/ShadowList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698