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

Unified Diff: third_party/WebKit/Source/core/style/FilterOperation.cpp

Issue 2609803002: Use ShadowData in DropShadowFilterOperation (Closed)
Patch Set: Fix blend(...) order Created 3 years, 12 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: third_party/WebKit/Source/core/style/FilterOperation.cpp
diff --git a/third_party/WebKit/Source/core/style/FilterOperation.cpp b/third_party/WebKit/Source/core/style/FilterOperation.cpp
index f72b6772bbe7e20daecd7910f0417521396756ce..f474d2a4e828bd93c3ce65fd68f39e88367317c5 100644
--- a/third_party/WebKit/Source/core/style/FilterOperation.cpp
+++ b/third_party/WebKit/Source/core/style/FilterOperation.cpp
@@ -174,25 +174,20 @@ FilterOperation* BlurFilterOperation::blend(const FilterOperation* from,
}
FloatRect DropShadowFilterOperation::mapRect(const FloatRect& rect) const {
- float stdDeviation = m_stdDeviation;
+ float stdDeviation = m_shadow.blur();
return FEDropShadow::mapEffect(FloatSize(stdDeviation, stdDeviation),
- FloatPoint(m_location), rect);
+ m_shadow.location(), rect);
}
FilterOperation* DropShadowFilterOperation::blend(const FilterOperation* from,
double progress) const {
if (!from) {
- return DropShadowFilterOperation::create(
- blink::blend(IntPoint(), m_location, progress),
- blink::blend(0, m_stdDeviation, progress),
- blink::blend(Color(Color::transparent), m_color, progress));
+ return create(m_shadow.blend(ShadowData::neutralValue(), progress,
+ Color::transparent));
}
- const DropShadowFilterOperation* fromOp = toDropShadowFilterOperation(from);
- return DropShadowFilterOperation::create(
- blink::blend(fromOp->location(), m_location, progress),
- blink::blend(fromOp->stdDeviation(), m_stdDeviation, progress),
- blink::blend(fromOp->getColor(), m_color, progress));
+ const auto& fromOp = toDropShadowFilterOperation(*from);
+ return create(m_shadow.blend(fromOp.m_shadow, progress, Color::transparent));
}
FloatRect BoxReflectFilterOperation::mapRect(const FloatRect& rect) const {
« no previous file with comments | « third_party/WebKit/Source/core/style/FilterOperation.h ('k') | third_party/WebKit/Source/core/style/FilterOperationsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698