Skip to content

Commit 094d296

Browse files
committed
Fix a BlobImageRasterizer race condition.
We can only make a blob image rasterizer the render backend thread's current rasterizer after it went through the scene builder thread, otherwise the rastirezer might race ahead of other rasterizers that are on going through the scene builder thread. We also need to make sure that if there is a blob image update, we don't skip the scene builder thread.
1 parent 7c4162c commit 094d296

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

webrender/src/render_backend.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,10 +1110,10 @@ impl RenderBackend {
11101110
txn.blob_rasterizer = blob_rasterizer;
11111111
}
11121112

1113-
if !transaction_msg.use_scene_builder_thread && txn.can_skip_scene_builder() {
1114-
if let Some(rasterizer) = txn.blob_rasterizer.take() {
1115-
self.resource_cache.set_blob_rasterizer(rasterizer);
1116-
}
1113+
if !transaction_msg.use_scene_builder_thread &&
1114+
txn.can_skip_scene_builder() &&
1115+
txn.blob_rasterizer.is_none() {
1116+
11171117
self.update_document(
11181118
txn.document_id,
11191119
replace(&mut txn.resource_updates, Vec::new()),

webrender/src/resource_cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ impl ResourceCache {
10821082
&mut self,
10831083
keys: &[BlobImageKey]
10841084
) -> (Option<Box<AsyncBlobImageRasterizer>>, Vec<BlobImageParams>) {
1085-
if self.blob_image_handler.is_none() {
1085+
if self.blob_image_handler.is_none() || keys.is_empty() {
10861086
return (None, Vec::new());
10871087
}
10881088

0 commit comments

Comments
 (0)