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

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

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.h
diff --git a/third_party/WebKit/Source/core/style/FilterOperation.h b/third_party/WebKit/Source/core/style/FilterOperation.h
index cf564f9f3524cb46233bb6d2c5a3177db66a288c..ff7152ebbd6f8075684c2380778e1a10a8a83139 100644
--- a/third_party/WebKit/Source/core/style/FilterOperation.h
+++ b/third_party/WebKit/Source/core/style/FilterOperation.h
@@ -27,6 +27,7 @@
#define FilterOperation_h
#include "core/CoreExport.h"
+#include "core/style/ShadowData.h"
#include "platform/Length.h"
#include "platform/geometry/FloatRect.h"
#include "platform/graphics/BoxReflection.h"
@@ -288,17 +289,11 @@ DEFINE_FILTER_OPERATION_TYPE_CASTS(BlurFilterOperation, BLUR);
class CORE_EXPORT DropShadowFilterOperation : public FilterOperation {
public:
- static DropShadowFilterOperation* create(const IntPoint& location,
- int stdDeviation,
- Color color) {
- return new DropShadowFilterOperation(location, stdDeviation, color);
+ static DropShadowFilterOperation* create(const ShadowData& shadow) {
+ return new DropShadowFilterOperation(shadow);
}
- int x() const { return m_location.x(); }
- int y() const { return m_location.y(); }
- IntPoint location() const { return m_location; }
- int stdDeviation() const { return m_stdDeviation; }
- Color getColor() const { return m_color; }
+ const ShadowData& shadow() const { return m_shadow; }
bool affectsOpacity() const override { return true; }
bool movesPixels() const override { return true; }
@@ -312,21 +307,13 @@ class CORE_EXPORT DropShadowFilterOperation : public FilterOperation {
return false;
const DropShadowFilterOperation* other =
static_cast<const DropShadowFilterOperation*>(&o);
- return m_location == other->m_location &&
- m_stdDeviation == other->m_stdDeviation && m_color == other->m_color;
+ return m_shadow == other->m_shadow;
}
- DropShadowFilterOperation(const IntPoint& location,
- int stdDeviation,
- Color color)
- : FilterOperation(DROP_SHADOW),
- m_location(location),
- m_stdDeviation(stdDeviation),
- m_color(color) {}
-
- IntPoint m_location; // FIXME: should location be in Lengths?
- int m_stdDeviation;
- Color m_color;
+ DropShadowFilterOperation(const ShadowData& shadow)
+ : FilterOperation(DROP_SHADOW), m_shadow(shadow) {}
+
+ ShadowData m_shadow;
};
DEFINE_FILTER_OPERATION_TYPE_CASTS(DropShadowFilterOperation, DROP_SHADOW);
« no previous file with comments | « third_party/WebKit/Source/core/paint/FilterEffectBuilder.cpp ('k') | third_party/WebKit/Source/core/style/FilterOperation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698