Re: Calling SkImage::MakeCrossContextFromPixmap has no texture upload problem

68 views
Skip to first unread message

Jim Van Verth

unread,
Jun 12, 2023, 1:39:41 PM6/12/23
to skia-d...@googlegroups.com
SkImage::MakeCrossContextFromPixmap is not intended to be a general use interface -- it was created specifically for Flutter's use case and not much else. It's likely we'll be moving it to a private header in the near future, and won't be supported with Graphite.

On Sun, Jun 11, 2023 at 11:27 PM shengjie hu <jason...@gmail.com> wrote:
There are two threads in the threading model of our application: the Producer thread is mainly responsible for image decoding (CPU decoding), and then uses SkImage::MakeCrossContextFromPixmap to create images (perform texture upload).
The Consumer thread is responsible for drawing the SkImage to the screen. Each thread has its own GrContext and GL context. GL contexts are created in shared groups.

The problem now is that after the producer thread calls SkImage::MakeCrossContextFromPixmap, it returns a Raster Image instead of the SkImage of the GPU backend. By printing the log, it is found that the return of GrMakeUncachedBitmapProxyView is empty, and then calls SkImage::MakeRasterCopy to construct a Raster Image.
截屏2023-06-12 11.11.36.png
Through more detailed tracking, GrMakeUncachedBitmapProxyView returns empty because the internal call to doLazyInstantiation failed.
截屏2023-06-12 11.17.51.png

May I ask what causes SkImage::MakeCrossContextFromPixmap to return a Raster Image instead of a texture-based Skimage?  Need to configure some options?  If the producer thread does not perform texture upload, then when I draw in the consumer thread, I need to perform texture upload first, which will affect the performance of drawing. How can I fix this problem?thank you very much

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/c0f766a3-4882-4525-b161-aff1b0a8b23en%40googlegroups.com.


--

Jim Van Verth |
 Software Engineer | Google.com
Reply all
Reply to author
Forward
0 new messages