Skip to content

x/exp/shiny: assigning to *buf.RGBA() works on gldriver but not x11driver #14191

@jnjackins

Description

@jnjackins

I had some code like this:

*buf.RGBA() = *img
tx.Upload(image.ZP, buf, buf.Bounds())
win.Copy(min, tx, tx.Bounds(), screen.Src, nil)

This worked on gldriver, but not x11driver. After switching to the following, it worked on both:

draw.Draw(buf.RGBA(), img.Bounds(), img, image.ZP, draw.Src)
tx.Upload(image.ZP, buf, buf.Bounds())
win.Copy(min, tx, tx.Bounds(), screen.Src, nil)

I have not yet investigated why it works on one but not the other, but first: should this work? It feels like I'm paying a performance penalty by drawing my image to buf.RGBA() when I already have exactly the image that I want.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions