rename layoutready to alltilesrendered as this is what the funciton returns
Unified · Split
| @@ -514,7 +514,7 @@ let preload pages = · 513 unmodified lines | |||
| 514 | if conf.preload && !S.currently = Idle | 514 | if conf.preload && !S.currently = Idle |
| 515 | then load (preloadlayout !S.x !S.y !S.winw !S.winh) | 515 | then load (preloadlayout !S.x !S.y !S.winw !S.winh) |
| 516 | 516 | ||
| 517 | let layoutready layout = | 517 | let alltilesrendered layout = |
| 518 | let exception E in | 518 | let exception E in |
| 519 | let rec fold ls = | 519 | let rec fold ls = |
| 520 | match ls with | 520 | match ls with |
| @@ -1160,8 +1160,8 @@ let act cmds = · 639 unmodified lines | |||
| 1160 | | Textentry _ -> () | 1160 | | Textentry _ -> () |
| 1161 | ); | 1161 | ); |
| 1162 | 1162 | ||
| 1163 | if visible && layoutready !S.layout | 1163 | if visible && alltilesrendered !S.layout |
| 1164 | then Glutils.postRedisplay "page"; | 1164 | then assert false (* Glutils.postRedisplay "page"; *) |
| 1165 | ) | 1165 | ) |
| 1166 | 1166 | ||
| 1167 | | Idle | Tiling _ | Outlining _ -> | 1167 | | Idle | Tiling _ | Outlining _ -> |
| @@ -1171,6 +1171,18 @@ let act cmds = · 3 unmodified lines | |||
| 1171 | end | 1171 | end |
| 1172 | 1172 | ||
| 1173 | | "tile" , args -> | 1173 | | "tile" , args -> |
| 1174 | (* | ||
| 1175 | C part is notifying us that it has finished redering a tile | ||
| 1176 | valid = the tile fits current config (i.e. the settings with which | ||
| 1177 | the tile has been rendered match current ones) | ||
| 1178 | |||
| 1179 | if the tile is not valid free it and issue loading/rendering commands | ||
| 1180 | for the current layout | ||
| 1181 | |||
| 1182 | evict all the tiles that aren't part of preloadlayout | ||
| 1183 | if tile is visible post redisplay | ||
| 1184 | continue tiling | ||
| 1185 | *) | ||
| 1174 | let (x, y, opaques, size, t) = | 1186 | let (x, y, opaques, size, t) = |
| 1175 | scan args "%u %u %s %u %f" (fun x y p size t -> (x, y, p, size, t)) | 1187 | scan args "%u %u %s %u %f" (fun x y p size t -> (x, y, p, size, t)) |
| 1176 | in | 1188 | in |
| @@ -1179,7 +1191,7 @@ let act cmds = · 2 unmodified lines | |||
| 1179 | | Tiling (l, pageopaque, cs, angle, gen, col, row, tilew, tileh) -> | 1191 | | Tiling (l, pageopaque, cs, angle, gen, col, row, tilew, tileh) -> |
| 1180 | vlog "tile %d [%d,%d] took %f sec" l.pageno col row t; | 1192 | vlog "tile %d [%d,%d] took %f sec" l.pageno col row t; |
| 1181 | let layout = | 1193 | let layout = |
| 1182 | if conf.preload && layoutready !S.layout | 1194 | if conf.preload && alltilesrendered !S.layout |
| 1183 | then preloadlayout !S.x !S.y !S.winw !S.winh | 1195 | then preloadlayout !S.x !S.y !S.winw !S.winh |
| 1184 | else !S.layout | 1196 | else !S.layout |
| 1185 | in | 1197 | in |
| @@ -3929,7 +3941,7 @@ let display () = · 2743 unmodified lines | |||
| 3929 | match !S.reload with | 3941 | match !S.reload with |
| 3930 | | Some (x, y, t) -> | 3942 | | Some (x, y, t) -> |
| 3931 | if x != !S.x || y != !S.y || abs_float @@ now () -. t > 0.5 | 3943 | if x != !S.x || y != !S.y || abs_float @@ now () -. t > 0.5 |
| 3932 | || (!S.layout != [] && layoutready !S.layout) | 3944 | || (!S.layout != [] && alltilesrendered !S.layout) |
| 3933 | then ( | 3945 | then ( |
| 3934 | S.reload := None; | 3946 | S.reload := None; |
| 3935 | display () | 3947 | display () |