Commit dba6293
committed
Make the Core Text renderer faster
This change reworks `MMCoreTextView` to keep track of the state of the
screen instead of drawing to the screen or to an image. This lets
`drawRect:` draw any part of the view at any time, as needed.
This change came about when the old strategy stopped working: The old
strategy calls `drawRect:` for the entire view to handle any draw
command from the backend, but drew only the changes on top of the old
content of the view. This did not work in new versions of macOS that use
layers, because `drawRect:` is now expected to fill the entire rect with
new content. If it doesn't, the rest of the view will just contain
garbage. bbad3ed worked around this
issue by adding an intermediate CGImage which was preserved between
draws. This fixed the problem but made rendering slower.
With the change, the intermediate image is no longer needed and
rendering is much faster overall, which resolves #796.
As part of this change, font substitution is now handled by Core Text,
which changes which fallback fonts are used in some cases but matches
other macOS apps.1 parent 96a68b5 commit dba6293
14 files changed
Lines changed: 430 additions & 1218 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
252 | | - | |
253 | 251 | | |
254 | 252 | | |
255 | 253 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | 34 | | |
37 | 35 | | |
38 | 36 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
55 | 40 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | 41 | | |
71 | 42 | | |
72 | 43 | | |
| |||
113 | 84 | | |
114 | 85 | | |
115 | 86 | | |
116 | | - | |
117 | | - | |
118 | 87 | | |
119 | 88 | | |
120 | 89 | | |
121 | 90 | | |
122 | | - | |
123 | 91 | | |
124 | 92 | | |
125 | 93 | | |
| |||
0 commit comments