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
911911 wcmd U.geometry "%d %d %d" w (stateh h) (FMTE.to_int conf.fitmodel)
912912 )
913913
914−let gctiles () =
914+let gctiles layout =
915915 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
919916 let rec loop qpos =
920917 if !S.memused > conf.memlimit
921918 then (
@@ -931,7 +928,7 @@ let gctiles () = · 9 unmodified lines
931928 && pageh = ph
932929 && (
933930 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
935932 )
936933 then Queue.push lruitem S.tilelru
937934 else (
@@ -1181,33 +1178,35 @@ let act cmds = · 243 unmodified lines
11811178 begin match !S.currently with
11821179 | Tiling (l, pageopaque, cs, angle, gen, col, row, tilew, tileh) ->
11831180 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
11841186 if tilew != conf.tilew || tileh != conf.tileh
11851187 then (
11861188 wcmd1 U.freetile opaque;
11871189 S.currently := Idle;
1188− load !S.layout;
1190+ load layout;
11891191 )
11901192 else (
11911193 puttileopaque l col row gen cs angle opaque size t;
11921194 S.memused := !S.memused + size;
11931195 !S.uioh#infochanged Memused;
1194− gctiles ();
1196+ gctiles layout;
11951197 Queue.push ((l.pageno, gen, cs, angle, l.pagew, l.pageh, col, row),
11961198 opaque, size) S.tilelru;
11971199
11981200 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
12041205
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
12111210 then Glutils.postRedisplay "tile nothrottle";
12121211 )
12131212

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