Image FilterMode broken ?

Skip to first unread message

Marouane MANAA

Oct 13, 2021, 10:32:22 AM (3 days ago) Oct 13

I'm new to Skia and i'm trying to draw a simple image using linear filtering.

SkPaint paint;
SkSamplingOptions options(SkFilterMode::kLinear);
canvas->drawImage(image, 100, 100, {}, &paint);

When i trace the app using apitrace i can't locate any GL_LINEAR flag but only GL_NEAREST.

Does anyone have an idea about this.

Thank you all.

Greg Daniel

Oct 13, 2021, 10:42:58 AM (3 days ago) Oct 13
to skia-discuss
If the image is aligned on pixel boundaries and no scaling is happening, we will drop down to just using NEAREST because it is equivalent to LINEAR. You can try translating where the image is drawn slightly to see if you now see the Linear.

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
To view this discussion on the web visit

Brian Osman

Oct 13, 2021, 10:43:09 AM (3 days ago) Oct 13
It is possible that Skia is detecting the fact that you're drawing 1:1 (texels : pixels), and turning the linear filtering into nearest-neighbor. What happens if you call:

  canvas->scale(1.1, 1.1);

... before drawImage?

On Wed, Oct 13, 2021 at 10:32 AM Marouane MANAA <> wrote:

Marouane MANAA

Oct 13, 2021, 10:56:11 AM (3 days ago) Oct 13
After scaling, the texture filter is GL_LINEAR.

I need to draw more attention Skia smart moves :)

Thank you all.

Reply all
Reply to author
0 new messages