Code review comment for lp://qastaging/~dandrader/qtmir/textureCleanUp-lp1499388

Revision history for this message
Gerry Boland (gerboland) wrote :

It looks strange to me that the MirSurface API needs methods to both get a shared pointer to the texture, and a "weak" pointer. Your solution indicates there are times MirSurfaceItem need to take shared ownership of a texture, and there are times MirSurfaceItem needs to peek to see what the current texture actually is.

But instead of peeking for every frame to check if the MirSurface backing texture matches the one the textureProvider is holding though, wouldn't it just be easier to set the texture each and every frame? Something like:

     if (!m_textureProvider) {
         m_textureProvider = new MirTextureProvider(m_surface->texture());
- } else if (!m_textureProvider->texture()) {
- m_textureProvider->setTexture(m_surface->texture());
     }
+ m_textureProvider->setTexture(m_surface->texture());
 }

(P.S. I've noticed that QSGTextureProvider has a textureChanged signal we're not emitting, might that have an impact at all?)

review: Needs Information

« Back to merge proposal