SkImage always having SurfaceOrigin as kTopLeft_GrSurfaceOrigin

13 views
Skip to first unread message

pr0p

unread,
Nov 9, 2021, 3:19:21 AMNov 9
to skia-discuss
Hi,

I am creating SkImage from hardwarebuffer in android using the following Skia APIs: SkImage::MakeFromAHardwareBuffer and SkImage::MakeFromAHardwareBufferWithData.
I'm then using the SkImage to draw onto canvas using drawImageRect.

However, when I reuse the SkImage, I see that the images flipped when the surface origin is kBottomLeft_GrSurfaceOrigin.

So I investigated SkImage_Lazy. I could see that when the texture is retrieved if found to be cached, the surface origin is hard-coded to kTopLeft_GrSurfaceOrigin.
I'm referring to method SkImage_Lazy::lockTextureProxyView.

I was using the M91 version of skia but realized that even the latest version (I looked at M97) does the same.

I wanted to know if this is on purpose or a bug. Also, is there a way to reuse and not flip the SkImage?
Reply all
Reply to author
Forward
0 new messages