Pixmap XCreateBitmapFromData(Display* display, Drawable d, const char* data, unsigned int width, unsigned int height)
| 1681 | |
| 1682 | // Pixmap XCreateBitmapFromData(Display* display, Drawable d, const char* data, unsigned int width, unsigned int height) |
| 1683 | static 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) |
| 1702 | static void x11_FreePixmap(CPU* cpu) { |
nothing calls this directly
no test coverage detected