Skip to content
Permalink
Browse files
Updated canvas_state and window
  • Loading branch information
JayalakshmiV committed Apr 22, 2020
1 parent 81b30d6 commit 16664d46b051b9b26b11963966b58b3e89da3dae
Showing 2 changed files with 6 additions and 2 deletions.
@@ -233,7 +233,7 @@ impl CanvasState {
}
}

fn fetch_image_data(
pub fn fetch_image_data(
&self,
url: ServoUrl,
cors_setting: Option<CorsSettings>,
@@ -141,6 +141,7 @@ use style_traits::{CSSPixel, DevicePixel, ParsingMode};
use url::Position;
use webrender_api::units::{DeviceIntPoint, DeviceIntSize, LayoutPixel};
use webrender_api::{DocumentId, ExternalScrollId};
use canvas_state::Fetch_image_data;

/// Current state of the window object
#[derive(Clone, Copy, Debug, JSTraceable, MallocSizeOf, PartialEq)]
@@ -915,7 +916,10 @@ impl WindowMethods for Window {
if !canvas.is_valid() {
p.reject_error(Error::InvalidState)
}
// imageBitmap.bitmap_data = image.bitmap_data;
let url = self.get_url().into_string();
let (mut image_data, image_size) = image.fetch_image_data(url)
.ok_or(Error::InvalidState)?;
imageBitmap.bitmap_data = image_data;
let mut imageBitmap.origin_clean = image.origin_clean;
p.resolve_native(&());
}

0 comments on commit 16664d4

Please sign in to comment.