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

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: all working! Created 7 years, 1 month 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/InlineTextBox.cpp
diff --git a/Source/core/rendering/InlineTextBox.cpp b/Source/core/rendering/InlineTextBox.cpp
index 6c9a772632123e6dc5cbd28d298d74cd46ee1854..38ab8592c91d002052b3a4446a9941c96dded0b7 100644
--- a/Source/core/rendering/InlineTextBox.cpp
+++ b/Source/core/rendering/InlineTextBox.cpp
@@ -402,8 +402,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();
+ LayoutUnit shadowX = horizontal ? shadow.x() : shadow.y();
+ LayoutUnit shadowY = horizontal ? shadow.y() : -shadow.x();
FloatSize offset(shadowX, shadowY);
drawLooper.addShadow(offset, shadow.blur(), renderer->resolveColor(shadow.color()),
DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowIgnoresAlpha);
@@ -1097,18 +1097,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;
+ LayoutUnit 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();
+ LayoutUnit shadowX = isHorizontal() ? s.x() : s.y();
+ LayoutUnit 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(LayoutUnit(0), shadowY) + s.blur());
}
context->clip(clipRect);
extraOffset += baseline + 2;
@@ -1124,8 +1124,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();
+ LayoutUnit shadowX = isHorizontal() ? shadow.x() : shadow.y();
+ LayoutUnit shadowY = isHorizontal() ? shadow.y() : -shadow.x();
context->setShadow(FloatSize(shadowX, shadowY - extraOffset), shadow.blur(), shadow.color());
}

Powered by Google App Engine
This is Rietveld 408576698