jdk/src/share/native/sun/font/layout/SinglePositioningSubtables.cpp
changeset 16891 91e99bed64ae
parent 5506 202f599c92aa
child 18256 79d3f8278a38
equal deleted inserted replaced
16890:36b30720a997 16891:91e99bed64ae
    38 #include "GlyphIterator.h"
    38 #include "GlyphIterator.h"
    39 #include "LESwaps.h"
    39 #include "LESwaps.h"
    40 
    40 
    41 U_NAMESPACE_BEGIN
    41 U_NAMESPACE_BEGIN
    42 
    42 
    43 le_uint32 SinglePositioningSubtable::process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const
    43 le_uint32 SinglePositioningSubtable::process(const LEReferenceTo<SinglePositioningSubtable> &base, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode &success) const
    44 {
    44 {
    45     switch(SWAPW(subtableFormat))
    45     switch(SWAPW(subtableFormat))
    46     {
    46     {
    47     case 0:
    47     case 0:
    48         return 0;
    48         return 0;
    49 
    49 
    50     case 1:
    50     case 1:
    51     {
    51     {
    52         const SinglePositioningFormat1Subtable *subtable = (const SinglePositioningFormat1Subtable *) this;
    52       const LEReferenceTo<SinglePositioningFormat1Subtable> subtable(base, success, (const SinglePositioningFormat1Subtable *) this);
    53 
    53 
    54         return subtable->process(glyphIterator, fontInstance);
    54       return subtable->process(subtable, glyphIterator, fontInstance, success);
    55     }
    55     }
    56 
    56 
    57     case 2:
    57     case 2:
    58     {
    58     {
    59         const SinglePositioningFormat2Subtable *subtable = (const SinglePositioningFormat2Subtable *) this;
    59       const LEReferenceTo<SinglePositioningFormat2Subtable> subtable(base, success, (const SinglePositioningFormat2Subtable *) this);
    60 
    60 
    61         return subtable->process(glyphIterator, fontInstance);
    61       return subtable->process(subtable, glyphIterator, fontInstance, success);
    62     }
    62     }
    63 
    63 
    64     default:
    64     default:
    65         return 0;
    65         return 0;
    66     }
    66     }
    67 }
    67 }
    68 
    68 
    69 le_uint32 SinglePositioningFormat1Subtable::process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const
    69 le_uint32 SinglePositioningFormat1Subtable::process(const LEReferenceTo<SinglePositioningFormat1Subtable> &base, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode &success) const
    70 {
    70 {
    71     LEGlyphID glyph = glyphIterator->getCurrGlyphID();
    71     LEGlyphID glyph = glyphIterator->getCurrGlyphID();
    72     le_int32 coverageIndex = getGlyphCoverage(glyph);
    72     le_int32 coverageIndex = getGlyphCoverage(base, glyph, success);
    73 
    73 
    74     if (coverageIndex >= 0) {
    74     if (coverageIndex >= 0) {
    75         valueRecord.adjustPosition(SWAPW(valueFormat), (const char *) this, *glyphIterator, fontInstance);
    75         valueRecord.adjustPosition(SWAPW(valueFormat), (const char *) this, *glyphIterator, fontInstance);
    76 
    76 
    77         return 1;
    77         return 1;
    78     }
    78     }
    79 
    79 
    80     return 0;
    80     return 0;
    81 }
    81 }
    82 
    82 
    83 le_uint32 SinglePositioningFormat2Subtable::process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const
    83 le_uint32 SinglePositioningFormat2Subtable::process(const LEReferenceTo<SinglePositioningFormat2Subtable> &base, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode &success) const
    84 {
    84 {
    85     LEGlyphID glyph = glyphIterator->getCurrGlyphID();
    85     LEGlyphID glyph = glyphIterator->getCurrGlyphID();
    86     le_int16 coverageIndex = (le_int16) getGlyphCoverage(glyph);
    86     le_int16 coverageIndex = (le_int16) getGlyphCoverage(base, glyph, success);
    87 
    87 
    88     if (coverageIndex >= 0) {
    88     if (coverageIndex >= 0) {
    89         valueRecordArray[0].adjustPosition(coverageIndex, SWAPW(valueFormat), (const char *) this, *glyphIterator, fontInstance);
    89         valueRecordArray[0].adjustPosition(coverageIndex, SWAPW(valueFormat), (const char *) this, *glyphIterator, fontInstance);
    90 
    90 
    91         return 1;
    91         return 1;