D10250: track the validity of the texture

Kai Uwe Broulik noreply at phabricator.kde.org
Fri Feb 2 15:47:25 UTC 2018


broulik added inline comments.

INLINE COMMENTS

> managedtexturenode.cpp:42
> +{
> +    if (s_d.contains(this)) {
> +        delete s_d[this];

`delete s_d.take(this);`

> managedtexturenode.cpp:50
> +{
> +    if (s_d.contains(this)) {
> +        return s_d[this];

auto *d = s_d.value(this);
  if (!d) {
      d = new ManagedTextureNodePrivate();
      s_d.insert(this, d);
  }
  return d;

> managedtexturenode.cpp:68
> +{
> +    return d_ptr()->textureTracker;
> +}

Can you perhaps prevent creation of the `ManagedTextureNodePrivate` for this check? `d_ptr()` would create it just to then see that its `textureTracker` is `null`. (Might be worth profiling, though)

REPOSITORY
  R296 KDeclarative

REVISION DETAIL
  https://phabricator.kde.org/D10250

To: mart, #plasma
Cc: broulik, ngraham, plasma-devel, #frameworks, michaelh, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180202/b3cc97d0/attachment.html>


More information about the Kde-frameworks-devel mailing list