1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 13:20:05 -04:00

[epi] Simplify TextureAllocator interface

This commit is contained in:
Emil Ernerfeldt
2021-01-07 16:29:58 +01:00
parent e8e53e9500
commit 5ef9f35d1e
6 changed files with 20 additions and 27 deletions

View File

@@ -66,17 +66,14 @@ impl WebBackend {
}
impl epi::TextureAllocator for webgl::Painter {
fn alloc(&mut self) -> egui::TextureId {
self.alloc_user_texture()
}
fn set_srgba_premultiplied(
fn alloc_srgba_premultiplied(
&mut self,
id: egui::TextureId,
size: (usize, usize),
srgba_pixels: &[Color32],
) {
) -> egui::TextureId {
let id = self.alloc_user_texture();
self.set_user_texture(id, size, srgba_pixels);
id
}
fn free(&mut self, id: egui::TextureId) {