Do not detach when getting a readonly reference
This commit is contained in:
parent
b8a355252d
commit
f4adff66cc
1 changed files with 3 additions and 3 deletions
|
@ -538,20 +538,20 @@ void AbstractEglTexture::createTextureSubImage(const QImage &image, const QRegio
|
|||
const QImage im = image.convertToFormat(QImage::Format_ARGB32_Premultiplied);
|
||||
for (const QRect &rect : damage) {
|
||||
glTexSubImage2D(m_target, 0, rect.x(), rect.y(), rect.width(), rect.height(),
|
||||
GL_BGRA_EXT, GL_UNSIGNED_BYTE, im.copy(rect).bits());
|
||||
GL_BGRA_EXT, GL_UNSIGNED_BYTE, im.copy(rect).constBits());
|
||||
}
|
||||
} else {
|
||||
const QImage im = image.convertToFormat(QImage::Format_RGBA8888_Premultiplied);
|
||||
for (const QRect &rect : damage) {
|
||||
glTexSubImage2D(m_target, 0, rect.x(), rect.y(), rect.width(), rect.height(),
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, im.copy(rect).bits());
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, im.copy(rect).constBits());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const QImage im = image.convertToFormat(QImage::Format_ARGB32_Premultiplied);
|
||||
for (const QRect &rect : damage) {
|
||||
glTexSubImage2D(m_target, 0, rect.x(), rect.y(), rect.width(), rect.height(),
|
||||
GL_BGRA, GL_UNSIGNED_BYTE, im.copy(rect).bits());
|
||||
GL_BGRA, GL_UNSIGNED_BYTE, im.copy(rect).constBits());
|
||||
}
|
||||
}
|
||||
q->unbind();
|
||||
|
|
Loading…
Reference in a new issue