[Qt][Texmap] Do not create a texture if it will not be used.
Created attachment 90215 [details]
Currently, all TextureMapperNodes create it's own texture even if the texture will not be used.
A lot of memory is being wasted due to this.
Whether a TextureMapperNode will be painted or not is determined in the sync-phase, before a texture is created. So, do not create a texture if it is not really needed.
Comment on attachment 90215 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=90215&action=review
Overall change looks good, r- to fix the typo and change come up with a better function name.
> + No new tests required as no functionaliry changes.
> + inline bool shouldBePainted() const
I think we should have a more descriptive name - what about haveContent() ?
Created attachment 91281 [details]
haveContent() looks better! thx.
Comment on attachment 91281 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=91281&action=review
> + inline bool haveContent() const
it should be named hasContent, or something better and more descriptive.
Created attachment 91417 [details]
Fixed. I didn't find a better name.
Comment on attachment 91417 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=91417&action=review
> + if (m_state.dirty && hasContent())
I'm wondering if that check should be done before. Why entering here if anyway there is nothing to render?
This problem is resolved by https://bugs.webkit.org/show_bug.cgi?id=60439