reuse ImageKey for gpucanvascontext (#33517)

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
Samson 2024-09-22 13:57:50 +02:00 committed by GitHub
parent 3a0d27b231
commit bab769a7cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 37 deletions

View file

@ -6,7 +6,7 @@ use std::collections::HashMap;
use std::ops::ControlFlow;
use std::ptr::NonNull;
use std::slice;
use std::sync::{Arc, Mutex, MutexGuard};
use std::sync::{Arc, Mutex};
use arrayvec::ArrayVec;
use euclid::default::Size2D;
@ -234,7 +234,6 @@ impl crate::WGPU {
format: ImageFormat,
size: DeviceIntSize,
image_key: ImageKey,
mut wr: MutexGuard<RenderApi>,
) {
let image_desc = ImageDescriptor {
format,
@ -265,7 +264,10 @@ impl crate::WGPU {
let mut txn = Transaction::new();
txn.add_image(image_key, image_desc, image_data, None);
wr.send_transaction(self.webrender_document, txn);
self.webrender_api
.lock()
.unwrap()
.send_transaction(self.webrender_document, txn);
}
/// Copies data async from provided texture using encoder_id to available staging presentation buffer