Hi Sunny,
Sorry for the late reply. Holidays :)
I mostly care for the case where OOP-R is enabled, because as I understand it, it's the way everything will be working in the near future.
Currently I look at RI::ReadbackImagePixels() called on a separate thread with a separate context.
I narrowed down inconsistent readback performance to GrGpu::readPixels(), it sometimes can take either around 3-5 ms or more often around 12-13 ms on a separate context.
For example, in the attached trace GPU process:
High latency call
GrGpu::readPixels
Category disabled-by-default-skia.gpu
Start: 103,357.199 ms
Wall Duration: 13.102 ms
CPU Duration: 1.499 ms
Low latency call
GrGpu::readPixels
Category disabled-by-default-skia.gpu
Start: 105,328.148 ms
Wall Duration: 3.987 ms
CPU Duration: 1.403 m
I don't really know how to dig deeper into Skia's GrGpu::readPixels() to figure out what makes it inconsistent and slower.
I'll appreciate any help in debugging what's going on.
This is the CL I am working on.