pub struct ImageCacheImpl {
store: Arc<Mutex<ImageCacheStore>>,
broken_image_icon_data: Arc<Vec<u8>>,
thread_pool: Arc<ThreadPool>,
fontdb: Arc<Database>,
}Fields§
§store: Arc<Mutex<ImageCacheStore>>Per-ImageCache data.
broken_image_icon_data: Arc<Vec<u8>>The data to use for the broken image icon used when images cannot load.
thread_pool: Arc<ThreadPool>Thread pool for image decoding. This is shared with other ImageCaches in the
same process.
fontdb: Arc<Database>A shared font database to be used by system fonts accessed when rasterizing vector
images. This is shared with other ImageCaches in the same process.
Implementations§
Source§impl ImageCacheImpl
impl ImageCacheImpl
Sourcefn add_listener_with_store(
&self,
store: &mut ImageCacheStore,
listener: ImageLoadListener,
)
fn add_listener_with_store( &self, store: &mut ImageCacheStore, listener: ImageLoadListener, )
Require self.store.lock() before calling.
Trait Implementations§
Source§impl ImageCache for ImageCacheImpl
impl ImageCache for ImageCacheImpl
Source§fn add_listener(&self, listener: ImageLoadListener)
fn add_listener(&self, listener: ImageLoadListener)
Add a new listener for the given pending image id. If the image is already present, the responder will still receive the expected response.
Source§fn notify_pending_response(&self, id: PendingImageId, action: FetchResponseMsg)
fn notify_pending_response(&self, id: PendingImageId, action: FetchResponseMsg)
Inform the image cache about a response for a pending request.
fn memory_report(&self, prefix: &str, ops: &mut MallocSizeOfOps) -> Report
Source§fn get_image_key(&self) -> Option<WebRenderImageKey>
fn get_image_key(&self) -> Option<WebRenderImageKey>
Source§fn get_image(
&self,
url: ServoUrl,
origin: ImmutableOrigin,
cors_setting: Option<CorsSettings>,
) -> Option<Image>
fn get_image( &self, url: ServoUrl, origin: ImmutableOrigin, cors_setting: Option<CorsSettings>, ) -> Option<Image>
Definitively check whether there is a cached, fully loaded image available.
fn get_cached_image_status( &self, url: ServoUrl, origin: ImmutableOrigin, cors_setting: Option<CorsSettings>, ) -> ImageCacheResult
Source§fn add_rasterization_complete_listener(
&self,
pipeline_id: PipelineId,
image_id: PendingImageId,
requested_size: DeviceIntSize,
callback: ImageCacheResponseCallback,
)
fn add_rasterization_complete_listener( &self, pipeline_id: PipelineId, image_id: PendingImageId, requested_size: DeviceIntSize, callback: ImageCacheResponseCallback, )
Adds a new listener to be notified once the given
image_id has been rasterized at
the given size. The listener will receive a VectorImageRasterizationComplete
message on the given sender, even if the listener is called after rasterization
at has already completed.Source§fn rasterize_vector_image(
&self,
image_id: PendingImageId,
requested_size: DeviceIntSize,
) -> Option<RasterImage>
fn rasterize_vector_image( &self, image_id: PendingImageId, requested_size: DeviceIntSize, ) -> Option<RasterImage>
Returns
Some if the given image_id has already been rasterized at the given size.
Otherwise, triggers a new job to perform the rasterization. If a notification
is needed after rasterization is completed, the add_rasterization_complete_listener
API below can be used to add a listener.Source§fn fill_key_cache_with_batch_of_keys(&self, image_keys: Vec<WebRenderImageKey>)
fn fill_key_cache_with_batch_of_keys(&self, image_keys: Vec<WebRenderImageKey>)
Fills the image cache with a batch of keys.
Source§fn get_broken_image_icon(&self) -> Option<Arc<RasterImage>>
fn get_broken_image_icon(&self) -> Option<Arc<RasterImage>>
Synchronously get the broken image icon for this
ImageCache. This will
allocate space for this icon and upload it to WebRender.Auto Trait Implementations§
impl Freeze for ImageCacheImpl
impl !RefUnwindSafe for ImageCacheImpl
impl Send for ImageCacheImpl
impl Sync for ImageCacheImpl
impl Unpin for ImageCacheImpl
impl !UnwindSafe for ImageCacheImpl
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert