| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
int bytes_per_element = format.BytesPerPixel();This will now crash for ETC1 whereas the previous code would return null. Is that intentional, or do you know that this entrypoint will never be hit for ETC1? If you don't know that, maybe want to retain a check for ETC1 specifically that returns nullptr here?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
int bytes_per_element = format.BytesPerPixel();This will now crash for ETC1 whereas the previous code would return null. Is that intentional, or do you know that this entrypoint will never be hit for ETC1? If you don't know that, maybe want to retain a check for ETC1 specifically that returns nullptr here?
It's intentional. ETC1 is only used on Android so we can rule out D3DImageBacking from that. It's also not in [this list](https://source.chromium.org/chromium/chromium/src/+/main:gpu/command_buffer/service/shared_image/d3d_image_backing_factory.cc;l=145-146;drc=45a1118875a1b3a2a1ae9fee639cf1b546a43547) and there is no way to update ETC1 textures after creation so it would have to be.
ETC1 is only supported in WrappedSk/WrappedGraphite/GLTexture backings. I don't think we actually create GLTextureImageBacking with ETC1 anymore but the code exists and we'd have to verify it's unused.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
int bytes_per_element = format.BytesPerPixel();Kyle CharbonneauThis will now crash for ETC1 whereas the previous code would return null. Is that intentional, or do you know that this entrypoint will never be hit for ETC1? If you don't know that, maybe want to retain a check for ETC1 specifically that returns nullptr here?
It's intentional. ETC1 is only used on Android so we can rule out D3DImageBacking from that. It's also not in [this list](https://source.chromium.org/chromium/chromium/src/+/main:gpu/command_buffer/service/shared_image/d3d_image_backing_factory.cc;l=145-146;drc=45a1118875a1b3a2a1ae9fee639cf1b546a43547) and there is no way to update ETC1 textures after creation so it would have to be.
ETC1 is only supported in WrappedSk/WrappedGraphite/GLTexture backings. I don't think we actually create GLTextureImageBacking with ETC1 anymore but the code exists and we'd have to verify it's unused.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Convert callers to BytesPerPixel()
All callers of SharedImageFormat::BitsPerPixel() that divide by 8 can
just call BytesPerPixel(). That is all callers so this also removes
BitsPerPixel().
The only caller that isn't simply replacing BitsPerPixel() / 8 is
TryAllocateSkDataForBitmap)(). The logic there was identical to
EstimatedSizeInBytes() so that is used instead.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |