mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Fetch complete images from the cache for canvas operations.
This commit is contained in:
parent
c890c9143c
commit
541ecbfe21
1 changed files with 11 additions and 10 deletions
|
@ -337,18 +337,19 @@ impl<'a> From<&'a WebGLContextAttributes> for GLContextAttributes {
|
||||||
|
|
||||||
pub mod utils {
|
pub mod utils {
|
||||||
use dom::window::Window;
|
use dom::window::Window;
|
||||||
use net_traits::image_cache_thread::ImageResponse;
|
use net_traits::image_cache_thread::{ImageResponse, UsePlaceholder, ImageOrMetadataAvailable};
|
||||||
|
use net_traits::image_cache_thread::CanRequestImages;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
|
|
||||||
pub fn request_image_from_cache(window: &Window, url: ServoUrl) -> ImageResponse {
|
pub fn request_image_from_cache(window: &Window, url: ServoUrl) -> ImageResponse {
|
||||||
panic!()
|
let image_cache = window.image_cache_thread();
|
||||||
/*let image_cache = window.image_cache_thread();
|
//XXXjdm add a image cache mode that doesn't store anything for NotRequested?
|
||||||
let (response_chan, response_port) = ipc::channel().unwrap();
|
let response =
|
||||||
image_cache.request_image(url.into(), ImageCacheChan(response_chan), None);
|
image_cache.find_image_or_metadata(url.into(), UsePlaceholder::No);
|
||||||
let result = response_port.recv().unwrap();
|
match response {
|
||||||
match result {
|
Ok(ImageOrMetadataAvailable::ImageAvailable(image)) =>
|
||||||
ImageCacheResult::InitiateRequest(..) => panic!("unexpected image request initiator"),
|
ImageResponse::Loaded(image),
|
||||||
ImageCacheResult::Response(result) => result.image_response,
|
_ => ImageResponse::None,
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue