OffScreen invalidation logic
Posted: Fri Mar 27, 2020 9:09 am
Hi,
I used the code from the sample about offscreen rendering in my own controls. Bascially when the Resize comes, I change the buffer size, call WasResized and instantly Invalidate(PET_VIEW). It works more or less until some complex cases when, for example, two consecutive requests try to change some of the dimensions (Width:=; Height:=). The final result looks like the CEF didn't catch the second one so the rendering size looks like it did not catch the second size change. The sample CEF4 application about off-screen rendering on the other hand correctly works in similar cases but I found hard to grasp the complex logic behind several flags (FResizing, FPendingResize), reposting messages from the paint thread to repeat resize request and delaying calling Invalidate(PET_VIEW) until some good moment. I suspect that this has something to do with how CEF itself handles border cases so the CEF4 developers had to implement "not so easy to grasp" code. Can this be explained more clearly at least what objective this complex logic tries to reach?
Thanks
I used the code from the sample about offscreen rendering in my own controls. Bascially when the Resize comes, I change the buffer size, call WasResized and instantly Invalidate(PET_VIEW). It works more or less until some complex cases when, for example, two consecutive requests try to change some of the dimensions (Width:=; Height:=). The final result looks like the CEF didn't catch the second one so the rendering size looks like it did not catch the second size change. The sample CEF4 application about off-screen rendering on the other hand correctly works in similar cases but I found hard to grasp the complex logic behind several flags (FResizing, FPendingResize), reposting messages from the paint thread to repeat resize request and delaying calling Invalidate(PET_VIEW) until some good moment. I suspect that this has something to do with how CEF itself handles border cases so the CEF4 developers had to implement "not so easy to grasp" code. Can this be explained more clearly at least what objective this complex logic tries to reach?
Thanks