Diff
Modified: trunk/LayoutTests/ChangeLog (90867 => 90868)
--- trunk/LayoutTests/ChangeLog 2011-07-12 23:32:48 UTC (rev 90867)
+++ trunk/LayoutTests/ChangeLog 2011-07-12 23:37:58 UTC (rev 90868)
@@ -1,3 +1,16 @@
+2011-07-12 Kenichi Ishibashi <[email protected]>
+
+ [Chromium] SVG text is not rendered sometimes with geometricPrecision
+ https://bugs.webkit.org/show_bug.cgi?id=64341
+
+ Add a test for the regression that the text is not rendered with geometricPrecision.
+
+ Reviewed by Tony Chang.
+
+ * platform/chromium-linux/svg/text/text-with-geometric-precision-expected.png: Added.
+ * platform/chromium-linux/svg/text/text-with-geometric-precision-expected.txt: Added.
+ * platform/chromium-linux/svg/text/text-with-geometric-precision.svg: Added.
+
2011-07-12 Alexandru Chiculita <[email protected]>
Reviewed by David Hyatt.
Added: trunk/LayoutTests/platform/chromium-linux/svg/text/text-with-geometric-precision-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/platform/chromium-linux/svg/text/text-with-geometric-precision-expected.png
___________________________________________________________________
Added: svn:mime-type
Added: trunk/LayoutTests/platform/chromium-linux/svg/text/text-with-geometric-precision-expected.txt (0 => 90868)
--- trunk/LayoutTests/platform/chromium-linux/svg/text/text-with-geometric-precision-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/chromium-linux/svg/text/text-with-geometric-precision-expected.txt 2011-07-12 23:37:58 UTC (rev 90868)
@@ -0,0 +1,26 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderSVGRoot {svg} at (20,5) size 287x119
+ RenderSVGText {text} at (0,-15) size 287x19 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 287x19
+ chunk 1 text run 1 at (0.00,0.00) startOffset 0 endOffset 49 width 287.00: "\"super\" in the following text should be rendered."
+ RenderSVGText {text} at (0,-25) size 100x39 contains 1 chunk(s)
+ RenderSVGTSpan {tspan} at (0,0) size 46x19
+ RenderSVGInlineText {#text} at (0,10) size 46x19
+ chunk 1 text run 1 at (0.00,0.00) startOffset 0 endOffset 6 width 46.00: "Normal"
+ RenderSVGTSpan {tspan} at (0,0) size 33x20
+ RenderSVGInlineText {#text} at (46,0) size 33x20
+ chunk 1 text run 1 at (46.00,-9.50) startOffset 0 endOffset 5 width 33.00: "super"
+ RenderSVGTSpan {tspan} at (0,0) size 21x20
+ RenderSVGInlineText {#text} at (79,19) size 21x20
+ chunk 1 text run 1 at (79.00,9.50) startOffset 0 endOffset 3 width 21.00: "sub"
+ RenderSVGInlineText {#text} at (0,0) size 0x0
+ RenderSVGText {text} at (0,-16) size 79x20 contains 1 chunk(s)
+ RenderSVGTSpan {tspan} at (0,0) size 46x19
+ RenderSVGInlineText {#text} at (0,1) size 46x19
+ chunk 1 text run 1 at (0.00,0.00) startOffset 0 endOffset 6 width 46.00: "Normal"
+ RenderSVGTSpan {tspan} at (0,0) size 33x20
+ RenderSVGInlineText {#text} at (46,0) size 33x20
+ chunk 1 text run 1 at (46.00,-0.80) startOffset 0 endOffset 5 width 33.00: "super"
+ RenderSVGInlineText {#text} at (0,0) size 0x0
Property changes on: trunk/LayoutTests/platform/chromium-linux/svg/text/text-with-geometric-precision-expected.txt
___________________________________________________________________
Added: svn:eol-style
Added: trunk/LayoutTests/platform/chromium-linux/svg/text/text-with-geometric-precision.svg (0 => 90868)
--- trunk/LayoutTests/platform/chromium-linux/svg/text/text-with-geometric-precision.svg (rev 0)
+++ trunk/LayoutTests/platform/chromium-linux/svg/text/text-with-geometric-precision.svg 2011-07-12 23:37:58 UTC (rev 90868)
@@ -0,0 +1,9 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <text transform="translate(20 20)">"super" in the following text should be rendered.</text>
+ <text transform="translate(20 70)" text-rendering="geometricPrecision">
+ <tspan>Normal</tspan><tspan baseline-shift="super">super</tspan><tspan baseline-shift="sub">sub</tspan>
+ </text>
+ <text transform="translate(20 120)" text-rendering="geometricPrecision">
+ <tspan>Normal</tspan><tspan y="-0.8">super</tspan>
+ </text>
+</svg>
Modified: trunk/Source/WebCore/ChangeLog (90867 => 90868)
--- trunk/Source/WebCore/ChangeLog 2011-07-12 23:32:48 UTC (rev 90867)
+++ trunk/Source/WebCore/ChangeLog 2011-07-12 23:37:58 UTC (rev 90868)
@@ -1,3 +1,19 @@
+2011-07-12 Kenichi Ishibashi <[email protected]>
+
+ [Chromium] SVG text is not rendered sometimes with geometricPrecision
+ https://bugs.webkit.org/show_bug.cgi?id=64341
+
+ Changing the type of x and y offsets of ComplexTextControllerLinux to make it possible to treat negative offsets.
+
+ Reviewed by Tony Chang.
+
+ Test: platform/chromium-linux/svg/text/text-with-geometric-precision.svg
+
+ * platform/graphics/chromium/ComplexTextControllerLinux.cpp: Changed the type of m_offsetX and m_startingY from unsigned to int.
+ (WebCore::ComplexTextController::ComplexTextController): Changed the type of the argument.
+ (WebCore::ComplexTextController::reset): Ditto.
+ * platform/graphics/chromium/ComplexTextControllerLinux.h:
+
2011-07-12 Alexandru Chiculita <[email protected]>
Reviewed by David Hyatt.
Modified: trunk/Source/WebCore/platform/graphics/chromium/ComplexTextControllerLinux.cpp (90867 => 90868)
--- trunk/Source/WebCore/platform/graphics/chromium/ComplexTextControllerLinux.cpp 2011-07-12 23:32:48 UTC (rev 90867)
+++ trunk/Source/WebCore/platform/graphics/chromium/ComplexTextControllerLinux.cpp 2011-07-12 23:37:58 UTC (rev 90868)
@@ -51,7 +51,7 @@
return value >> 6;
}
-ComplexTextController::ComplexTextController(const TextRun& run, unsigned startingX, unsigned startingY, unsigned wordSpacing, unsigned letterSpacing, unsigned padding, const Font* font)
+ComplexTextController::ComplexTextController(const TextRun& run, int startingX, int startingY, unsigned wordSpacing, unsigned letterSpacing, unsigned padding, const Font* font)
: m_font(font)
, m_run(getNormalizedTextRun(run, m_normalizedRun, m_normalizedBuffer))
{
@@ -142,7 +142,7 @@
m_padPerWordBreak = 0;
}
-void ComplexTextController::reset(unsigned offset)
+void ComplexTextController::reset(int offset)
{
m_indexOfNextScriptRun = 0;
m_offsetX = offset;
Modified: trunk/Source/WebCore/platform/graphics/chromium/ComplexTextControllerLinux.h (90867 => 90868)
--- trunk/Source/WebCore/platform/graphics/chromium/ComplexTextControllerLinux.h 2011-07-12 23:32:48 UTC (rev 90867)
+++ trunk/Source/WebCore/platform/graphics/chromium/ComplexTextControllerLinux.h 2011-07-12 23:37:58 UTC (rev 90868)
@@ -65,7 +65,7 @@
// can call |reset| to start over again.
class ComplexTextController {
public:
- ComplexTextController(const TextRun&, unsigned startingX, unsigned startingY, unsigned wordSpacing, unsigned letterSpacing, unsigned padding, const Font*);
+ ComplexTextController(const TextRun&, int startingX, int startingY, unsigned wordSpacing, unsigned letterSpacing, unsigned padding, const Font*);
~ComplexTextController();
bool isWordBreak(unsigned);
@@ -73,7 +73,7 @@
// setPadding sets a number of pixels to be distributed across the TextRun.
// WebKit uses this to justify text.
void setPadding(int);
- void reset(unsigned offset);
+ void reset(int offset);
// Advance to the next script run, returning false when the end of the
// TextRun has been reached.
bool nextScriptRun();
@@ -137,8 +137,8 @@
uint16_t* m_glyphs16; // A vector of 16-bit glyph ids.
SkPoint* m_positions; // A vector of positions for each glyph.
ssize_t m_indexOfNextScriptRun; // Indexes the script run in |m_run|.
- unsigned m_offsetX; // Offset in pixels to the start of the next script run.
- unsigned m_startingY; // The Y starting point of the script run.
+ int m_offsetX; // Offset in pixels to the start of the next script run.
+ int m_startingY; // The Y starting point of the script run.
unsigned m_pixelWidth; // Width (in px) of the current script run.
unsigned m_glyphsArrayCapacity; // Current size of all the Harfbuzz arrays.