Changeset View
Changeset View
Standalone View
Standalone View
components/ImageDataItem.cpp
Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Line(s) | 68 | { | |||
---|---|---|---|---|---|
75 | 75 | | |||
76 | auto texNode = static_cast<QSGSimpleTextureNode*>(node); | 76 | auto texNode = static_cast<QSGSimpleTextureNode*>(node); | ||
77 | if(!texNode) { | 77 | if(!texNode) { | ||
78 | texNode = new QSGSimpleTextureNode{}; | 78 | texNode = new QSGSimpleTextureNode{}; | ||
79 | } | 79 | } | ||
80 | texNode->setRect(0, 0, w, h); | 80 | texNode->setRect(0, 0, w, h); | ||
81 | 81 | | |||
82 | auto texture = window()->createTextureFromImage(d->data); | 82 | auto texture = window()->createTextureFromImage(d->data); | ||
83 | if(texNode->texture()) { | | |||
84 | delete texNode->texture(); | 83 | delete texNode->texture(); | ||
85 | } | | |||
86 | texNode->setTexture(texture); | 84 | texNode->setTexture(texture); | ||
87 | 85 | | |||
88 | return texNode; | 86 | return texNode; | ||
89 | } | 87 | } |