MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / x11_CreateBitmapFromData

Function x11_CreateBitmapFromData

source/x11/x11common.cpp:1683–1699  ·  view source on GitHub ↗

Pixmap XCreateBitmapFromData(Display* display, Drawable d, const char* data, unsigned int width, unsigned int height)

Source from the content-addressed store, hash-verified

1681
1682// Pixmap XCreateBitmapFromData(Display* display, Drawable d, const char* data, unsigned int width, unsigned int height)
1683static void x11_CreateBitmapFromData(CPU* cpu) {
1684 KThread* thread = cpu->thread;
1685 XServer* server = XServer::getServer();
1686 XWindowPtr window = server->getWindow(ARG2); // even though it's a Drawable passed in, spec says it may be an InputOnly window
1687 U32 data = ARG3;
1688 U32 width = ARG4;
1689 U32 height = ARG5;
1690 XDrawablePtr d = server->getDrawable(ARG2);
1691 if (!d) {
1692 EAX = BadDrawable;
1693 return;
1694 }
1695
1696 std::shared_ptr<XPixmap> pixmap = server->createNewPixmap(width, height, window->getDepth(), d->getVisual());
1697 pixmap->copyImageData(thread, nullptr, data, pixmap->getBytesPerLine(), pixmap->getBitsPerPixel() , 0, 0, 0, 0, width, height);
1698 EAX = pixmap->id;
1699}
1700
1701// int XFreePixmap(Display* display, Pixmap pixmap)
1702static void x11_FreePixmap(CPU* cpu) {

Callers

nothing calls this directly

Calls 8

getWindowMethod · 0.80
getDrawableMethod · 0.80
createNewPixmapMethod · 0.80
getDepthMethod · 0.80
copyImageDataMethod · 0.80
getBytesPerLineMethod · 0.80
getBitsPerPixelMethod · 0.80
getVisualMethod · 0.45

Tested by

no test coverage detected