Bug 1541078 - Rename before/after_frames r=kvark
authorDoug Thayer <dothayer@mozilla.com>
Mon, 06 May 2019 17:21:10 +0000
changeset 531538 d4a4c9ad62fd31f0830763c7a46ebfd4d1f40301
parent 531537 683736527e1e290a24b843c2915afb5985649d55
child 531539 f53e8b390527be63434af20acb36b2012829c982
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskvark
bugs1541078
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1541078 - Rename before/after_frames r=kvark These aren't great names - I couldn't come up with better though. We lose the symmetry of before/after but this clarifies a little bit what they are doing. Differential Revision: https://phabricator.services.mozilla.com/D29877
gfx/wr/webrender/src/gpu_cache.rs
gfx/wr/webrender/src/render_backend.rs
gfx/wr/webrender/src/resource_cache.rs
gfx/wr/webrender/src/texture_cache.rs
--- a/gfx/wr/webrender/src/gpu_cache.rs
+++ b/gfx/wr/webrender/src/gpu_cache.rs
@@ -689,17 +689,17 @@ pub struct GpuCache {
     /// Number of blocks requested this frame that don't
     /// need to be re-uploaded.
     saved_block_count: usize,
     /// The current debug flags for the system.
     debug_flags: DebugFlags,
     /// Whether there is a pending clear to send with the
     /// next update.
     pending_clear: bool,
-    /// Indicates that before_frames has been called for this group of frames.
+    /// Indicates that prepare_for_frames has been called for this group of frames.
     /// Used for sanity checks.
     prepared_for_frames: bool,
     /// This indicates that we performed a cleanup operation which requires all
     /// documents to build a frame.
     requires_frame_build: bool,
     /// The set of documents which have had frames built in this update. Used for
     /// sanity checks.
     document_frames_to_build: FastHashSet<DocumentId>,
@@ -743,28 +743,28 @@ impl GpuCache {
         self.pending_clear = true;
         self.requires_frame_build = true;
     }
 
     pub fn requires_frame_build(&self) -> bool {
         self.requires_frame_build
     }
 
-    pub fn before_frames(&mut self) {
+    pub fn prepare_for_frames(&mut self) {
         self.prepared_for_frames = true;
         if self.should_reclaim_memory() {
             self.clear();
             debug_assert!(self.document_frames_to_build.is_empty());
             for &document_id in self.texture.occupied_list_heads.keys() {
                 self.document_frames_to_build.insert(document_id);
             }
         }
     }
 
-    pub fn after_frames(&mut self) {
+    pub fn bookkeep_after_frames(&mut self) {
         assert!(self.document_frames_to_build.is_empty());
         assert!(self.prepared_for_frames);
         self.requires_frame_build = false;
         self.prepared_for_frames = false;
     }
 
     /// Begin a new frame.
     pub fn begin_frame(&mut self, stamp: FrameStamp) {
--- a/gfx/wr/webrender/src/render_backend.rs
+++ b/gfx/wr/webrender/src/render_backend.rs
@@ -858,17 +858,17 @@ impl RenderBackend {
         }
 
         while keep_going {
             profile_scope!("handle_msg");
 
             while let Ok(msg) = self.scene_rx.try_recv() {
                 match msg {
                     SceneBuilderResult::Transactions(mut txns, result_tx) => {
-                        self.before_frames();
+                        self.prepare_for_frames();
                         self.maybe_force_nop_documents(
                             &mut frame_counter,
                             &mut profile_counters,
                             |document_id| txns.iter().any(|txn| txn.document_id == document_id));
 
                         for mut txn in txns.drain(..) {
                             let has_built_scene = txn.built_scene.is_some();
                             if let Some(doc) = self.documents.get_mut(&txn.document_id) {
@@ -916,17 +916,17 @@ impl RenderBackend {
                                 txn.notifications.take(),
                                 txn.render_frame,
                                 txn.invalidate_rendered_frame,
                                 &mut frame_counter,
                                 &mut profile_counters,
                                 has_built_scene,
                             );
                         }
-                        self.after_frames();
+                        self.bookkeep_after_frames();
                     },
                     SceneBuilderResult::FlushComplete(tx) => {
                         tx.send(()).ok();
                     }
                     SceneBuilderResult::ExternalEvent(evt) => {
                         self.notifier.external_event(evt);
                     }
                     SceneBuilderResult::ClearNamespace(id) => {
@@ -1194,24 +1194,24 @@ impl RenderBackend {
                     profile_counters,
                 );
             }
         }
 
         true
     }
 
-    fn before_frames(&mut self) {
-        self.resource_cache.before_frames(SystemTime::now());
-        self.gpu_cache.before_frames();
+    fn prepare_for_frames(&mut self) {
+        self.resource_cache.prepare_for_frames(SystemTime::now());
+        self.gpu_cache.prepare_for_frames();
     }
 
-    fn after_frames(&mut self) {
-        self.resource_cache.after_frames();
-        self.gpu_cache.after_frames();   
+    fn bookkeep_after_frames(&mut self) {
+        self.resource_cache.bookkeep_after_frames();
+        self.gpu_cache.bookkeep_after_frames();   
     }
 
     fn requires_frame_build(&mut self) -> bool {
         self.resource_cache.requires_frame_build() || self.gpu_cache.requires_frame_build()
     }
 
     fn prepare_transactions(
         &mut self,
@@ -1283,17 +1283,17 @@ impl RenderBackend {
                     txn.request_scene_build = Some(SceneRequest {
                         view: doc.view.clone(),
                         font_instances: self.resource_cache.get_font_instances(),
                         output_pipelines: doc.output_pipelines.clone(),
                     });
                 }
             }
         } else {
-            self.before_frames();
+            self.prepare_for_frames();
             self.maybe_force_nop_documents(
                 frame_counter,
                 profile_counters,
                 |document_id| txns.iter().any(|txn| txn.document_id == document_id));
 
             for mut txn in txns {
                 self.update_document(
                     txn.document_id,
@@ -1304,17 +1304,17 @@ impl RenderBackend {
                     txn.render_frame,
                     txn.invalidate_rendered_frame,
                     frame_counter,
                     profile_counters,
                     false
                 );
             }
 
-            self.after_frames();
+            self.bookkeep_after_frames();
             return;
         }
 
         let tx = if use_high_priority {
             &self.scene_tx
         } else {
             &self.low_priority_scene_tx
         };
--- a/gfx/wr/webrender/src/resource_cache.rs
+++ b/gfx/wr/webrender/src/resource_cache.rs
@@ -1560,22 +1560,22 @@ impl ResourceCache {
             ImageProperties {
                 descriptor: image_template.descriptor,
                 external_image,
                 tiling: image_template.tiling,
             }
         })
     }
 
-    pub fn before_frames(&mut self, time: SystemTime) {
-        self.texture_cache.before_frames(time);
+    pub fn prepare_for_frames(&mut self, time: SystemTime) {
+        self.texture_cache.prepare_for_frames(time);
     }
 
-    pub fn after_frames(&mut self) {
-        self.texture_cache.after_frames();
+    pub fn bookkeep_after_frames(&mut self) {
+        self.texture_cache.bookkeep_after_frames();
     }
 
     pub fn requires_frame_build(&self) -> bool {
         self.texture_cache.requires_frame_build()
     }
 
     pub fn begin_frame(&mut self, stamp: FrameStamp) {
         debug_assert_eq!(self.state, State::Idle);
--- a/gfx/wr/webrender/src/texture_cache.rs
+++ b/gfx/wr/webrender/src/texture_cache.rs
@@ -666,21 +666,21 @@ impl TextureCache {
                             .unwrap_or_else(|| PerDocumentData::new());
     }
 
     fn unset_doc_data(&mut self) {
         self.per_doc_data.insert(self.now.document_id(),
                                  mem::replace(&mut self.doc_data, PerDocumentData::new()));
     }
 
-    pub fn before_frames(&mut self, time: SystemTime) {
+    pub fn prepare_for_frames(&mut self, time: SystemTime) {
         self.maybe_reclaim_shared_memory(time);
     }
 
-    pub fn after_frames(&mut self) {
+    pub fn bookkeep_after_frames(&mut self) {
         self.require_frame_build = false;
     }
 
     pub fn requires_frame_build(&self) -> bool {
         return self.require_frame_build;
     }
 
     /// Called at the beginning of each frame.