Hi Everyone,
Thanks for providing a lot of useful information.
@John Stiles
> When we are drawing to a GPU surface, we have a totally different path for converting the SkPaint into real work.
I am specifically interested in the use of vector processing in Skia, especially when hardware compositing is enabled in the Chromium project.
So I profiled chromium with hardware compositing and found that many Skia functions (that use vector operations) are called in this file (opts/SkRasterPipeline_opts.h).
I thought that these functions are SkRasterPipeline stages but it seems that this is not the case.
If Skia uses GPU device, why would it execute opt stages on CPU rather than offloading to the GPU?
Would you please provide more information about the files in the opts directory and their usage when Skia uses GPU rasterization?
In addition, do you have more insights on how Skia takes advantage of vector operations for accelerating the rasterization?
@Brian Osman
> When you issue a draw command to the SkCanvas, it gets dispatched to the canvas' SkDevice (an internal type). The device comes from the surface, and there are separate C++ SkDevice classes for the CPU and GPU. Each device then has a large amount of code it uses to implement all of the drawing algorithms.
So I think based on your explanation, there is a device-agnostic front-end (SkCanvas) that receives paint operations, does some processing, and dispatches them to the back-end. What are the responsibilities of this frond-end (SkCanvas) and what kind of processing does it do?
There is a device-specific back-end (SkDevice) that is responsible to send the instructions to the device (e.g., GPU), and GPU renders them. I think that all the files under the gpu directory provide raster implementation for the GPU SkDevice. Right?
I am trying to understand an overview of both front-end and back-end processing. What operations each of these stages are responsible for?
I found many drawing algorithms in gpu/Device.cpp which looks like it is at the end of the back-end stage where operations are sent to the GPU for execution. Right?
Best,
- Alireza