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

Unified Diff: Source/core/rendering/EllipsisBox.cpp

Issue 177473003: Use SkLayerDrawLooper::Builder to construct SkLayerDrawLooper. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove DrawLooper. Created 6 years, 10 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: Source/core/rendering/EllipsisBox.cpp
diff --git a/Source/core/rendering/EllipsisBox.cpp b/Source/core/rendering/EllipsisBox.cpp
index cd35c3d2e88526bc17797c4b35d4f48bf62abffe..8ea7709f5f4e2b665fee2e272d5470cb75dca14e 100644
--- a/Source/core/rendering/EllipsisBox.cpp
+++ b/Source/core/rendering/EllipsisBox.cpp
@@ -27,7 +27,7 @@
#include "core/rendering/RootInlineBox.h"
#include "core/rendering/style/ShadowList.h"
#include "platform/fonts/Font.h"
-#include "platform/graphics/DrawLooper.h"
+#include "platform/graphics/DrawLooperBuilder.h"
#include "platform/graphics/GraphicsContextStateSaver.h"
#include "platform/text/TextRun.h"
@@ -67,17 +67,17 @@ void EllipsisBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, La
const ShadowList* shadowList = context->printing() ? 0 : style->textShadow();
bool hasShadow = shadowList;
if (hasShadow) {
- DrawLooper drawLooper;
+ OwnPtr<DrawLooperBuilder> drawLooperBuilder = adoptPtr(new DrawLooperBuilder);
jbroman 2014/02/26 19:46:09 nit suggestion: to avoid adoptPtr(...) everywhere,
Dominik Grewe 2014/02/27 12:15:09 Done.
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);
- drawLooper.addShadow(offset, shadow.blur(), shadow.color(),
- DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowIgnoresAlpha);
+ drawLooperBuilder->addShadow(offset, shadow.blur(), shadow.color(),
+ DrawLooperBuilder::ShadowRespectsTransforms, DrawLooperBuilder::ShadowIgnoresAlpha);
}
- drawLooper.addUnmodifiedContent();
- context->setDrawLooper(drawLooper);
+ drawLooperBuilder->addUnmodifiedContent();
+ context->setDrawLooper(drawLooperBuilder.release());
}
TextRun textRun = RenderBlockFlow::constructTextRun(renderer(), font, m_str, style, TextRun::AllowTrailingExpansion);

Powered by Google App Engine
This is Rietveld 408576698