History

Paper over preloading issue

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.

malc committed 4 years ago

Commit ae2e5a91 parent cef17441 file · +17 −18Browse files

Unified · Split

main.ml+17−18
@@ -911,11 +911,8 @@ let reshape ?(firsttime=false) w h = · 910 unmodified lines
911 wcmd U.geometry "%d %d %d" w (stateh h) (FMTE.to_int conf.fitmodel)911 wcmd U.geometry "%d %d %d" w (stateh h) (FMTE.to_int conf.fitmodel)
912 )912 )
913 913
914let gctiles () =914let gctiles layout =
915 let len = Queue.length S.tilelru in915 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 let rec loop qpos =916 let rec loop qpos =
920 if !S.memused > conf.memlimit917 if !S.memused > conf.memlimit
921 then (918 then (
@@ -931,7 +928,7 @@ let gctiles () = · 9 unmodified lines
931 && pageh = ph928 && pageh = ph
932 && (929 && (
933 let x = col*conf.tilew and y = row*conf.tileh in930 let x = col*conf.tilew and y = row*conf.tileh in
934 tilevisible (Lazy.force_val layout) n x y931 tilevisible layout n x y
935 )932 )
936 then Queue.push lruitem S.tilelru933 then Queue.push lruitem S.tilelru
937 else (934 else (
@@ -1181,33 +1178,35 @@ let act cmds = · 243 unmodified lines
1181 begin match !S.currently with1178 begin match !S.currently with
1182 | Tiling (l, pageopaque, cs, angle, gen, col, row, tilew, tileh) ->1179 | Tiling (l, pageopaque, cs, angle, gen, col, row, tilew, tileh) ->
1183 vlog "tile %d [%d,%d] took %f sec" l.pageno col row t;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 if tilew != conf.tilew || tileh != conf.tileh1186 if tilew != conf.tilew || tileh != conf.tileh
1185 then (1187 then (
1186 wcmd1 U.freetile opaque;1188 wcmd1 U.freetile opaque;
1187 S.currently := Idle;1189 S.currently := Idle;
1188 load !S.layout;1190 load layout;
1189 )1191 )
1190 else (1192 else (
1191 puttileopaque l col row gen cs angle opaque size t;1193 puttileopaque l col row gen cs angle opaque size t;
1192 S.memused := !S.memused + size;1194 S.memused := !S.memused + size;
1193 !S.uioh#infochanged Memused;1195 !S.uioh#infochanged Memused;
1194 gctiles ();1196 gctiles layout;
1195 Queue.push ((l.pageno, gen, cs, angle, l.pagew, l.pageh, col, row),1197 Queue.push ((l.pageno, gen, cs, angle, l.pagew, l.pageh, col, row),
1196 opaque, size) S.tilelru;1198 opaque, size) S.tilelru;
1197 1199
1198 S.currently := Idle;1200 S.currently := Idle;
1199 if gen = !S.gen1201 let visible = tilevisible layout l.pageno x y in
1200 && conf.colorspace = cs1202 let cont = gen = !S.gen && conf.colorspace = cs
1201 && conf.angle = angle1203 && conf.angle = angle && visible
1202 && tilevisible !S.layout l.pageno x y1204 in
1203 then conttiling l.pageno pageopaque;
1204 1205
1205 preload !S.layout;1206 if cont
1206 if gen = !S.gen1207 then conttiling l.pageno pageopaque;
1207 && conf.colorspace = cs1208 preload layout;
1208 && conf.angle = angle1209 if cont && layoutready layout
1209 && tilevisible !S.layout l.pageno x y
1210 && layoutready !S.layout
1211 then Glutils.postRedisplay "tile nothrottle";1210 then Glutils.postRedisplay "tile nothrottle";
1212 )1211 )
1213 1212

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t