diff options
author | Martin Robinson <mrobinson@igalia.com> | 2020-04-30 15:38:56 +0200 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2020-05-05 15:13:35 +0200 |
commit | b585ce5b1f181996b2f8109a4e045eb6f5b3e2a0 (patch) | |
tree | 2b99b00e665a8aef857f89f355eef9f269095368 /components/net/image_cache.rs | |
parent | 5e44327325cdc92dffa40b92394e8b2b68df97e0 (diff) | |
download | servo-b585ce5b1f181996b2f8109a4e045eb6f5b3e2a0.tar.gz servo-b585ce5b1f181996b2f8109a4e045eb6f5b3e2a0.zip |
Use a restyle for animation ticks
This change corrects synchronization issues with animations, by
reworking the animation processing model to do a quick restyle and
incremental layout when ticking animations.
While this change adds overhead to animation ticks, the idea is that
this will be the fallback when synchronous behavior is required to
fulfill specification requirements. In the optimistic case, many
animations could be updated and applied off-the-main-thread and then
resynchronized when style information is queried by script.
Fixes #13865.
Diffstat (limited to 'components/net/image_cache.rs')
-rw-r--r-- | components/net/image_cache.rs | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/components/net/image_cache.rs b/components/net/image_cache.rs index fea75ee7b95..95379770883 100644 --- a/components/net/image_cache.rs +++ b/components/net/image_cache.rs @@ -7,8 +7,7 @@ use immeta::load_from_buf; use ipc_channel::ipc::IpcSender; use net_traits::image::base::{load_from_memory, Image, ImageMetadata}; use net_traits::image_cache::{ - CanRequestImages, CorsStatus, ImageCache, ImageCacheResult, ImageResponder, - PendingImageResponse, + CorsStatus, ImageCache, ImageCacheResult, ImageResponder, PendingImageResponse, }; use net_traits::image_cache::{ImageOrMetadataAvailable, ImageResponse}; use net_traits::image_cache::{PendingImageId, UsePlaceholder}; @@ -147,7 +146,6 @@ impl AllPendingLoads { url: ServoUrl, origin: ImmutableOrigin, cors_status: Option<CorsSettings>, - can_request: CanRequestImages, ) -> CacheResult<'a> { match self .url_to_load_key @@ -158,10 +156,6 @@ impl AllPendingLoads { CacheResult::Hit(*load_key, self.loads.get_mut(load_key).unwrap()) }, Vacant(url_entry) => { - if can_request == CanRequestImages::No { - return CacheResult::Miss(None); - } - let load_key = self.keygen.next(); url_entry.insert(load_key); @@ -461,7 +455,6 @@ impl ImageCache for ImageCacheImpl { origin: ImmutableOrigin, cors_setting: Option<CorsSettings>, use_placeholder: UsePlaceholder, - can_request: CanRequestImages, ) -> ImageCacheResult { let mut store = self.store.lock().unwrap(); if let Some(result) = store.get_completed_image_if_available( @@ -485,12 +478,9 @@ impl ImageCache for ImageCacheImpl { } let decoded = { - let result = store.pending_loads.get_cached( - url.clone(), - origin.clone(), - cors_setting, - can_request, - ); + let result = store + .pending_loads + .get_cached(url.clone(), origin.clone(), cors_setting); match result { CacheResult::Hit(key, pl) => match (&pl.result, &pl.metadata) { (&Some(Ok(_)), _) => { @@ -539,7 +529,6 @@ impl ImageCache for ImageCacheImpl { cors_setting: Option<CorsSettings>, sender: IpcSender<PendingImageResponse>, use_placeholder: UsePlaceholder, - can_request: CanRequestImages, ) -> ImageCacheResult { debug!("Track image for {} ({:?})", url, origin); let cache_result = self.get_cached_image_status( @@ -547,7 +536,6 @@ impl ImageCache for ImageCacheImpl { origin.clone(), cors_setting, use_placeholder, - can_request, ); match cache_result { |