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

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

Issue 23241010: Support subpixel values for text-shadow and box-shadow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: addressed review comments Created 6 years, 11 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/EllipsisBox.cpp ('k') | Source/core/rendering/RenderBoxModelObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/InlineTextBox.cpp
diff --git a/Source/core/rendering/InlineTextBox.cpp b/Source/core/rendering/InlineTextBox.cpp
index d0e71728d552b90b19a436e65d7430df1970323f..f1b3130a36aed07caf1c23680bfae34ecaa641fd 100644
--- a/Source/core/rendering/InlineTextBox.cpp
+++ b/Source/core/rendering/InlineTextBox.cpp
@@ -400,8 +400,8 @@ static void paintTextWithShadows(GraphicsContext* context,
DrawLooper drawLooper;
for (size_t i = shadowList->shadows().size(); i--; ) {
const ShadowData& shadow = shadowList->shadows()[i];
- int shadowX = horizontal ? shadow.x() : shadow.y();
- int shadowY = horizontal ? shadow.y() : -shadow.x();
+ float shadowX = horizontal ? shadow.x() : shadow.y();
+ float shadowY = horizontal ? shadow.y() : -shadow.x();
FloatSize offset(shadowX, shadowY);
drawLooper.addShadow(offset, shadow.blur(), renderer->resolveColor(shadow.color()),
DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowIgnoresAlpha);
@@ -1087,18 +1087,18 @@ void InlineTextBox::paintDecoration(GraphicsContext* context, const FloatPoint&
const float textDecorationThickness = std::max(1.f, styleToUse->computedFontSize() / 10.f);
context->setStrokeThickness(textDecorationThickness);
- int extraOffset = 0;
+ float extraOffset = 0;
if (!linesAreOpaque && shadowCount > 1) {
FloatRect clipRect(localOrigin, FloatSize(width, baseline + 2));
for (size_t i = shadowCount; i--; ) {
const ShadowData& s = shadowList->shadows()[i];
FloatRect shadowRect(localOrigin, FloatSize(width, baseline + 2));
shadowRect.inflate(s.blur());
- int shadowX = isHorizontal() ? s.x() : s.y();
- int shadowY = isHorizontal() ? s.y() : -s.x();
+ float shadowX = isHorizontal() ? s.x() : s.y();
+ float shadowY = isHorizontal() ? s.y() : -s.x();
shadowRect.move(shadowX, shadowY);
clipRect.unite(shadowRect);
- extraOffset = max(extraOffset, max(0, shadowY) + s.blur());
+ extraOffset = max(extraOffset, max(0.0f, shadowY) + s.blur());
}
context->clip(clipRect);
extraOffset += baseline + 2;
@@ -1114,8 +1114,8 @@ void InlineTextBox::paintDecoration(GraphicsContext* context, const FloatPoint&
extraOffset = 0;
}
const ShadowData& shadow = shadowList->shadows()[i];
- int shadowX = isHorizontal() ? shadow.x() : shadow.y();
- int shadowY = isHorizontal() ? shadow.y() : -shadow.x();
+ float shadowX = isHorizontal() ? shadow.x() : shadow.y();
+ float shadowY = isHorizontal() ? shadow.y() : -shadow.x();
context->setShadow(FloatSize(shadowX, shadowY - extraOffset), shadow.blur(), shadow.color());
}
« no previous file with comments | « Source/core/rendering/EllipsisBox.cpp ('k') | Source/core/rendering/RenderBoxModelObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698