]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
FOP-2184: optimize inefficient position adjustment array allocation in non-CS path.
authorGlenn Adams <gadams@apache.org>
Sat, 12 Jan 2013 05:59:08 +0000 (05:59 +0000)
committerGlenn Adams <gadams@apache.org>
Sat, 12 Jan 2013 05:59:08 +0000 (05:59 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1432383 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/render/intermediate/IFRenderer.java
status.xml

index d1e2217c77f2c01de5f86772b4ed2e616f63e796..01adec08d92cca87dff56dfcbce6dffcdaeda465 100644 (file)
@@ -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) {
index ace670a022b94976c84968c91195488d54cd1d96..db0b5f688c6d60e3b4718e54288d90e3f8cdf28f 100644 (file)
@@ -59,6 +59,9 @@
       documents. Example: the fix of marks layering will be such a case when it's done.
     -->
     <release version="FOP Trunk" date="TBD">
+      <action context="Renderers" dev="GA" type="fix" fixes-bug="FOP-2184" due-to="Luis Bernardo">
+       Optimize inefficient position adjustment array allocation in non-CS path.
+      </action>
       <action context="Fonts" dev="PH" type="add" fixes-bug="FOP-2180" due-to="Alexey Neyman">
        TTFReader: Output bounding box information for glyphs. 
       </action>