[Qt][Texmap] Do not create a texture if it will not be used.
Created attachment 90215 [details] Patch
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] Patch 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. > Source/WebCore/ChangeLog:14 > + No new tests required as no functionaliry changes. Typo. > Source/WebCore/platform/graphics/texmap/TextureMapperNode.h:176 > + inline bool shouldBePainted() const I think we should have a more descriptive name - what about haveContent() ?
Created attachment 91281 [details] Patch haveContent() looks better! thx.
Comment on attachment 91281 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=91281&action=review > Source/WebCore/platform/graphics/texmap/TextureMapperNode.h:176 > + inline bool haveContent() const it should be named hasContent, or something better and more descriptive.
Created attachment 91417 [details] Fixed Fixed. I didn't find a better name.
Comment on attachment 91417 [details] Fixed View in context: https://bugs.webkit.org/attachment.cgi?id=91417&action=review > Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp:859 > + 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