Bug 1510882 - Update webrender to commit 835ba47f392c47a35c9baa2d44ec6cb1903b6f2b (WR PR #3371). r=kats
authorWR Updater Bot <graphics-team@mozilla.staktrace.com>
Fri, 30 Nov 2018 01:50:17 +0000
changeset 508108 b7adf13336ec7d453b505cf10a7b13644fd640da
parent 508107 b096dc953832f7601d34625144d19c1bb43c9f7a
child 508109 d4574d73506372785c910a68447ed4354d7ea561
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
bugs1510882
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 1510882 - Update webrender to commit 835ba47f392c47a35c9baa2d44ec6cb1903b6f2b (WR PR #3371). r=kats https://github.com/servo/webrender/pull/3371 Differential Revision: https://phabricator.services.mozilla.com/D13492
gfx/webrender_bindings/revision.txt
gfx/wr/webrender/src/resource_cache.rs
--- a/gfx/webrender_bindings/revision.txt
+++ b/gfx/webrender_bindings/revision.txt
@@ -1,1 +1,1 @@
-7f5c575c965520adffc488c76d6b0f6b4cefe9fc
+835ba47f392c47a35c9baa2d44ec6cb1903b6f2b
--- a/gfx/wr/webrender/src/resource_cache.rs
+++ b/gfx/wr/webrender/src/resource_cache.rs
@@ -31,16 +31,17 @@ use image::{compute_tile_range, for_each
 use internal_types::{FastHashMap, FastHashSet, TextureSource, TextureUpdateList};
 use profiler::{ResourceProfileCounters, TextureCacheProfileCounters};
 use render_backend::{FrameId, FrameStamp};
 use render_task::{RenderTaskCache, RenderTaskCacheKey, RenderTaskId};
 use render_task::{RenderTaskCacheEntry, RenderTaskCacheEntryHandle, RenderTaskTree};
 use smallvec::SmallVec;
 use std::collections::hash_map::Entry::{self, Occupied, Vacant};
 use std::collections::hash_map::IterMut;
+use std::collections::VecDeque;
 use std::{cmp, mem};
 use std::fmt::Debug;
 use std::hash::Hash;
 use std::os::raw::c_void;
 #[cfg(any(feature = "capture", feature = "replay"))]
 use std::path::PathBuf;
 use std::sync::{Arc, RwLock};
 use texture_cache::{TextureCache, TextureCacheHandle, Eviction};
@@ -431,16 +432,19 @@ pub struct ResourceCache {
     rasterized_blob_images: FastHashMap<BlobImageKey, RasterizedBlob>,
     blob_image_templates: FastHashMap<BlobImageKey, BlobImageTemplate>,
 
     // If while building a frame we encounter blobs that we didn't already
     // rasterize, add them to this list and rasterize them synchronously.
     missing_blob_images: Vec<BlobImageParams>,
     // The rasterizer associated with the current scene.
     blob_image_rasterizer: Option<Box<AsyncBlobImageRasterizer>>,
+    // A log of the last three frames worth of deleted image keys kept
+    // for debugging purposes.
+    deleted_blob_keys: VecDeque<Vec<BlobImageKey>>
 }
 
 impl ResourceCache {
     pub fn new(
         texture_cache: TextureCache,
         glyph_rasterizer: GlyphRasterizer,
         blob_image_handler: Option<Box<BlobImageHandler>>,
     ) -> Self {
@@ -455,16 +459,18 @@ impl ResourceCache {
             current_frame_id: FrameId::INVALID,
             pending_image_requests: FastHashSet::default(),
             glyph_rasterizer,
             blob_image_handler,
             rasterized_blob_images: FastHashMap::default(),
             blob_image_templates: FastHashMap::default(),
             missing_blob_images: Vec::new(),
             blob_image_rasterizer: None,
+            // We want to keep three frames worth of delete blob keys
+            deleted_blob_keys: vec![Vec::new(), Vec::new(), Vec::new()].into(),
         }
     }
 
     pub fn max_texture_size(&self) -> i32 {
         self.texture_cache.max_texture_size()
     }
 
     fn should_tile(limit: i32, descriptor: &ImageDescriptor, data: &CachedImageData) -> bool {
@@ -883,16 +889,17 @@ impl ResourceCache {
         if let Some(mut cached) = self.cached_images.remove(&image_key) {
             cached.drop_from_cache(&mut self.texture_cache);
         }
 
         match value {
             Some(image) => if image.data.is_blob() {
                 let blob_key = BlobImageKey(image_key);
                 self.blob_image_handler.as_mut().unwrap().delete(blob_key);
+                self.deleted_blob_keys.back_mut().unwrap().push(blob_key);
                 self.blob_image_templates.remove(&blob_key);
                 self.rasterized_blob_images.remove(&blob_key);
             },
             None => {
                 warn!("Delete the non-exist key");
                 debug!("key={:?}", image_key);
             }
         }
@@ -1452,16 +1459,20 @@ impl ResourceCache {
 
     pub fn begin_frame(&mut self, stamp: FrameStamp) {
         debug_assert_eq!(self.state, State::Idle);
         self.state = State::AddResources;
         self.texture_cache.begin_frame(stamp);
         self.cached_glyphs.begin_frame(&self.texture_cache, &self.cached_render_tasks, &mut self.glyph_rasterizer);
         self.cached_render_tasks.begin_frame(&mut self.texture_cache);
         self.current_frame_id = stamp.frame_id();
+
+        // pop the old frame and push a new one
+        self.deleted_blob_keys.pop_front();
+        self.deleted_blob_keys.push_back(Vec::new());
     }
 
     pub fn block_until_all_resources_added(
         &mut self,
         gpu_cache: &mut GpuCache,
         render_tasks: &mut RenderTaskTree,
         texture_cache_profile: &mut TextureCacheProfileCounters,
     ) {
@@ -1497,16 +1508,22 @@ impl ResourceCache {
             return;
         }
 
         self.blob_image_handler
             .as_mut()
             .unwrap()
             .prepare_resources(&self.resources, &self.missing_blob_images);
 
+
+        for blob_image in &self.missing_blob_images {
+            if !self.blob_image_templates.contains_key(&blob_image.request.key) {
+                panic!("missing blob image key {:?} deleted: {:?}", blob_image, self.deleted_blob_keys);
+            }
+        }
         let is_low_priority = false;
         let rasterized_blobs = self.blob_image_rasterizer
             .as_mut()
             .unwrap()
             .rasterize(&self.missing_blob_images, is_low_priority);
 
         self.add_rasterized_blob_images(rasterized_blobs);