commit-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commit-cp] classpath ChangeLog gnu/java/awt/peer/gtk/Freet...


From: Sven de Marothy
Subject: [commit-cp] classpath ChangeLog gnu/java/awt/peer/gtk/Freet...
Date: Sun, 11 Jun 2006 03:09:03 +0000

CVSROOT:        /sources/classpath
Module name:    classpath
Changes by:     Sven de Marothy <smarothy>      06/06/11 03:09:03

Modified files:
        .              : ChangeLog 
        gnu/java/awt/peer/gtk: FreetypeGlyphVector.java 
        java/awt/font  : TextLayout.java 

Log message:
        2006-06-11  Sven de Marothy  <address@hidden>
        
                * java/awt/font/TextLayout.java
                (getLogicalHighlightShape): Add check.
                * gnu/java/awt/peer/gtk/FreetypeGlyphVector.java
                (getLogicalBounds, getGlyphPositions): Cache bounds, positions.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&r1=1.7764&r2=1.7765
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/java/awt/peer/gtk/FreetypeGlyphVector.java?cvsroot=classpath&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/classpath/java/awt/font/TextLayout.java?cvsroot=classpath&r1=1.9&r2=1.10

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/classpath/classpath/ChangeLog,v
retrieving revision 1.7764
retrieving revision 1.7765
diff -u -b -r1.7764 -r1.7765
--- ChangeLog   11 Jun 2006 00:05:10 -0000      1.7764
+++ ChangeLog   11 Jun 2006 03:09:02 -0000      1.7765
@@ -1,3 +1,10 @@
+2006-06-11  Sven de Marothy  <address@hidden>
+
+       * java/awt/font/TextLayout.java
+       (getLogicalHighlightShape): Add check.
+       * gnu/java/awt/peer/gtk/FreetypeGlyphVector.java
+       (getLogicalBounds, getGlyphPositions): Cache bounds, positions.
+
 2006-06-11  Raif S. Naffah  <address@hidden>
 
        * gnu/javax/security/auth/login/ConfigFileParser.java 
(validateClassName):

Index: gnu/java/awt/peer/gtk/FreetypeGlyphVector.java
===================================================================
RCS file: 
/sources/classpath/classpath/gnu/java/awt/peer/gtk/FreetypeGlyphVector.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- gnu/java/awt/peer/gtk/FreetypeGlyphVector.java      9 Jun 2006 20:23:55 
-0000       1.4
+++ gnu/java/awt/peer/gtk/FreetypeGlyphVector.java      11 Jun 2006 03:09:03 
-0000      1.5
@@ -56,6 +56,9 @@
   private Font font;
   private GdkFontPeer peer; // ATTN: Accessed from native code.
 
+  private Rectangle2D logicalBounds;
+
+  private float[] glyphPositions;
   /**
    * The string represented by this GlyphVector.
    */
@@ -203,6 +206,9 @@
    */
   public void performDefaultLayout()
   {
+    logicalBounds = null; // invalidate caches.
+    glyphPositions = null;
+
     whiteSpace = new boolean[ nGlyphs ]; 
     glyphTransforms = new AffineTransform[ nGlyphs ]; 
     double x = 0;
@@ -303,6 +309,9 @@
   public float[] getGlyphPositions(int beginGlyphIndex, int numEntries, 
                                   float[] positionReturn)
   {
+    if( glyphPositions != null )
+      return glyphPositions;
+
     float[] rval;
 
     if( positionReturn == null )
@@ -317,6 +326,7 @@
        rval[i * 2 + 1] = (float)p.getY();
       }
 
+    glyphPositions = rval;
     return rval;
   }
 
@@ -344,6 +354,8 @@
   {
     if( nGlyphs == 0 )
       return new Rectangle2D.Double(0, 0, 0, 0);
+    if( logicalBounds != null )
+      return logicalBounds;
 
     Rectangle2D rect = (Rectangle2D)getGlyphLogicalBounds( 0 );
     for( int i = 1; i < nGlyphs; i++ )
@@ -354,6 +366,7 @@
        rect = rect.createUnion( r2 );
       }
 
+    logicalBounds = rect;
     return rect;
   }
 
@@ -413,6 +426,8 @@
     // FIXME: Scaling, etc.?
     glyphTransforms[ glyphIndex ].setToTranslation( newPos.getX(), 
                                                    newPos.getY() );
+    logicalBounds = null;
+    glyphPositions = null;
   }
 
   /**
@@ -421,5 +436,7 @@
   public void setGlyphTransform(int glyphIndex, AffineTransform newTX)
   {
     glyphTransforms[ glyphIndex ].setTransform( newTX );
+    logicalBounds = null;
+    glyphPositions = null;
   }
 }

Index: java/awt/font/TextLayout.java
===================================================================
RCS file: /sources/classpath/classpath/java/awt/font/TextLayout.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- java/awt/font/TextLayout.java       9 Jun 2006 20:48:02 -0000       1.9
+++ java/awt/font/TextLayout.java       11 Jun 2006 03:09:03 -0000      1.10
@@ -391,6 +391,7 @@
     double advance = 0;
 
     // go to first run
+    if( i > 0 )
     while( runIndices[i + 1][1] < firstEndpoint ) 
       {
        advance += runs[i].getLogicalBounds().getWidth();




reply via email to

[Prev in Thread] Current Thread [Next in Thread]