> On Nov. 23, 2015, 7:13 a.m., Martin Gräßlin wrote: > > are you sure it means that? I mean I did read the documentation when > > writing that code and did deliberately wrote the code like that. So I'm a > > little bit surprised that I got it exactly the other way around. > > David Edmundson wrote: > How do you interpret: > "The texture object owns the texture id and will delete the GL texture > when the texture object is deleted." ? > > > Docs aside, relevant Qt code is: > > QSGTexture *QSGEngine::createTextureFromId(uint id, const QSize &size, > CreateTextureOptions options) const > { > Q_D(const QSGEngine); > if (d->sgRenderContext->isValid()) { > QSGPlainTexture *texture = new QSGPlainTexture(); > texture->setTextureId(id); > texture->setHasAlphaChannel(options & TextureHasAlphaChannel); > texture->setOwnsTexture(options & TextureOwnsGLTexture); > texture->setTextureSize(size); > return texture; > } > return 0; > } > > > QSGPlainTexture::~QSGPlainTexture() > if (m_texture_id && m_owns_texture && > QOpenGLContext::currentContext()) > > QOpenGLContext::currentContext()->functions()->glDeleteTextures(1, > &m_texture_id); > > Martin Gräßlin wrote: > given the code in plasma-framework, I'm quite certain that I didn't want > Qt to take over ownership of it. So I think we should turn it around and make > our code do what was intended. I just checked and we do proper cleanup > handling. discardPixmap is called from the dtor, so if we do cleanup, why > should Qt?
>why should Qt? Because you told it to :P but sure, that works too. Will make new RR. - David ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/126131/#review88703 ----------------------------------------------------------- On Nov. 22, 2015, 1:57 a.m., David Edmundson wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://git.reviewboard.kde.org/r/126131/ > ----------------------------------------------------------- > > (Updated Nov. 22, 2015, 1:57 a.m.) > > > Review request for KDE Frameworks and Plasma. > > > Repository: plasma-framework > > > Description > ------- > > The QSGTextures are created with > > window()->createTextureFromId(m_texture, QSize(w,h), > QuickWindow::TextureOwnsGLTexture)); > > this means we don't want to be deleting textures ourselves too, it will > be deleted when we delete the QSGTexture, which is a scoped pointer > inside our QSGNode. > > BUG: 355644 > REVIEW: > > > Diffs > ----- > > src/declarativeimports/core/windowthumbnail.cpp > 2b09657e8ce6bd1cca1acc323d5955b2f1a1efb2 > > Diff: https://git.reviewboard.kde.org/r/126131/diff/ > > > Testing > ------- > > > Thanks, > > David Edmundson > >
_______________________________________________ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel