GRSurface* MinuiBackendFbdev::Init() {
android::base::unique_fd fd(open("/dev/graphics/fb0", O_RDWR | O_CLOEXEC)); if (fd == -1) {
perror("cannot open fb0"); return nullptr;
}
fb_fix_screeninfo fi; if (ioctl(fd, FBIOGET_FSCREENINFO, &fi) < 0) {
perror("failed to get fb0 info"); return nullptr;
}
if (ioctl(fd, FBIOGET_VSCREENINFO, &vi) < 0) {
perror("failed to get fb0 info"); return nullptr;
}
// We print this out for informational purposes only, but // throughout we assume that the framebuffer device uses an RGBX // pixel format. This is the case for every development device I // have access to. For some of those devices (eg, hammerhead aka // Nexus 5), FBIOGET_VSCREENINFO *reports* that it wants a // different format (XBGR) but actually produces the correct // results on the display when you write RGBX. // // If you have a device that actually *needs* another pixel format // (ie, BGRX, or 565), patches welcome...
// Without double-buffering, we allocate RAM for a buffer to draw in, and then "flipping" the // buffer consists of a memcpy from the buffer we allocated to the framebuffer.
memory_buffer.resize(gr_framebuffer[1]->height * gr_framebuffer[1]->row_bytes);
gr_framebuffer[1]->buffer_ = memory_buffer.data();
}
printf("framebuffer: %d (%zu x %zu)\n", fb_fd.get(), gr_draw->width, gr_draw->height);
Blank(false);
return gr_draw;
}
GRSurface* MinuiBackendFbdev::Flip() { if (double_buffered) { // Change gr_draw to point to the buffer currently displayed, then flip the driver so we're // displaying the other buffer instead.
gr_draw = gr_framebuffer[displayed_buffer].get();
SetDisplayedFramebuffer(1 - displayed_buffer);
} else { // Copy from the in-memory surface to the framebuffer.
memcpy(gr_framebuffer[0]->buffer_, gr_draw->buffer_, gr_draw->height * gr_draw->row_bytes);
} return gr_draw;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet am 2026-07-01)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.