Skip to content

Commit aeb2c60

Browse files
committed
Capture: refined and clarified the associated TODOs
1 parent cd01eaa commit aeb2c60

3 files changed

Lines changed: 14 additions & 11 deletions

File tree

webrender/src/render_backend.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,8 @@ impl RenderBackend {
858858
&mut profile_counters.resources,
859859
);
860860
//TODO: write down full `RenderedDocument`?
861+
// it has `pipeline_epoch_map` and `layers_bouncing_back`,
862+
// which may capture necessary details for some cases.
861863
let file_name = format!("frame-{}-{}", (id.0).0, id.1);
862864
config.serialize(&rendered_document.frame, file_name);
863865
}

webrender/src/renderer.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4843,8 +4843,6 @@ impl Renderer {
48434843

48444844
if !deferred_images.is_empty() {
48454845
info!("saving external images");
4846-
//TODO: add a switch to check `self.texture_resolver.external_images`
4847-
// instead of locking with the actual handler.
48484846
let handler = self.external_image_handler
48494847
.as_mut()
48504848
.expect("Unable to lock the external image handler!");
@@ -4936,9 +4934,7 @@ impl Renderer {
49364934
rows.clear();
49374935
cpu_blocks.clear();
49384936
}
4939-
CacheBus::Scatter { ref mut count, .. } => {
4940-
*count = 0; //TODO?
4941-
}
4937+
CacheBus::Scatter { .. } => {}
49424938
}
49434939

49444940
info!("loading external images");
@@ -4949,12 +4945,13 @@ impl Renderer {
49494945

49504946
for ExternalCaptureImage { short_path, external, descriptor } in renderer.external_images {
49514947
let target = get_external_image_target(external.image_type).unwrap();
4952-
let layer_count = 1; //TODO?
4948+
//TODO: provide a way to query both the layer count and the filter from external images
4949+
let (layer_count, filter) = (1, TextureFilter::Linear);
49534950
let plain = PlainTexture {
49544951
data: short_path,
49554952
size: (descriptor.width, descriptor.height, layer_count),
49564953
format: descriptor.format,
4957-
filter: TextureFilter::Linear, //TODO?
4954+
filter,
49584955
render_target: None,
49594956
};
49604957

webrender/src/resource_cache.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,8 @@ impl ResourceCache {
10821082
Entry::Vacant(e) => e,
10831083
};
10841084

1085-
//TODO: option to save as PNG
1085+
//TODO: option to save as PNG:
1086+
// https://github.com/servo/webrender/issues/2234
10861087
let file_name = format!("{}.raw", image_id);
10871088
let short_path = format!("images/{}", file_name);
10881089
fs::File::create(path_images.join(file_name))
@@ -1095,7 +1096,9 @@ impl ResourceCache {
10951096
assert_eq!(template.tiling, None);
10961097
let request = BlobImageRequest {
10971098
key,
1098-
tile: None, //TODO: tiled blob images
1099+
//TODO: support tiled blob images
1100+
// https://github.com/servo/webrender/issues/2236
1101+
tile: None,
10991102
};
11001103

11011104
let renderer = self.blob_image_renderer.as_mut().unwrap();
@@ -1245,7 +1248,9 @@ impl ResourceCache {
12451248
use std::io::Read;
12461249

12471250
info!("loading resource cache");
1248-
//TODO: pre-load the raw map
1251+
//TODO: instead of filling the local path to Arc<data> map as we process
1252+
// each of the resource types, we could go through all of the local paths
1253+
// and fill out the map as the first step.
12491254
let mut raw_map = FastHashMap::<String, Arc<Vec<u8>>>::default();
12501255

12511256
match caches {
@@ -1349,7 +1354,6 @@ impl ResourceCache {
13491354
e.get().clone()
13501355
}
13511356
Entry::Vacant(e) => {
1352-
//TODO: consider merging the code path with font loading
13531357
let mut buffer = Vec::new();
13541358
File::open(root.join(e.key()))
13551359
.expect(&format!("Unable to open {}", e.key()))

0 commit comments

Comments
 (0)