diff options
author | Glenn Adams <gadams@apache.org> | 2013-01-12 05:59:08 +0000 |
---|---|---|
committer | Glenn Adams <gadams@apache.org> | 2013-01-12 05:59:08 +0000 |
commit | 35926f02b2498910d7fa80d7ca7076c278334ad2 (patch) | |
tree | f8237a64e56d0521770c1c45c8e837620261acae /src/java/org/apache | |
parent | 011ebc8f8050fb9a51e227e1d7be85f4f62f6a77 (diff) | |
download | xmlgraphics-fop-35926f02b2498910d7fa80d7ca7076c278334ad2.tar.gz xmlgraphics-fop-35926f02b2498910d7fa80d7ca7076c278334ad2.zip |
FOP-2184: optimize inefficient position adjustment array allocation in non-CS path.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1432383 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache')
-rw-r--r-- | src/java/org/apache/fop/render/intermediate/IFRenderer.java | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/src/java/org/apache/fop/render/intermediate/IFRenderer.java b/src/java/org/apache/fop/render/intermediate/IFRenderer.java index d1e2217c7..01adec08d 100644 --- a/src/java/org/apache/fop/render/intermediate/IFRenderer.java +++ b/src/java/org/apache/fop/render/intermediate/IFRenderer.java @@ -1048,12 +1048,16 @@ public class IFRenderer extends AbstractPathOrientedRenderer { int[][] dp = word.getGlyphPositionAdjustments(); if ( dp == null ) { - dp = IFUtil.convertDXToDP ( word.getLetterAdjustArray() ); + renderTextWithAdjustments(s, word.getLetterAdjustArray(), word.isReversed(), + font, (AbstractTextArea)word.getParentArea()); + } else if ( IFUtil.isDPOnlyDX ( dp ) ) { + renderTextWithAdjustments(s, IFUtil.convertDPToDX ( dp ), word.isReversed(), + font, (AbstractTextArea)word.getParentArea()); + } else { + renderTextWithAdjustments(s, dp, word.isReversed(), + font, (AbstractTextArea)word.getParentArea()); } - renderText(s, dp, word.isReversed(), - font, (AbstractTextArea)word.getParentArea()); - super.renderWord(word); } @@ -1063,7 +1067,7 @@ public class IFRenderer extends AbstractPathOrientedRenderer { String s = space.getSpace(); AbstractTextArea textArea = (AbstractTextArea)space.getParentArea(); - renderText(s, null, false, font, textArea); + renderTextWithAdjustments(s, (int[]) null, false, font, textArea); if (textUtil.combined && space.isAdjustable()) { //Used for justified text, for example @@ -1076,17 +1080,6 @@ public class IFRenderer extends AbstractPathOrientedRenderer { super.renderSpace(space); } - private void renderText(String s, - int[][] dp, boolean reversed, - Font font, AbstractTextArea parentArea) { - if ( ( dp == null ) || IFUtil.isDPOnlyDX ( dp ) ) { - int[] dx = IFUtil.convertDPToDX ( dp ); - renderTextWithAdjustments ( s, dx, reversed, font, parentArea ); - } else { - renderTextWithAdjustments ( s, dp, reversed, font, parentArea ); - } - } - /** * Does low-level rendering of text using DX only position adjustments. * @param s text to render @@ -1154,12 +1147,14 @@ public class IFRenderer extends AbstractPathOrientedRenderer { } void adjust(int dx) { - adjust ( new int[] { - dx, // xPlaAdjust - 0, // yPlaAdjust - dx, // xAdvAdjust - 0 // yAdvAdjust - } ); + if (dx != 0) { + adjust ( new int[] { + dx, // xPlaAdjust + 0, // yPlaAdjust + dx, // xAdvAdjust + 0 // yAdvAdjust + } ); + } } void adjust(int[] pa) { |