1commit 3b2591abfeb07c50140b0e188e41f76fa942ae0a
2Author: Nicolas Silva <nical@fastmail.com>
3Date:   Tue Aug 28 11:20:15 2018 +0200
4
5    Expose low priority transactions in the API.
6
7diff --git a/webrender/src/render_backend.rs b/webrender/src/render_backend.rs
8index ccc779c9..be76f8cc 100644
9--- a/webrender/src/render_backend.rs
10+++ b/webrender/src/render_backend.rs
11@@ -763,6 +763,7 @@ impl RenderBackend {
12                             resource_updates,
13                             generate_frame: render,
14                             use_scene_builder_thread: false,
15+                            low_priority: false,
16                         };
17
18                         self.resource_cache.add_rasterized_blob_images(rasterized_blobs);
19diff --git a/webrender_api/src/api.rs b/webrender_api/src/api.rs
20index 8debdd35..6f9de5e6 100644
21--- a/webrender_api/src/api.rs
22+++ b/webrender_api/src/api.rs
23@@ -56,6 +56,8 @@ pub struct Transaction {
24     use_scene_builder_thread: bool,
25
26     generate_frame: bool,
27+
28+    low_priority: bool,
29 }
30
31 impl Transaction {
32@@ -67,6 +69,7 @@ impl Transaction {
33             payloads: Vec::new(),
34             use_scene_builder_thread: false, // TODO: make this true by default.
35             generate_frame: false,
36+            low_priority: false,
37         }
38     }
39
40@@ -256,6 +259,7 @@ impl Transaction {
41                 resource_updates: self.resource_updates,
42                 use_scene_builder_thread: self.use_scene_builder_thread,
43                 generate_frame: self.generate_frame,
44+                low_priority: self.low_priority,
45             },
46             self.payloads,
47         )
48@@ -337,6 +341,10 @@ impl Transaction {
49         self.resource_updates.push(ResourceUpdate::DeleteFontInstance(key));
50     }
51
52+    pub fn mark_low_priority(&mut self) {
53+        self.low_priority = true;
54+    }
55+
56     pub fn merge(&mut self, mut other: Vec<ResourceUpdate>) {
57         self.resource_updates.append(&mut other);
58     }
59@@ -354,6 +362,7 @@ pub struct TransactionMsg {
60     pub resource_updates: Vec<ResourceUpdate>,
61     pub generate_frame: bool,
62     pub use_scene_builder_thread: bool,
63+    pub low_priority: bool,
64 }
65
66 impl TransactionMsg {
67@@ -372,6 +381,7 @@ impl TransactionMsg {
68             resource_updates: Vec::new(),
69             generate_frame: false,
70             use_scene_builder_thread: false,
71+            low_priority: false,
72         }
73     }
74
75@@ -382,6 +392,7 @@ impl TransactionMsg {
76             resource_updates: Vec::new(),
77             generate_frame: false,
78             use_scene_builder_thread: false,
79+            low_priority: false,
80         }
81     }
82 }
83