[wesnoth-commits] [wesnoth/wesnoth] f282eb: Render only a viewport area in pango_text and text...

Steve Cotton noreply at github.com
Sat May 8 21:02:10 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: f282eb79483db8f463e5e87eca47e5334afa4e93
      https://github.com/wesnoth/wesnoth/commit/f282eb79483db8f463e5e87eca47e5334afa4e93
  Author: Steve Cotton <steve at octalot.co.uk>
  Date:   2021-05-08 (Sat, 08 May 2021)

  Changed paths:
    M changelog.md
    M src/font/text.cpp
    M src/font/text.hpp
    M src/gui/core/canvas.cpp

  Log Message:
  -----------
  Render only a viewport area in pango_text and text_shape

The line-by-line workaround for rendering huge areas of text is dropped, as we
now only expect to be rendering screen-sized or smaller parts of the text.

Rendering huge texts (greater than 64kpixels high) now requires the caller of
pango_text::render() to change to calling pango_text::render(SDL_Rect) instead.
This is used by text_shape, fixing the crash when opening the credits screen.

This should reduce memory usage when rendering text. It doesn't seem to reduce
the amount of work done by Pango, but the drawing will be clipped in the Cairo
library.





More information about the Commits mailing list