MantisBT - VTK
View Issue Details
0015603VTK(No Category)public2015-07-29 08:232016-08-12 09:55
Marc Ruiz 
Kitware Robot 
normalminorhave not tried
closedmoved 
6.1.0 
 
TBD
performance
0015603: Slow text rendering with vtkCornerAnnotation and big windows
Hi, I'm the developer of a medical viewer that uses vtkCornerAnnotation to display image-related information in the corners of the window. I have found that updating the text for each frame is slow when the window is very big, like for example in a 5 MPixel medical display.

With the default vtkTextRenderer implementation in the vtkRenderingFreeType module, when the window is very big, vtkCornerAnnotation updates take a considerable amount of time, to the point of making the application very laggy when scrolling through images. I have tried to limit the text size to a small number, but even then with a big window text rendering is slow and with a small window it's fast, so it's not directly related to text size. In comparison, the old ftgl approach in the vtkRenderingFreeTypeOpenGL module is instantaneous no matter the window size.

A profiler points to vtkFreeTypeTools::RenderCharacter() as the hotspot, but according to David Lonie's answer in the mailing list[1], the real issue may be in vtkCornerAnnotation::RenderOpaqueGeometry(), which has two loops that resize the text repeatedly to decide the best size.

Possible improvements: "At the very least the initial fontsize should be able to be set, and at best this class should be refactored to use newer text renderering APIs like vtkTextRenderer::GetBoundingBox, which won't actually generate a texture but just compute the dimensions of the resulting image."

[1] http://public.kitware.com/pipermail/vtkusers/2015-July/091690.html [^]
No tags attached.
Issue History
2015-07-29 08:23Marc RuizNew Issue
2016-08-12 09:55Kitware RobotNote Added: 0037405
2016-08-12 09:55Kitware RobotStatusbacklog => closed
2016-08-12 09:55Kitware RobotResolutionopen => moved
2016-08-12 09:55Kitware RobotAssigned To => Kitware Robot

Notes
(0037405)
Kitware Robot   
2016-08-12 09:55   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.