Commit e3be9585 authored by abmyii's avatar abmyii
Browse files

Use std::memcpy

parent 82386df3
Pipeline #225004886 failed with stage
in 2 minutes and 45 seconds
......@@ -91,7 +91,7 @@ void shutdown(int)
running = 0;
}
void read_pixels(int bpp, GLenum format, mir::geometry::Size const& size, void* fb)
void read_pixels(int bpp, GLenum format, mir::geometry::Size const& size, void *fb)
{
auto width = size.width.as_uint32_t();
auto height = size.height.as_uint32_t();
......@@ -111,9 +111,7 @@ void read_pixels(int bpp, GLenum format, mir::geometry::Size const& size, void*
image = image.transformed(matrix);
}
// Copy image data to FB (https://forum.qt.io/topic/92641/converting-a-qimage-to-a-qbytearray-and-convert-it-back-into-an-image/8)
memcpy(fb, reinterpret_cast<unsigned char *>(image.bits()), image.byteCount());
std::memcpy(fb, (const char *)image.constBits(), image.byteCount());
#ifdef DEBUG
unsigned int sum = 0;
unsigned int *pui = (unsigned int *) buffer;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment