From: <sil...@li...> - 2005-08-24 18:14:19
|
Update of /cvsroot/silgraphite/silgraphite/src/GrEngine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3005/src/GrEngine Modified Files: GrSlotState.cpp GrSlotState.h GrSlotStream.cpp GrSlotStream.h Log Message: Replaced bug fix of June 2005; replaced removal of unnecessary gr:: in UtilString.h Index: GrSlotState.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrSlotState.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- GrSlotState.cpp 10 Jun 2005 16:36:56 -0000 1.18 +++ GrSlotState.cpp 24 Aug 2005 18:14:10 -0000 1.19 @@ -761,6 +761,7 @@ else { Assert(m_fShiftMod); + EnsureLocalAttachmentTree(ptman, psstrmIn, psstrmOut, islotThis); ZapMetricsAndPositionDownToBase(psstrmOut); ZapMetricsOfLeaves(psstrmOut); } @@ -777,6 +778,26 @@ } /*---------------------------------------------------------------------------------------------- + The shift attribute of a slot has been modified. Make sure any slots that are part of the + same attachment cluster are local to this stream. The reason for this is so that the + position calculations stay consistent within the stream. +----------------------------------------------------------------------------------------------*/ +void GrSlotState::EnsureLocalAttachmentTree(GrTableManager * ptman, + GrSlotStream * psstrmIn, GrSlotStream * psstrmOut, int islotThis) +{ + if (m_dislotRootFixed) + { + GrSlotState * pslotRoot = SlotAtOffset(psstrmOut, m_dislotRootFixed); + psstrmOut->EnsureLocalCopy(ptman, pslotRoot, psstrmIn); + } + for (size_t islot = 0; islot < m_vdislotAttLeaves.size(); islot++) + { + GrSlotState * pslotLeaf = SlotAtOffset(psstrmOut, m_vdislotAttLeaves[islot]); + psstrmOut->EnsureLocalCopy(ptman, pslotLeaf, psstrmIn); + } +} + +/*---------------------------------------------------------------------------------------------- The recipient slot is being attached to the argument slot. NOTE: the caller is responsible to zap the cached positions of following glyphs in the stream. Index: GrSlotState.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrSlotState.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- GrSlotState.h 12 Aug 2005 11:25:44 -0000 1.17 +++ GrSlotState.h 24 Aug 2005 18:14:10 -0000 1.18 @@ -949,6 +949,9 @@ GrSlotState * SlotAtOffset(GrSlotStream * psstrm, int dislot); // ENHANCE SharonC: inline? + void EnsureLocalAttachmentTree(GrTableManager * ptman, + GrSlotStream * psstrmIn, GrSlotStream * psstrmOut, int islotThis); + void ZapCompositeMetrics() { m_nCompositeLevel = kNegInfinity; Index: GrSlotStream.cpp =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrSlotStream.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- GrSlotStream.cpp 4 Aug 2005 10:31:45 -0000 1.21 +++ GrSlotStream.cpp 24 Aug 2005 18:14:10 -0000 1.22 @@ -1463,6 +1463,44 @@ } /*---------------------------------------------------------------------------------------------- + Make sure the stream contains a local instance of the given slot, not a copy used by + a previous pass. +----------------------------------------------------------------------------------------------*/ +void GrSlotStream::EnsureLocalCopy(GrTableManager * ptman, GrSlotState * pslot, + GrSlotStream * psstrmIn) +{ + //Assert(m_vpslot[islot + m_cslotPreSeg] == pslot); + Assert(pslot->PassModified() <= m_ipass); + + if (pslot->PassModified() < m_ipass) + { + int islot = pslot->PosPassIndex(); + Assert(SlotAtPosPassIndex(islot) == pslot); + GrSlotState * pslotNew; + ptman->State()->NewSlotCopy(pslot, m_ipass, &pslotNew); + m_vpslot[islot + m_cslotPreSeg] = pslotNew; + + psstrmIn->ReplaceSlotInReprocessBuffer(pslot, pslotNew); + } +} + +/*---------------------------------------------------------------------------------------------- + A slot has been replace within the coorsponding output stream. Make sure the reprocess + buffer of this stream constains the same slot. +----------------------------------------------------------------------------------------------*/ +void GrSlotStream::ReplaceSlotInReprocessBuffer(GrSlotState * pslotOld, GrSlotState * pslotNew) +{ + if (m_islotReprocPos > -1) + { + for (size_t islot = 0; islot < m_vpslotReproc.size(); islot++) + { + if (m_vpslotReproc[islot] == pslotOld) + m_vpslotReproc[islot] = pslotNew; + } + } +} + +/*---------------------------------------------------------------------------------------------- Inserting a line break can potentially alter the directionality of preceeding glyphs. Zap the information that has been calculated. Index: GrSlotStream.h =================================================================== RCS file: /cvsroot/silgraphite/silgraphite/src/GrEngine/GrSlotStream.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- GrSlotStream.h 10 Jun 2005 16:36:57 -0000 1.14 +++ GrSlotStream.h 24 Aug 2005 18:14:10 -0000 1.15 @@ -356,6 +356,9 @@ void AdjustPrevStreamNextChunkMap(GrTableManager * ptman, int islotMod, int nInc); void AdjustNextChunkMap(int islotMin, int islotMod, int nInc); + void EnsureLocalCopy(GrTableManager * ptman, GrSlotState * pslot, GrSlotStream * psstrmIn); + void ReplaceSlotInReprocessBuffer(GrSlotState * pslotOld, GrSlotState * pslotNew); + void ZapCalculatedDirLevels(int islotLB); int MaxClusterSlot(int islotChunkLim) |