On Jun 7, 2010, at 4:18 PM, [email protected] wrote:

> My question is can we optimize this flow somehow? Can we re-use the 
> TextBreakIterator in the render text class when performing the 
> RenderText::positionForPoint() function?
>  

That's what the ICU implementation does.  I think you just need to fix your 
implementation to do the same.  If you want to push the re-use higher you could 
probably make cursorMovementIterator cross-platform and then have it contain 
the static pointer to the reused iterator.  Then the existing 
cursorMovementIterator could be renamed and be called by the new cross-platform 
function.   However you could also just fix your implementation of 
cursorMovementIterator to reuse the iterator.

static bool createdCursorMovementIterator = false;
static TextBreakIterator* staticCursorMovementIterator;
return setUpIteratorWithRules(createdCursorMovementIterator, 
staticCursorMovementIterator, kRules, string, length);

dave
([email protected])


_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to