Index: Source/core/rendering/style/ShadowList.cpp |
diff --git a/Source/core/rendering/style/ShadowList.cpp b/Source/core/rendering/style/ShadowList.cpp |
index b0f414a11625e102bff25bcee79eadca554c845c..9cb3ee94452e8d337c461db82bfc46eeee3f4c54 100644 |
--- a/Source/core/rendering/style/ShadowList.cpp |
+++ b/Source/core/rendering/style/ShadowList.cpp |
@@ -32,6 +32,7 @@ |
#include "core/rendering/style/ShadowList.h" |
#include "platform/geometry/FloatRect.h" |
+#include "wtf/OwnPtr.h" |
namespace WebCore { |
@@ -97,4 +98,18 @@ PassRefPtr<ShadowList> ShadowList::blend(const ShadowList* from, const ShadowLis |
return ShadowList::adopt(shadows); |
} |
+PassOwnPtr<DrawLooperBuilder> ShadowList::createDrawLooper(DrawLooperBuilder::ShadowAlphaMode alphaMode, bool isHorizontal) const |
+{ |
+ OwnPtr<DrawLooperBuilder> drawLooperBuilder = DrawLooperBuilder::create(); |
+ for (size_t i = shadows().size(); i--; ) { |
+ const ShadowData& shadow = shadows()[i]; |
+ float shadowX = isHorizontal ? shadow.x() : shadow.y(); |
+ float shadowY = isHorizontal ? shadow.y() : -shadow.x(); |
+ drawLooperBuilder->addShadow(FloatSize(shadowX, shadowY), shadow.blur(), shadow.color(), |
+ DrawLooperBuilder::ShadowRespectsTransforms, alphaMode); |
+ } |
+ drawLooperBuilder->addUnmodifiedContent(); |
+ return drawLooperBuilder.release(); |
+} |
+ |
} // namespace WebCore |