Unofficial Hacker News companion — get notified on comment replies, and more.

Show HN: Pryzmera – Fast PDF viewer fully rendering on the GPU (opens external site)

170 points by RedMindZ 2 days ago pryzmera.com 69 comments (opens Hacker News) Vote (opens Hacker News)

View full thread · View on Hacker News

Comment thread (1)

  1. When a page gets interpreted, the small jobs that are generated also extract text from the page, which is later collected and combined to produce both a search index and a spatial index. The search index can answer text-search queries in time that is basically linear to the total number of matches, and the spatial index can answer queries like "is there a glyph at these coordinates?" and "what is the closest glyph to these coordinates?" in logarithmic time. In addition, the quads that bound each glyph are also stored in order to generate highlights over text, for example when selecting text. So while triangles are used for rendering, there are additional data structures that store the required data for interacting with the document, and those are processed on the CPU.