summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering/SVGRootInlineBox.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-04-27 16:31:00 +0100
committerSteve Block <steveblock@google.com>2010-05-11 14:42:12 +0100
commitdcc8cf2e65d1aa555cce12431a16547e66b469ee (patch)
tree92a8d65cd5383bca9749f5327fb5e440563926e6 /WebCore/rendering/SVGRootInlineBox.cpp
parentccac38a6b48843126402088a309597e682f40fe6 (diff)
downloadexternal_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.zip
external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.gz
external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.bz2
Merge webkit.org at r58033 : Initial merge by git
Change-Id: If006c38561af287c50cd578d251629b51e4d8cd1
Diffstat (limited to 'WebCore/rendering/SVGRootInlineBox.cpp')
-rw-r--r--WebCore/rendering/SVGRootInlineBox.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/WebCore/rendering/SVGRootInlineBox.cpp b/WebCore/rendering/SVGRootInlineBox.cpp
index 03b9db4..89b4375 100644
--- a/WebCore/rendering/SVGRootInlineBox.cpp
+++ b/WebCore/rendering/SVGRootInlineBox.cpp
@@ -28,9 +28,11 @@
#include "SVGRootInlineBox.h"
#include "Editor.h"
+#include "FloatConversion.h"
#include "Frame.h"
#include "GraphicsContext.h"
#include "RenderBlock.h"
+#include "RenderSVGResourceFilter.h"
#include "RenderSVGRoot.h"
#include "SVGInlineFlowBox.h"
#include "SVGInlineTextBox.h"
@@ -38,7 +40,6 @@
#include "SVGPaintServer.h"
#include "SVGRenderStyleDefs.h"
#include "SVGRenderSupport.h"
-#include "SVGResourceFilter.h"
#include "SVGTextPositioningElement.h"
#include "SVGURIReference.h"
#include "Text.h"
@@ -336,7 +337,7 @@ static float calculateKerning(RenderObject* item)
// Helper class for paint()
struct SVGRootInlineBoxPaintWalker {
- SVGRootInlineBoxPaintWalker(SVGRootInlineBox* rootBox, SVGResourceFilter* rootFilter, RenderObject::PaintInfo paintInfo, int tx, int ty)
+ SVGRootInlineBoxPaintWalker(SVGRootInlineBox* rootBox, RenderSVGResourceFilter* rootFilter, RenderObject::PaintInfo paintInfo, int tx, int ty)
: m_rootBox(rootBox)
, m_chunkStarted(false)
, m_paintInfo(paintInfo)
@@ -668,8 +669,8 @@ private:
RenderObject::PaintInfo m_savedInfo;
FloatRect m_boundingBox;
- SVGResourceFilter* m_filter;
- SVGResourceFilter* m_rootFilter;
+ RenderSVGResourceFilter* m_filter;
+ RenderSVGResourceFilter* m_rootFilter;
SVGPaintServer* m_fillPaintServer;
SVGPaintServer* m_strokePaintServer;
@@ -691,7 +692,7 @@ void SVGRootInlineBox::paint(RenderObject::PaintInfo& paintInfo, int tx, int ty)
RenderObject::PaintInfo savedInfo(paintInfo);
paintInfo.context->save();
- SVGResourceFilter* filter = 0;
+ RenderSVGResourceFilter* filter = 0;
FloatRect boundingBox(tx + x(), ty + y(), width(), height());
// Initialize text rendering
@@ -1413,7 +1414,7 @@ void SVGRootInlineBox::buildLayoutInformationForTextBox(SVGCharacterLayoutInfo&
}
}
- double kerning = 0.0;
+ float kerning = 0.0f;
#if ENABLE(SVG_FONTS)
SVGFontElement* svgFont = 0;
if (style->font().isSVGFont())
@@ -1422,25 +1423,26 @@ void SVGRootInlineBox::buildLayoutInformationForTextBox(SVGCharacterLayoutInfo&
if (lastGlyph.isValid && style->font().isSVGFont()) {
SVGHorizontalKerningPair kerningPair;
if (svgFont->getHorizontalKerningPairForStringsAndGlyphs(lastGlyph.unicode, lastGlyph.glyphName, unicodeStr, glyphName, kerningPair))
- kerning = kerningPair.kerning;
+ kerning = narrowPrecisionToFloat(kerningPair.kerning);
}
if (style->font().isSVGFont()) {
lastGlyph.unicode = unicodeStr;
lastGlyph.glyphName = glyphName;
lastGlyph.isValid = true;
+ kerning *= style->font().size() / style->font().primaryFont()->unitsPerEm();
} else
lastGlyph.isValid = false;
#endif
- svgChar.x -= (float)kerning;
+ svgChar.x -= kerning;
// Advance to new position
if (isVerticalText) {
svgChar.drawnSeperated = true;
info.cury += glyphAdvance + spacing;
} else
- info.curx += glyphAdvance + spacing - (float)kerning;
+ info.curx += glyphAdvance + spacing - kerning;
// Advance to next character group
for (int k = 0; k < charsConsumed; ++k) {