Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For regular apps the toolkit (Qt / GTK / GDI / Cocoa) handles it. They hide the inner bits of the underlying OS / Graphics API from the apps. Web nowadays is a very free-form environment coming with cross-platform APIs. Using platform specific API and toolkits will create inconsistencies and performance issues. So browsers come with their own rendering engines that uses lower level APIs like Directx and OpenGL. To access GPU video decoders etc., they also need to use those lower level APIs anyway.

Regardless of the OS, when the applications want to directly render things they have to communicate with the lower level graphics backend (Wayland, X, DWM, Metal etc) to agree on a memory area and pixel format and some other things. The OS, the direct rendering system and the window management system together manages what application gets the rendering signal, what area, at what display with what metadata (e.g. DPI, or pixel bits) it is drawn.

Since browsers are writing their rendering system and the components from scratch (not everything, they still use some system GUI components or text input / font rendering stuff), they need to communicate with the lower layer directly to request screen areas to render, to get the correct display DPI/scale to draw things at the correct size with well-aligned pixels and to utilize various hardware stuff like hardware video decoders.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: