This bug has me running for cover, without a clue why the code enters vicious render/throw-away cycle. For the time being this band-aid will do.
Unified · Split
| @@ -911,11 +911,8 @@ let reshape ?(firsttime=false) w h = · 910 unmodified lines | ||
| 911 | 911 | wcmd U.geometry "%d %d %d" w (stateh h) (FMTE.to_int conf.fitmodel) |
| 912 | 912 | ) |
| 913 | 913 | |
| 914 | −let gctiles () = | |
| 914 | +let gctiles layout = | |
| 915 | 915 | let len = Queue.length S.tilelru in |
| 916 | − let layout = lazy (if conf.preload | |
| 917 | − then preloadlayout !S.x !S.y !S.winw !S.winh | |
| 918 | − else !S.layout) in | |
| 919 | 916 | let rec loop qpos = |
| 920 | 917 | if !S.memused > conf.memlimit |
| 921 | 918 | then ( |
| @@ -931,7 +928,7 @@ let gctiles () = · 9 unmodified lines | ||
| 931 | 928 | && pageh = ph |
| 932 | 929 | && ( |
| 933 | 930 | let x = col*conf.tilew and y = row*conf.tileh in |
| 934 | − tilevisible (Lazy.force_val layout) n x y | |
| 931 | + tilevisible layout n x y | |
| 935 | 932 | ) |
| 936 | 933 | then Queue.push lruitem S.tilelru |
| 937 | 934 | else ( |
| @@ -1181,33 +1178,35 @@ let act cmds = · 243 unmodified lines | ||
| 1181 | 1178 | begin match !S.currently with |
| 1182 | 1179 | | Tiling (l, pageopaque, cs, angle, gen, col, row, tilew, tileh) -> |
| 1183 | 1180 | vlog "tile %d [%d,%d] took %f sec" l.pageno col row t; |
| 1181 | + let layout = | |
| 1182 | + if conf.preload | |
| 1183 | + then preloadlayout !S.x !S.y !S.winw !S.winh | |
| 1184 | + else !S.layout | |
| 1185 | + in | |
| 1184 | 1186 | if tilew != conf.tilew || tileh != conf.tileh |
| 1185 | 1187 | then ( |
| 1186 | 1188 | wcmd1 U.freetile opaque; |
| 1187 | 1189 | S.currently := Idle; |
| 1188 | − load !S.layout; | |
| 1190 | + load layout; | |
| 1189 | 1191 | ) |
| 1190 | 1192 | else ( |
| 1191 | 1193 | puttileopaque l col row gen cs angle opaque size t; |
| 1192 | 1194 | S.memused := !S.memused + size; |
| 1193 | 1195 | !S.uioh#infochanged Memused; |
| 1194 | − gctiles (); | |
| 1196 | + gctiles layout; | |
| 1195 | 1197 | Queue.push ((l.pageno, gen, cs, angle, l.pagew, l.pageh, col, row), |
| 1196 | 1198 | opaque, size) S.tilelru; |
| 1197 | 1199 | |
| 1198 | 1200 | S.currently := Idle; |
| 1199 | − if gen = !S.gen | |
| 1200 | − && conf.colorspace = cs | |
| 1201 | − && conf.angle = angle | |
| 1202 | − && tilevisible !S.layout l.pageno x y | |
| 1203 | − then conttiling l.pageno pageopaque; | |
| 1201 | + let visible = tilevisible layout l.pageno x y in | |
| 1202 | + let cont = gen = !S.gen && conf.colorspace = cs | |
| 1203 | + && conf.angle = angle && visible | |
| 1204 | + in | |
| 1204 | 1205 | |
| 1205 | − preload !S.layout; | |
| 1206 | − if gen = !S.gen | |
| 1207 | − && conf.colorspace = cs | |
| 1208 | − && conf.angle = angle | |
| 1209 | − && tilevisible !S.layout l.pageno x y | |
| 1210 | − && layoutready !S.layout | |
| 1206 | + if cont | |
| 1207 | + then conttiling l.pageno pageopaque; | |
| 1208 | + preload layout; | |
| 1209 | + if cont && layoutready layout | |
| 1211 | 1210 | then Glutils.postRedisplay "tile nothrottle"; |
| 1212 | 1211 | ) |
| 1213 | 1212 | |