protected GlyphTester ignoreMark;
/** default ignore glyph tester */
protected GlyphTester ignoreDefault;
+ /** current subtable */
+ private GlyphSubtable subtable;
/**
* Construct glyph processing state.
* @param st glyph subtable to use for update
*/
public void updateSubtableState ( GlyphSubtable st ) {
- setGDEF ( st.getGDEF() );
- setLookupFlags ( st.getFlags() );
- setIgnoreDefault ( getIgnoreTester ( getLookupFlags() ) );
- }
-
- /**
- * Reset glyph subtable specific state.
- */
- public void resetSubtableState() {
- setGDEF ( null );
- setLookupFlags ( 0 );
- setIgnoreDefault ( null );
+ if ( this.subtable != st ) {
+ setGDEF ( st.getGDEF() );
+ setLookupFlags ( st.getFlags() );
+ setIgnoreDefault ( getIgnoreTester ( getLookupFlags() ) );
+ this.subtable = st;
+ }
}
/**
*/
public static class LookupTable implements Comparable {
- private final String id; // lookup identifiers
+ private final String id; // lookup identifier
+ private final int idOrdinal; // parsed lookup identifier ordinal
private final List/*<GlyphSubtable>*/ subtables; // list of subtables
private boolean doesSub; // performs substitutions
private boolean doesPos; // performs positioning
public LookupTable ( String id, List/*<GlyphSubtable>*/ subtables ) {
assert id != null;
assert id.length() != 0;
+ assert id.startsWith ( "lu" );
this.id = id;
+ this.idOrdinal = Integer.parseInt ( id.substring ( 2 ) );
this.subtables = new LinkedList/*<GlyphSubtable>*/();
if ( subtables != null ) {
for ( Iterator it = subtables.iterator(); it.hasNext(); ) {
}
}
- /** @return the identifier */
- public String getId() {
- return id;
- }
-
/** @return the subtables as an array */
public GlyphSubtable[] getSubtables() {
if ( frozen ) {
/** {@inheritDoc} */
public int hashCode() {
- return id.hashCode();
+ return idOrdinal;
}
/**
public boolean equals ( Object o ) {
if ( o instanceof LookupTable ) {
LookupTable lt = (LookupTable) o;
- return id.equals ( lt.id );
+ return idOrdinal == lt.idOrdinal;
} else {
return false;
}
public int compareTo ( Object o ) {
if ( o instanceof LookupTable ) {
LookupTable lt = (LookupTable) o;
- assert id.startsWith ( "lu" );
- int i = Integer.parseInt ( id.substring ( 2 ) );
- assert lt.id.startsWith ( "lu" );
- int j = Integer.parseInt ( lt.id.substring ( 2 ) );
+ int i = idOrdinal;
+ int j = lt.idOrdinal;
if ( i < j ) {
return -1;
} else if ( i > j ) {
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-2186">
+ Optimize inefficient glyph processing state update operations in CS path.
+ </action>
<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>