Re: Predict Off-screen Render Target Size
Posted: 16 Dec 2013, 08:36
That's sounds good solution for eliminating the runtime crashes.Anyway, our current implementation can be improved. For example:
Detect cases where the opacity is not needed and generate a warning in the log or even being smart and try to carry the opacity to the brush of the internal node. I would say this will eliminate a very high percentage of offscreen uses.
If there is not enough space in the offscreen texture instead of giving an error we could render the node without opacity with straight forward render. Although this will render the xaml incorrectly.
If all GUI states are know you can add an automatic test on the Build Tool that will try to render each element with all available states and compute the needed Offscreen space... not sure if it's possible.
In my case I've got the runtime crashes when I dynamically allocated Buttons and placed an Image in each of them. When I replaced the control to use simple ListBoxItem with TextBlocks and only one Image displayed at a time the errors were gone.