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

Unified Diff: Source/core/rendering/EllipsisBox.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 | « no previous file | Source/core/rendering/InlineTextBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/EllipsisBox.cpp
diff --git a/Source/core/rendering/EllipsisBox.cpp b/Source/core/rendering/EllipsisBox.cpp
index 9f3e0262827d12d6660dfb49e18ad54df0dab8f1..29b8daa536919d0e3f8847955fa480926c7b0338 100644
--- a/Source/core/rendering/EllipsisBox.cpp
+++ b/Source/core/rendering/EllipsisBox.cpp
@@ -27,7 +27,6 @@
#include "core/rendering/RootInlineBox.h"
#include "core/rendering/style/ShadowList.h"
#include "platform/fonts/Font.h"
-#include "platform/graphics/DrawLooperBuilder.h"
#include "platform/graphics/GraphicsContextStateSaver.h"
#include "platform/text/TextRun.h"
@@ -65,19 +64,8 @@ void EllipsisBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, La
// Text shadows are disabled when printing. http://crbug.com/258321
const ShadowList* shadowList = context->printing() ? 0 : style->textShadow();
bool hasShadow = shadowList;
- if (hasShadow) {
- OwnPtr<DrawLooperBuilder> drawLooperBuilder = DrawLooperBuilder::create();
- for (size_t i = shadowList->shadows().size(); i--; ) {
- const ShadowData& shadow = shadowList->shadows()[i];
- float shadowX = isHorizontal() ? shadow.x() : shadow.y();
- float shadowY = isHorizontal() ? shadow.y() : -shadow.x();
- FloatSize offset(shadowX, shadowY);
- drawLooperBuilder->addShadow(offset, shadow.blur(), shadow.color(),
- DrawLooperBuilder::ShadowRespectsTransforms, DrawLooperBuilder::ShadowIgnoresAlpha);
- }
- drawLooperBuilder->addUnmodifiedContent();
- context->setDrawLooper(drawLooperBuilder.release());
- }
+ if (hasShadow)
+ context->setDrawLooper(shadowList->createDrawLooper(DrawLooperBuilder::ShadowIgnoresAlpha, isHorizontal()));
TextRun textRun = RenderBlockFlow::constructTextRun(&renderer(), font, m_str, style, TextRun::AllowTrailingExpansion);
TextRunPaintInfo textRunPaintInfo(textRun);
« no previous file with comments | « no previous file | Source/core/rendering/InlineTextBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698