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

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

Issue 356123002: Consolidate some text shadow code. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rendererToUse -> renderer() Created 6 years, 6 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/ShadowList.h ('k') | Source/core/rendering/svg/SVGInlineTextBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/core/rendering/style/ShadowList.h ('k') | Source/core/rendering/svg/SVGInlineTextBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698