Bug 1512628 - Update webrender to commit baf98a257705ccb2b0b58c9421b80faccf09001c (WR PR #3391). r=kats
authorWR Updater Bot <graphics-team@mozilla.staktrace.com>
Fri, 07 Dec 2018 14:15:03 +0000
changeset 508817 2d544dadc4700b7c5a63b8bce8ace7bd3f35e098
parent 508816 66300d47ceb0a0a0578e2a867ce93b54e96f79f5
child 508818 61571452b0fc8cd26ff55b31e05a76d069883123
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1512628
milestone65.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 1512628 - Update webrender to commit baf98a257705ccb2b0b58c9421b80faccf09001c (WR PR #3391). r=kats https://github.com/servo/webrender/pull/3391 Differential Revision: https://phabricator.services.mozilla.com/D13977
gfx/webrender_bindings/revision.txt
gfx/wr/webrender/src/intern.rs
gfx/wr/webrender/src/profiler.rs
gfx/wr/webrender/src/render_backend.rs
--- a/gfx/webrender_bindings/revision.txt
+++ b/gfx/webrender_bindings/revision.txt
@@ -1,1 +1,1 @@
-19abc69f0e17f8f6915ca5711ede2b5ac5aeefe9
+baf98a257705ccb2b0b58c9421b80faccf09001c
--- a/gfx/wr/webrender/src/intern.rs
+++ b/gfx/wr/webrender/src/intern.rs
@@ -1,14 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use api::{LayoutPrimitiveInfo, LayoutRect};
 use internal_types::FastHashMap;
+use profiler::ResourceProfileCounter;
 use std::fmt::Debug;
 use std::hash::Hash;
 use std::marker::PhantomData;
 use std::{mem, ops, u64};
 use std::sync::atomic::{AtomicUsize, Ordering};
 use util::VecHelper;
 
 /*
@@ -148,16 +149,17 @@ impl<S, T, M> ::std::default::Default fo
 
 impl<S, T, M> DataStore<S, T, M> where S: Debug, T: From<S>, M: Debug
 {
     /// Apply any updates from the scene builder thread to
     /// this data store.
     pub fn apply_updates(
         &mut self,
         update_list: UpdateList<S>,
+        profile_counter: &mut ResourceProfileCounter,
     ) {
         let mut data_iter = update_list.data.into_iter();
         for update in update_list.updates {
             match update.kind {
                 UpdateKind::Insert => {
                     self.items.entry(update.index).set(Item {
                         data: T::from(data_iter.next().unwrap()),
                         epoch: update_list.epoch,
@@ -166,16 +168,20 @@ impl<S, T, M> DataStore<S, T, M> where S
                 UpdateKind::Remove => {
                     self.items[update.index].epoch = Epoch::INVALID;
                 }
                 UpdateKind::UpdateEpoch => {
                     self.items[update.index].epoch = update_list.epoch;
                 }
             }
         }
+
+        let per_item_size = mem::size_of::<S>() + mem::size_of::<T>();
+        profile_counter.set(self.items.len(), per_item_size * self.items.len());
+
         debug_assert!(data_iter.next().is_none());
     }
 }
 
 /// Retrieve an item from the store via handle
 impl<S, T, M> ops::Index<Handle<M>> for DataStore<S, T, M>
 where M: Copy
 {
--- a/gfx/wr/webrender/src/profiler.rs
+++ b/gfx/wr/webrender/src/profiler.rs
@@ -376,16 +376,17 @@ impl GpuCacheProfileCounters {
     }
 }
 
 #[derive(Clone)]
 pub struct BackendProfileCounters {
     pub total_time: TimeProfileCounter,
     pub resources: ResourceProfileCounters,
     pub ipc: IpcProfileCounters,
+    pub intern: InternProfileCounters,
 }
 
 #[derive(Clone)]
 pub struct ResourceProfileCounters {
     pub font_templates: ResourceProfileCounter,
     pub image_templates: ResourceProfileCounter,
     pub texture_cache: TextureCacheProfileCounters,
     pub gpu_cache: GpuCacheProfileCounters,
@@ -395,16 +396,23 @@ pub struct ResourceProfileCounters {
 pub struct IpcProfileCounters {
     pub build_time: TimeProfileCounter,
     pub consume_time: TimeProfileCounter,
     pub send_time: TimeProfileCounter,
     pub total_time: TimeProfileCounter,
     pub display_lists: ResourceProfileCounter,
 }
 
+#[derive(Clone)]
+pub struct InternProfileCounters {
+    pub prims: ResourceProfileCounter,
+    pub text_runs: ResourceProfileCounter,
+    pub clips: ResourceProfileCounter,
+}
+
 impl IpcProfileCounters {
     pub fn set(
         &mut self,
         build_start: u64,
         build_end: u64,
         send_start: u64,
         consume_start: u64,
         consume_end: u64,
@@ -433,16 +441,21 @@ impl BackendProfileCounters {
             },
             ipc: IpcProfileCounters {
                 build_time: TimeProfileCounter::new("Display List Build Time", false),
                 consume_time: TimeProfileCounter::new("Display List Consume Time", false),
                 send_time: TimeProfileCounter::new("Display List Send Time", false),
                 total_time: TimeProfileCounter::new("Total Display List Time", false),
                 display_lists: ResourceProfileCounter::new("Display Lists Sent"),
             },
+            intern: InternProfileCounters {
+                prims: ResourceProfileCounter::new("Interned primitives"),
+                text_runs: ResourceProfileCounter::new("Interned text runs"),
+                clips: ResourceProfileCounter::new("Interned clips"),
+            },
         }
     }
 
     pub fn reset(&mut self) {
         self.total_time.reset();
         self.ipc.total_time.reset();
         self.ipc.build_time.reset();
         self.ipc.consume_time.reset();
@@ -1079,16 +1092,27 @@ impl Profiler {
             ],
             debug_renderer,
             true,
             &mut self.draw_state
         );
 
         Profiler::draw_counters(
             &[
+                &backend_profile.intern.clips,
+                &backend_profile.intern.prims,
+                &backend_profile.intern.text_runs,
+            ],
+            debug_renderer,
+            true,
+            &mut self.draw_state
+        );
+
+        Profiler::draw_counters(
+            &[
                 &backend_profile.resources.texture_cache.pages_a8_linear,
                 &backend_profile.resources.texture_cache.pages_rgba8_linear,
                 &backend_profile.resources.texture_cache.pages_rgba8_nearest,
                 &backend_profile.ipc.display_lists,
             ],
             debug_renderer,
             true,
             &mut self.draw_state
--- a/gfx/wr/webrender/src/render_backend.rs
+++ b/gfx/wr/webrender/src/render_backend.rs
@@ -1198,19 +1198,28 @@ impl RenderBackend {
         }
 
         let doc = self.documents.get_mut(&document_id).unwrap();
         doc.has_built_scene |= has_built_scene;
 
         // If there are any additions or removals of clip modes
         // during the scene build, apply them to the data store now.
         if let Some(updates) = doc_resource_updates {
-            doc.resources.clip_data_store.apply_updates(updates.clip_updates);
-            doc.resources.prim_data_store.apply_updates(updates.prim_updates);
-            doc.resources.text_run_data_store.apply_updates(updates.text_run_updates);
+            doc.resources.clip_data_store.apply_updates(
+                updates.clip_updates,
+                &mut profile_counters.intern.clips,
+            );
+            doc.resources.prim_data_store.apply_updates(
+                updates.prim_updates,
+                &mut profile_counters.intern.prims,
+            );
+            doc.resources.text_run_data_store.apply_updates(
+                updates.text_run_updates,
+                &mut profile_counters.intern.text_runs,
+            );
         }
 
         // TODO: this scroll variable doesn't necessarily mean we scrolled. It is only used
         // for something wrench specific and we should remove it.
         let mut scroll = false;
         for frame_msg in frame_ops {
             let _timer = profile_counters.total_time.timer();
             let op = doc.process_frame_msg(frame_msg);