Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflicts resolved in conflicting files. OffscreenCanvas ready to be merged. #19067

Closed
wants to merge 11 commits into from

OffscreenCanvasRenderingContext2D functionality shared with CanvasRen…

…deringContext2D
  • Loading branch information
gauraangkhurana committed Dec 3, 2017
commit e982909ab2ef50c6456a00aeb01e795405bc5c93
@@ -239,7 +239,7 @@ impl CanvasRenderingContext2D {
}

// https://html.spec.whatwg.org/multipage/#the-image-argument-is-not-origin-clean
fn is_origin_clean(&self,
pub fn is_origin_clean(&self,
image: CanvasImageSource)
-> bool {
match image {
@@ -282,7 +282,7 @@ impl CanvasRenderingContext2D {
// is copied on the rectangle (dx, dy, dh, dw) of the destination canvas
//
// https://html.spec.whatwg.org/multipage/#dom-context-2d-drawimage
fn draw_image(&self,
pub fn draw_image(&self,
image: CanvasImageSource,
sx: f64,
sy: f64,
@@ -327,7 +327,7 @@ impl CanvasRenderingContext2D {
result
}

fn draw_html_canvas_element(&self,
pub fn draw_html_canvas_element(&self,
canvas: &HTMLCanvasElement,
sx: f64,
sy: f64,
@@ -395,7 +395,7 @@ impl CanvasRenderingContext2D {
Ok(())
}

fn fetch_and_draw_image_data(&self,
pub fn fetch_and_draw_image_data(&self,
url: ServoUrl,
sx: f64,
sy: f64,
@@ -469,7 +469,7 @@ impl CanvasRenderingContext2D {
Ok(())
}

fn fetch_image_data(&self, url: ServoUrl) -> Option<(Vec<u8>, Size2D<i32>)> {
pub fn fetch_image_data(&self, url: ServoUrl) -> Option<(Vec<u8>, Size2D<i32>)> {
let img = match self.request_image_from_cache(url) {
ImageResponse::Loaded(img, _) => img,
ImageResponse::PlaceholderLoaded(_, _) |
@@ -491,7 +491,7 @@ impl CanvasRenderingContext2D {
}

#[inline]
fn request_image_from_cache(&self, url: ServoUrl) -> ImageResponse {
pub fn request_image_from_cache(&self, url: ServoUrl) -> ImageResponse {
let response = self.image_cache
.find_image_or_metadata(url.clone(),
UsePlaceholder::No,
@@ -577,7 +577,7 @@ impl CanvasRenderingContext2D {
self.origin_clean.get()
}

fn set_origin_unclean(&self) {
pub fn set_origin_unclean(&self) {
self.origin_clean.set(false)
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.