SOLVED

Which one is better? Skia API as the graphics API or OpenGL ES

%3CLINGO-SUB%20id%3D%22lingo-sub-1260220%22%20slang%3D%22en-US%22%3EWhich%20one%20is%20better%3F%20Skia%20API%20as%20the%20graphics%20API%20or%20OpenGL%20ES%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1260220%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20looking%20for%20pros%20and%20cons%20of%20each%20API%2C%20because%20Edge%20Canary%20version%26nbsp%3B%3CSPAN%3E83.0.467.0%20has%20a%20new%20flag%20called%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%20class%3D%22flex%22%3E%3CH3%20id%3D%22toc-hId-1115721814%22%20id%3D%22toc-hId-1115721816%22%20id%3D%22toc-hId-1115721816%22%20id%3D%22toc-hId-1115721816%22%20id%3D%22toc-hId-1115721816%22%20id%3D%22toc-hId-1115721816%22%20id%3D%22toc-hId-1115721816%22%20id%3D%22toc-hId-1115721816%22%20id%3D%22toc-hId-1115721816%22%20id%3D%22toc-hId-1115721816%22%3ESkia%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3EAPI%20for%20compositing%3C%2FH3%3E%3CP%3EIf%20enabled%2C%20the%20display%20compositor%20will%20use%20Skia%20as%20the%20graphics%20API%20instead%20of%20OpenGL%20ES.%20%E2%80%93%20Windows%3C%2FP%3E%3CA%20href%3D%22edge%3A%2F%2Fflags%2F%23enable-skia-renderer%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%23enable-skia-renderer%3C%2FA%3E%3C%2FDIV%3E%3CDIV%20class%3D%22flex%20experiment-actions%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22flex%20experiment-actions%22%3Eand%20I%20want%20to%20know%20what%20are%20the%20benefits%20of%20Skia%20API%20over%26nbsp%3B%3CSPAN%3EOpenGL%20ES%3C%2FSPAN%3E%20if%20i%20turn%20it%20on%3F%3C%2FDIV%3E%3CDIV%20class%3D%22flex%20experiment-actions%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22flex%20experiment-actions%22%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1260220%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAPI%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ecanary%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EEdge%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Eflag%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EopenGL%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Eskia%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1260827%22%20slang%3D%22en-US%22%3ERe%3A%20Which%20one%20is%20better%3F%20Skia%20API%20as%20the%20graphics%20API%20or%20OpenGL%20ES%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1260827%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F310193%22%20target%3D%22_blank%22%3E%40HotCakeX%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EActually%2C%20the%20flag%20has%20been%20there%20for%20a%20while%2C%20although%20sometimes%20temporary%20removed%20due%20to%20graphical%20issues%20and%20glitches.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EReally%20depends%20on%20the%20context.%26nbsp%3B%20The%20%3CU%3EPlatform%3C%2FU%3E%20you%20are%20using%2C%20the%20%3CU%3EOS%3C%2FU%3E%2C%20Skia's%20%3CU%3EBackend%3C%2FU%3E%20and%20finally%20your%20%3CU%3Euse%20cases%3C%2FU%3E%20can%20all%20affect%20Skia's%20performance.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAlso%2C%20Skia%20itself%20has%20a%20few%20backends%3B%20you%20could%20make%20it%20use%20OpenGL%20ES%20(called%20%3CEM%3EGanesh%3C%2FEM%3E).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt's%20worth%20mentioning%20that%20Skia%20is%20already%20used%20in%20most%20of%20Chromium's%20Graphical%20components%2C%20similar%20to%20WebRender%20in%20Firefox.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EComparing%20Skia%20to%20other%20graphics%20libraries%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESkia%2C%20compared%20to%20GDI%2B%20is%20definitely%20faster%2C%20GDI%2B%20is%20not%20even%20hardware%20accelerated%20anymore%20after%20Windows%20Vista.%3C%2FP%3E%3CP%3ECompared%20to%20Cairo%2C%20Skia%20seems%20to%20be%20faster%2C%20many%20projects%20are%20switching%20from%20Cairo%20to%20Skia%20(or%20other%20alternatives)%20aswell.%3C%2FP%3E%3CP%3ECompared%20to%20Direct2D%20which%20is%20only%20available%20on%20windows%20and%20therefore%20not%20cross-platform%2C%20both%20are%20fast%3B%20but%20Skia%20is%20available%20on%20a%20wide%20variety%20of%20devices%20and%20operating%20systems%2C%20so%20it%20will%20stay%20in%20use%20by%20chrome.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECPU-based%20rendering%20(Especially%20for%203D)%20is%20slow%2C%20and%20the%20OpenGL%20ES%20backend%20is%20mostly%20used%20for%20embedded%20devices%20like%20smartphones.%20Since%20flags%20are%20not%20even%20accessible%20by%20default%20on%20mobile%20devices%2C%20I'll%20assume%20OpenGL%20on%20Desktop.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20should%20generally%20be%20faster%3B%20for%20MacOS%20Though%2C%20I'm%20not%20sure%20what%20will%20happen%20after%20Metal%20and%20full%20deprecation%20of%20OpenGL.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20conclude%2C%20GPU-accelerated%20Skia%20should%20be%20faster.%26nbsp%3B%20if%20you%20encounter%20any%20graphical%20painting%20issues%20or%20bugs%20you%20could%20turn%20it%20off.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1260864%22%20slang%3D%22en-US%22%3ERe%3A%20Which%20one%20is%20better%3F%20Skia%20API%20as%20the%20graphics%20API%20or%20OpenGL%20ES%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1260864%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%2C%20turned%20it%20on%20and%20so%20far%20no%20issues%2C%3CBR%20%2F%3Eso%20Chrome%20uses%20Skia%20just%20because%20it's%20multi%20platform%3F%3CBR%20%2F%3EI%20think%20Direct2D%20or%20Direct3D%20should%20be%20faster%20on%20Windows%20compared%20to%20Skia%20but%20they%20can't%20be%20used%20on%20Linux%20and%20Mac%20and%20that's%20why%20Google%20is%20not%20using%20them%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1260875%22%20slang%3D%22en-US%22%3ERe%3A%20Which%20one%20is%20better%3F%20Skia%20API%20as%20the%20graphics%20API%20or%20OpenGL%20ES%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1260875%22%20slang%3D%22en-US%22%3EYou're%20welcome%2C%3CBR%20%2F%3E%3CBR%20%2F%3EIn%20addition%20to%20being%20performant%2C%20yes%3B%20writing%20platform%20specific%20code%20to%20use%20the%20fastest%20API%20on%20each%20target%20is%20going%20to%20need%20a%20lot%20of%20maintenance%20and%20most%20likely%20introduce%20many%20bugs.%3CBR%20%2F%3E%3CBR%20%2F%3EBoth%20Direct2D%20and%20Skia%20are%20fairly%20fast%3B%20also%20OpenGL%20calls%20in%20windows%20end%20up%20being%20translated%20to%20their%20DirectX%20counterparts%20through%20ANGLE%20anyway.%3CBR%20%2F%3E%3CBR%20%2F%3EBut%20if%20they%20wanted%20to%20avoid%20that%20very%20little%20overhead%20they%20could%20just%20write%20a%20DirectX%20backend%20for%20Skia%20rather%20than%20abandoning%20it%20and%20switching%20to%20Direct2D%20completely.%3CBR%20%2F%3E%3CBR%20%2F%3EOr%20even%20better%2C%20a%20Vulkan%20backed%2C%20given%20how%20its%20cross-platform%20and%20much%20faster%20than%20any%20other%20alternative.%20Best%20choice%20for%20mobile%20devices%2C%20too.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1260920%22%20slang%3D%22en-US%22%3ERe%3A%20Which%20one%20is%20better%3F%20Skia%20API%20as%20the%20graphics%20API%20or%20OpenGL%20ES%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1260920%22%20slang%3D%22en-US%22%3EIn%20games%20that%20I've%20played%20DirectX%2012%20is%20slightly%20better%20than%20Vulkan%20but%20if%20it's%20between%20DirectX%2011%20and%20Vulkan%20then%20Vulkan%20is%20a%20better%20choice.%3CBR%20%2F%3Eso%20even%20though%20browsers%20need%20far%20less%20power%20than%20AAA%20games%20but%20using%20Vulkan%20in%20Chromium%20would%20result%20in%20better%20performance%3CBR%20%2F%3E%3CBR%20%2F%3EOperating%20system%20support%3A%20Android%2C%20Linux%2C%20Windows%2C%20Nintendo%20Switch%2C%20Stadia%2C%20Tizen%2C%20macOS%3CBR%20%2F%3E%3CBR%20%2F%3Eit's%20interesting%20Vulkan%20has%20only%20been%20around%20for%204%20years%20yet%20it%20managed%20to%20be%20almost%20on%20par%20with%20DirectX12%20from%20Microsoft%20with%20years%20of%20development%20and%20experience%20behind%20the%20project%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1261063%22%20slang%3D%22en-US%22%3ERe%3A%20Which%20one%20is%20better%3F%20Skia%20API%20as%20the%20graphics%20API%20or%20OpenGL%20ES%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1261063%22%20slang%3D%22en-US%22%3EDepends%20on%20hardware%2C%20for%20example%20on%20AMD%20Vulkan%20usually%20outperforms%20D3DX12.%3CBR%20%2F%3ECombined%20with%20consoles%2C%20cloud%20gaming%2C%20mobile%20and%20desktop%20support%20of%20Vulkan%2C%20where%20AMD%20or%20ARM%20based%20hardware%20are%20mostly%20used.%3CBR%20%2F%3E%3CBR%20%2F%3EIt%20also%20depends%20on%20how%20the%20code%20is%20written%2C%20while%20both%20are%20relatively%20low%20level%2C%20they%20work%20different%20in%20some%20cases%2C%20so%20only%20knowledge%20of%20a%20single%20API%20isn't%20enough%20to%20write%20optimized-efficient%20code%20for%20the%20other.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3EWebGPU%20is%20a%20new%20addition%20to%20the%20web%20platform%2C%20successor%20to%20WebGL%202%20(2.1).%3CBR%20%2F%3EThat%20should%20make%20Graphically%20intensive%20(not%20necessarily%20AAA)%20games%20possible.%3CBR%20%2F%3EWebGPU%20will%20probably%20have%20several%20backends%20(modern%20OpenGL%2C%20DirectX11%2F12%20and%20Vulkan)%2C%20Using%20Vulkan%20also%20allows%20for%20less%20power%20consumption%20or%20higher%20performance%20on%20low-end%20underpowered%20devices.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3EWell%20Microsoft%20has%20had%20a%20lot%20of%20experience%20with%20previous%20versions%20of%20DirectX%20and%20knew%20the%20underlying%20OS%2Fhardware%20very%20well.%3CBR%20%2F%3E%3CBR%20%2F%3EFor%20years%20OpenGL%20has%20been%20far%20superior%20to%20DirectX%2C%20up%20until%20the%20DirectX%207-8.1%20era%3B%20Vulkan%20which%20was%20initially%20called%20'OpenGL%20next'%20is%20aiming%20to%20provide%20a%20performant%20and%20standardized%20interface%20(Which%20OpenGL%20unfortunately%20lacked%20until%20recently)%20across%20the%20industry.%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E
Highlighted
Honored Contributor

I'm looking for pros and cons of each API, because Edge Canary version 83.0.467.0 has a new flag called:

 

Skia API for compositing

If enabled, the display compositor will use Skia as the graphics API instead of OpenGL ES. – Windows

#enable-skia-renderer
 
and I want to know what are the benefits of Skia API over OpenGL ES if i turn it on?
 
 
5 Replies
Highlighted
Best Response confirmed by HotCakeX (Honored Contributor)
Solution

@HotCakeX 

 

Actually, the flag has been there for a while, although sometimes temporary removed due to graphical issues and glitches.

 

Really depends on the context.  The Platform you are using, the OS, Skia's Backend and finally your use cases can all affect Skia's performance.

 

Also, Skia itself has a few backends; you could make it use OpenGL ES (called Ganesh).

 

It's worth mentioning that Skia is already used in most of Chromium's Graphical components, similar to WebRender in Firefox.

 

 

Comparing Skia to other graphics libraries:

 

Skia, compared to GDI+ is definitely faster, GDI+ is not even hardware accelerated anymore after Windows Vista.

Compared to Cairo, Skia seems to be faster, many projects are switching from Cairo to Skia (or other alternatives) aswell.

Compared to Direct2D which is only available on windows and therefore not cross-platform, both are fast; but Skia is available on a wide variety of devices and operating systems, so it will stay in use by chrome.

 

 

CPU-based rendering (Especially for 3D) is slow, and the OpenGL ES backend is mostly used for embedded devices like smartphones. Since flags are not even accessible by default on mobile devices, I'll assume OpenGL on Desktop.

 

It should generally be faster; for MacOS Though, I'm not sure what will happen after Metal and full deprecation of OpenGL.

 

 

To conclude, GPU-accelerated Skia should be faster.  if you encounter any graphical painting issues or bugs you could turn it off.

 

 

 

Highlighted

Thanks, turned it on and so far no issues,
so Chrome uses Skia just because it's multi platform?
I think Direct2D or Direct3D should be faster on Windows compared to Skia but they can't be used on Linux and Mac and that's why Google is not using them?

Highlighted
You're welcome,

In addition to being performant, yes; writing platform specific code to use the fastest API on each target is going to need a lot of maintenance and most likely introduce many bugs.

Both Direct2D and Skia are fairly fast; also OpenGL calls in windows end up being translated to their DirectX counterparts through ANGLE anyway.

But if they wanted to avoid that very little overhead they could just write a DirectX backend for Skia rather than abandoning it and switching to Direct2D completely.

Or even better, a Vulkan backed, given how its cross-platform and much faster than any other alternative. Best choice for mobile devices, too.



Highlighted
In games that I've played DirectX 12 is slightly better than Vulkan but if it's between DirectX 11 and Vulkan then Vulkan is a better choice.
so even though browsers need far less power than AAA games but using Vulkan in Chromium would result in better performance

Operating system support: Android, Linux, Windows, Nintendo Switch, Stadia, Tizen, macOS

it's interesting Vulkan has only been around for 4 years yet it managed to be almost on par with DirectX12 from Microsoft with years of development and experience behind the project
Highlighted
Depends on hardware, for example on AMD Vulkan usually outperforms D3DX12.
Combined with consoles, cloud gaming, mobile and desktop support of Vulkan, where AMD or ARM based hardware are mostly used.

It also depends on how the code is written, while both are relatively low level, they work different in some cases, so only knowledge of a single API isn't enough to write optimized-efficient code for the other.


WebGPU is a new addition to the web platform, successor to WebGL 2 (2.1).
That should make Graphically intensive (not necessarily AAA) games possible.
WebGPU will probably have several backends (modern OpenGL, DirectX11/12 and Vulkan), Using Vulkan also allows for less power consumption or higher performance on low-end underpowered devices.


Well Microsoft has had a lot of experience with previous versions of DirectX and knew the underlying OS/hardware very well.

For years OpenGL has been far superior to DirectX, up until the DirectX 7-8.1 era; Vulkan which was initially called 'OpenGL next' is aiming to provide a performant and standardized interface (Which OpenGL unfortunately lacked until recently) across the industry.