Auto merge of #23135 - maharsh312:master, r=jdm

Create CanvasRect for OffscreenCanvas

<!-- Please describe your changes on the following line: -->

Created CanvasRect fot OffscreenCanvas and Updated Testcases

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23135)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-05-13 16:19:57 -04:00 committed by GitHub
commit fdafc833ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
131 changed files with 145 additions and 551 deletions

1
.gitignore vendored
View file

@ -3,6 +3,7 @@
!/.cargo/config.* !/.cargo/config.*
/.servobuild /.servobuild
/.wpt /.wpt
/.vs
/android-toolchains /android-toolchains
/target /target
/ports/android/bin /ports/android/bin

View file

@ -176,7 +176,7 @@ pub struct CanvasData<'a> {
impl<'a> CanvasData<'a> { impl<'a> CanvasData<'a> {
pub fn new( pub fn new(
size: Size2D<u32>, size: Size2D<u64>,
webrender_api_sender: webrender_api::RenderApiSender, webrender_api_sender: webrender_api::RenderApiSender,
antialias: AntialiasMode, antialias: AntialiasMode,
canvas_id: CanvasId, canvas_id: CanvasId,
@ -708,13 +708,13 @@ impl<'a> CanvasData<'a> {
.set_composition_op(op.to_azure_style()); .set_composition_op(op.to_azure_style());
} }
pub fn create(size: Size2D<u32>) -> DrawTarget { pub fn create(size: Size2D<u64>) -> DrawTarget {
// FIXME(nox): Why is the size made of i32 values? // FIXME(nox): Why is the size made of i32 values?
DrawTarget::new(BackendType::Skia, size.to_i32(), SurfaceFormat::B8G8R8A8) DrawTarget::new(BackendType::Skia, size.to_i32(), SurfaceFormat::B8G8R8A8)
} }
pub fn recreate(&mut self, size: Size2D<u32>) { pub fn recreate(&mut self, size: Size2D<u32>) {
self.drawtarget = CanvasData::create(size); self.drawtarget = CanvasData::create(Size2D::new(size.width as u64, size.height as u64));
self.state = CanvasPaintState::new(self.state.draw_options.antialias); self.state = CanvasPaintState::new(self.state.draw_options.antialias);
self.saved_states.clear(); self.saved_states.clear();
// Webrender doesn't let images change size, so we clear the webrender image key. // Webrender doesn't let images change size, so we clear the webrender image key.

View file

@ -77,7 +77,7 @@ impl<'a> CanvasPaintThread<'a> {
pub fn create_canvas( pub fn create_canvas(
&mut self, &mut self,
size: Size2D<u32>, size: Size2D<u64>,
webrender_api_sender: webrender_api::RenderApiSender, webrender_api_sender: webrender_api::RenderApiSender,
antialias: bool, antialias: bool,
) -> CanvasId { ) -> CanvasId {

View file

@ -23,7 +23,7 @@ pub enum CanvasMsg {
Canvas2d(Canvas2dMsg, CanvasId), Canvas2d(Canvas2dMsg, CanvasId),
Create( Create(
IpcSender<CanvasId>, IpcSender<CanvasId>,
Size2D<u32>, Size2D<u64>,
webrender_api::RenderApiSender, webrender_api::RenderApiSender,
bool, bool,
), ),

View file

@ -3108,7 +3108,7 @@ where
fn handle_create_canvas_paint_thread_msg( fn handle_create_canvas_paint_thread_msg(
&mut self, &mut self,
size: Size2D<u32>, size: Size2D<u64>,
response_sender: IpcSender<(IpcSender<CanvasMsg>, CanvasId)>, response_sender: IpcSender<(IpcSender<CanvasMsg>, CanvasId)>,
) { ) {
let webrender_api = self.webrender_api_sender.clone(); let webrender_api = self.webrender_api_sender.clone();

View file

@ -62,8 +62,6 @@ enum CanvasFillOrStrokeStyle {
#[dom_struct] #[dom_struct]
pub struct CanvasRenderingContext2D { pub struct CanvasRenderingContext2D {
reflector_: Reflector, reflector_: Reflector,
#[ignore_malloc_size_of = "Defined in ipc-channel"]
ipc_renderer: IpcSender<CanvasMsg>,
/// For rendering contexts created by an HTML canvas element, this is Some, /// For rendering contexts created by an HTML canvas element, this is Some,
/// for ones created by a paint worklet, this is None. /// for ones created by a paint worklet, this is None.
canvas: Option<Dom<HTMLCanvasElement>>, canvas: Option<Dom<HTMLCanvasElement>>,
@ -77,7 +75,7 @@ pub struct CanvasRenderingContext2D {
state: DomRefCell<CanvasContextState>, state: DomRefCell<CanvasContextState>,
saved_states: DomRefCell<Vec<CanvasContextState>>, saved_states: DomRefCell<Vec<CanvasContextState>>,
origin_clean: Cell<bool>, origin_clean: Cell<bool>,
canvas_id: CanvasId, canvas_state: DomRefCell<CanvasState>,
} }
#[must_root] #[must_root]
@ -121,14 +119,15 @@ impl CanvasContextState {
} }
} }
impl CanvasRenderingContext2D { #[derive(JSTraceable, MallocSizeOf)]
pub fn new_inherited( pub struct CanvasState {
global: &GlobalScope, #[ignore_malloc_size_of = "Defined in ipc-channel"]
canvas: Option<&HTMLCanvasElement>, ipc_renderer: IpcSender<CanvasMsg>,
image_cache: Arc<dyn ImageCache>, canvas_id: CanvasId,
base_url: ServoUrl, }
size: Size2D<u32>,
) -> CanvasRenderingContext2D { impl CanvasState {
pub fn new(global: &GlobalScope, size: Size2D<u64>) -> CanvasState {
debug!("Creating new canvas rendering context."); debug!("Creating new canvas rendering context.");
let (sender, receiver) = let (sender, receiver) =
profiled_ipc::channel(global.time_profiler_chan().clone()).unwrap(); profiled_ipc::channel(global.time_profiler_chan().clone()).unwrap();
@ -139,9 +138,69 @@ impl CanvasRenderingContext2D {
.unwrap(); .unwrap();
let (ipc_renderer, canvas_id) = receiver.recv().unwrap(); let (ipc_renderer, canvas_id) = receiver.recv().unwrap();
debug!("Done."); debug!("Done.");
CanvasState {
ipc_renderer: ipc_renderer,
canvas_id: canvas_id,
}
}
pub fn get_canvas_id(&self) -> CanvasId {
self.canvas_id.clone()
}
pub fn send_canvas_2d_msg(&self, msg: Canvas2dMsg) {
self.ipc_renderer
.send(CanvasMsg::Canvas2d(msg, self.get_canvas_id()))
.unwrap()
}
fn create_drawable_rect(&self, x: f64, y: f64, w: f64, h: f64) -> Option<Rect<f32>> {
if !([x, y, w, h].iter().all(|val| val.is_finite())) {
return None;
}
if w == 0.0 && h == 0.0 {
return None;
}
Some(Rect::new(
Point2D::new(x as f32, y as f32),
Size2D::new(w as f32, h as f32),
))
}
// https://html.spec.whatwg.org/multipage/#dom-context-2d-fillrect
pub fn FillRect(&self, x: f64, y: f64, width: f64, height: f64) {
if let Some(rect) = self.create_drawable_rect(x, y, width, height) {
self.send_canvas_2d_msg(Canvas2dMsg::FillRect(rect));
}
}
// https://html.spec.whatwg.org/multipage/#dom-context-2d-clearrect
pub fn ClearRect(&self, x: f64, y: f64, width: f64, height: f64) {
if let Some(rect) = self.create_drawable_rect(x, y, width, height) {
self.send_canvas_2d_msg(Canvas2dMsg::ClearRect(rect));
}
}
// https://html.spec.whatwg.org/multipage/#dom-context-2d-strokerect
pub fn StrokeRect(&self, x: f64, y: f64, width: f64, height: f64) {
if let Some(rect) = self.create_drawable_rect(x, y, width, height) {
self.send_canvas_2d_msg(Canvas2dMsg::StrokeRect(rect));
}
}
}
impl CanvasRenderingContext2D {
pub fn new_inherited(
global: &GlobalScope,
canvas: Option<&HTMLCanvasElement>,
image_cache: Arc<dyn ImageCache>,
base_url: ServoUrl,
size: Size2D<u32>,
) -> CanvasRenderingContext2D {
CanvasRenderingContext2D { CanvasRenderingContext2D {
reflector_: Reflector::new(), reflector_: Reflector::new(),
ipc_renderer: ipc_renderer,
canvas: canvas.map(Dom::from_ref), canvas: canvas.map(Dom::from_ref),
image_cache: image_cache, image_cache: image_cache,
missing_image_urls: DomRefCell::new(Vec::new()), missing_image_urls: DomRefCell::new(Vec::new()),
@ -149,7 +208,10 @@ impl CanvasRenderingContext2D {
state: DomRefCell::new(CanvasContextState::new()), state: DomRefCell::new(CanvasContextState::new()),
saved_states: DomRefCell::new(Vec::new()), saved_states: DomRefCell::new(Vec::new()),
origin_clean: Cell::new(true), origin_clean: Cell::new(true),
canvas_id: canvas_id, canvas_state: DomRefCell::new(CanvasState::new(
global,
Size2D::new(size.width as u64, size.height as u64),
)),
} }
} }
@ -174,8 +236,13 @@ impl CanvasRenderingContext2D {
// https://html.spec.whatwg.org/multipage/#concept-canvas-set-bitmap-dimensions // https://html.spec.whatwg.org/multipage/#concept-canvas-set-bitmap-dimensions
pub fn set_bitmap_dimensions(&self, size: Size2D<u32>) { pub fn set_bitmap_dimensions(&self, size: Size2D<u32>) {
self.reset_to_initial_state(); self.reset_to_initial_state();
self.ipc_renderer self.canvas_state
.send(CanvasMsg::Recreate(size, self.get_canvas_id())) .borrow()
.ipc_renderer
.send(CanvasMsg::Recreate(
size,
self.canvas_state.borrow().get_canvas_id(),
))
.unwrap(); .unwrap();
} }
@ -366,7 +433,7 @@ impl CanvasRenderingContext2D {
match *context { match *context {
CanvasContext::Context2d(ref context) => { CanvasContext::Context2d(ref context) => {
context.send_canvas_2d_msg(Canvas2dMsg::DrawImageInOther( context.send_canvas_2d_msg(Canvas2dMsg::DrawImageInOther(
self.get_canvas_id(), self.canvas_state.borrow().get_canvas_id(),
image_size, image_size,
dest_rect, dest_rect,
source_rect, source_rect,
@ -475,21 +542,6 @@ impl CanvasRenderingContext2D {
mem::replace(&mut self.missing_image_urls.borrow_mut(), vec![]) mem::replace(&mut self.missing_image_urls.borrow_mut(), vec![])
} }
fn create_drawable_rect(&self, x: f64, y: f64, w: f64, h: f64) -> Option<Rect<f32>> {
if !([x, y, w, h].iter().all(|val| val.is_finite())) {
return None;
}
if w == 0.0 && h == 0.0 {
return None;
}
Some(Rect::new(
Point2D::new(x as f32, y as f32),
Size2D::new(w as f32, h as f32),
))
}
fn parse_color(&self, string: &str) -> Result<RGBA, ()> { fn parse_color(&self, string: &str) -> Result<RGBA, ()> {
let mut input = ParserInput::new(string); let mut input = ParserInput::new(string);
let mut parser = Parser::new(&mut input); let mut parser = Parser::new(&mut input);
@ -528,17 +580,15 @@ impl CanvasRenderingContext2D {
} }
pub fn get_canvas_id(&self) -> CanvasId { pub fn get_canvas_id(&self) -> CanvasId {
self.canvas_id.clone() self.canvas_state.borrow().get_canvas_id()
} }
pub fn send_canvas_2d_msg(&self, msg: Canvas2dMsg) { pub fn send_canvas_2d_msg(&self, msg: Canvas2dMsg) {
self.ipc_renderer self.canvas_state.borrow().send_canvas_2d_msg(msg)
.send(CanvasMsg::Canvas2d(msg, self.get_canvas_id()))
.unwrap()
} }
pub fn get_ipc_renderer(&self) -> IpcSender<CanvasMsg> { pub fn get_ipc_renderer(&self) -> IpcSender<CanvasMsg> {
self.ipc_renderer.clone() self.canvas_state.borrow().ipc_renderer.clone()
} }
pub fn origin_is_clean(&self) -> bool { pub fn origin_is_clean(&self) -> bool {
@ -585,12 +635,19 @@ pub trait LayoutCanvasRenderingContext2DHelpers {
impl LayoutCanvasRenderingContext2DHelpers for LayoutDom<CanvasRenderingContext2D> { impl LayoutCanvasRenderingContext2DHelpers for LayoutDom<CanvasRenderingContext2D> {
#[allow(unsafe_code)] #[allow(unsafe_code)]
unsafe fn get_ipc_renderer(&self) -> IpcSender<CanvasMsg> { unsafe fn get_ipc_renderer(&self) -> IpcSender<CanvasMsg> {
(*self.unsafe_get()).ipc_renderer.clone() (*self.unsafe_get())
.canvas_state
.borrow_for_layout()
.ipc_renderer
.clone()
} }
#[allow(unsafe_code)] #[allow(unsafe_code)]
unsafe fn get_canvas_id(&self) -> CanvasId { unsafe fn get_canvas_id(&self) -> CanvasId {
(*self.unsafe_get()).canvas_id.clone() (*self.unsafe_get())
.canvas_state
.borrow_for_layout()
.get_canvas_id()
} }
} }
@ -747,26 +804,20 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D {
// https://html.spec.whatwg.org/multipage/#dom-context-2d-fillrect // https://html.spec.whatwg.org/multipage/#dom-context-2d-fillrect
fn FillRect(&self, x: f64, y: f64, width: f64, height: f64) { fn FillRect(&self, x: f64, y: f64, width: f64, height: f64) {
if let Some(rect) = self.create_drawable_rect(x, y, width, height) { self.canvas_state.borrow().FillRect(x, y, width, height);
self.send_canvas_2d_msg(Canvas2dMsg::FillRect(rect)); self.mark_as_dirty();
self.mark_as_dirty();
}
} }
// https://html.spec.whatwg.org/multipage/#dom-context-2d-clearrect // https://html.spec.whatwg.org/multipage/#dom-context-2d-clearrect
fn ClearRect(&self, x: f64, y: f64, width: f64, height: f64) { fn ClearRect(&self, x: f64, y: f64, width: f64, height: f64) {
if let Some(rect) = self.create_drawable_rect(x, y, width, height) { self.canvas_state.borrow().ClearRect(x, y, width, height);
self.send_canvas_2d_msg(Canvas2dMsg::ClearRect(rect)); self.mark_as_dirty();
self.mark_as_dirty();
}
} }
// https://html.spec.whatwg.org/multipage/#dom-context-2d-strokerect // https://html.spec.whatwg.org/multipage/#dom-context-2d-strokerect
fn StrokeRect(&self, x: f64, y: f64, width: f64, height: f64) { fn StrokeRect(&self, x: f64, y: f64, width: f64, height: f64) {
if let Some(rect) = self.create_drawable_rect(x, y, width, height) { self.canvas_state.borrow().StrokeRect(x, y, width, height);
self.send_canvas_2d_msg(Canvas2dMsg::StrokeRect(rect)); self.mark_as_dirty();
self.mark_as_dirty();
}
} }
// https://html.spec.whatwg.org/multipage/#dom-context-2d-beginpath // https://html.spec.whatwg.org/multipage/#dom-context-2d-beginpath
@ -1458,8 +1509,10 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D {
impl Drop for CanvasRenderingContext2D { impl Drop for CanvasRenderingContext2D {
fn drop(&mut self) { fn drop(&mut self) {
if let Err(err) = self if let Err(err) = self
.canvas_state
.borrow()
.ipc_renderer .ipc_renderer
.send(CanvasMsg::Close(self.get_canvas_id())) .send(CanvasMsg::Close(self.canvas_state.borrow().get_canvas_id()))
{ {
warn!("Could not close canvas: {}", err) warn!("Could not close canvas: {}", err)
} }

View file

@ -2,10 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::OffscreenCanvasRenderingContext2DBinding; use crate::dom::bindings::codegen::Bindings::OffscreenCanvasRenderingContext2DBinding;
use crate::dom::bindings::codegen::Bindings::OffscreenCanvasRenderingContext2DBinding::OffscreenCanvasRenderingContext2DMethods; use crate::dom::bindings::codegen::Bindings::OffscreenCanvasRenderingContext2DBinding::OffscreenCanvasRenderingContext2DMethods;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector}; use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::{Dom, DomRoot}; use crate::dom::bindings::root::{Dom, DomRoot};
use crate::dom::canvasrenderingcontext2d::CanvasState;
use crate::dom::globalscope::GlobalScope; use crate::dom::globalscope::GlobalScope;
use crate::dom::offscreencanvas::OffscreenCanvas; use crate::dom::offscreencanvas::OffscreenCanvas;
use dom_struct::dom_struct; use dom_struct::dom_struct;
@ -15,33 +17,35 @@ use euclid::Size2D;
pub struct OffscreenCanvasRenderingContext2D { pub struct OffscreenCanvasRenderingContext2D {
reflector_: Reflector, reflector_: Reflector,
canvas: Option<Dom<OffscreenCanvas>>, canvas: Option<Dom<OffscreenCanvas>>,
canvas_state: DomRefCell<CanvasState>,
} }
impl OffscreenCanvasRenderingContext2D { impl OffscreenCanvasRenderingContext2D {
pub fn new_inherited( pub fn new_inherited(
_global: &GlobalScope, global: &GlobalScope,
canvas: Option<&OffscreenCanvas>, canvas: Option<&OffscreenCanvas>,
_size: Size2D<u64>, size: Size2D<u64>,
) -> OffscreenCanvasRenderingContext2D { ) -> OffscreenCanvasRenderingContext2D {
OffscreenCanvasRenderingContext2D { OffscreenCanvasRenderingContext2D {
reflector_: Reflector::new(), reflector_: Reflector::new(),
canvas: canvas.map(Dom::from_ref), canvas: canvas.map(Dom::from_ref),
canvas_state: DomRefCell::new(CanvasState::new(global, size)),
} }
} }
pub fn new( pub fn new(
_global: &GlobalScope, global: &GlobalScope,
canvas: &OffscreenCanvas, canvas: &OffscreenCanvas,
_size: Size2D<u64>, size: Size2D<u64>,
) -> DomRoot<OffscreenCanvasRenderingContext2D> { ) -> DomRoot<OffscreenCanvasRenderingContext2D> {
let boxed = Box::new(OffscreenCanvasRenderingContext2D::new_inherited( let boxed = Box::new(OffscreenCanvasRenderingContext2D::new_inherited(
_global, global,
Some(canvas), Some(canvas),
_size, size,
)); ));
reflect_dom_object( reflect_dom_object(
boxed, boxed,
_global, global,
OffscreenCanvasRenderingContext2DBinding::Wrap, OffscreenCanvasRenderingContext2DBinding::Wrap,
) )
} }
@ -52,4 +56,19 @@ impl OffscreenCanvasRenderingContext2DMethods for OffscreenCanvasRenderingContex
fn Canvas(&self) -> DomRoot<OffscreenCanvas> { fn Canvas(&self) -> DomRoot<OffscreenCanvas> {
DomRoot::from_ref(self.canvas.as_ref().expect("No canvas.")) DomRoot::from_ref(self.canvas.as_ref().expect("No canvas."))
} }
// https://html.spec.whatwg.org/multipage/#dom-context-2d-fillrect
fn FillRect(&self, x: f64, y: f64, width: f64, height: f64) {
self.canvas_state.borrow().FillRect(x, y, width, height);
}
// https://html.spec.whatwg.org/multipage/#dom-context-2d-clearrect
fn ClearRect(&self, x: f64, y: f64, width: f64, height: f64) {
self.canvas_state.borrow().ClearRect(x, y, width, height);
}
// https://html.spec.whatwg.org/multipage/#dom-context-2d-strokerect
fn StrokeRect(&self, x: f64, y: f64, width: f64, height: f64) {
self.canvas_state.borrow().StrokeRect(x, y, width, height);
}
} }

View file

@ -111,7 +111,7 @@ interface CanvasFilters {
//attribute DOMString filter; // (default "none") //attribute DOMString filter; // (default "none")
}; };
[Exposed=(PaintWorklet, Window), NoInterfaceObject] [Exposed=(PaintWorklet, Window, Worker), NoInterfaceObject]
interface CanvasRect { interface CanvasRect {
// rects // rects
void clearRect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h); void clearRect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h);

View file

@ -8,6 +8,8 @@ interface OffscreenCanvasRenderingContext2D {
//void commit(); //void commit();
readonly attribute OffscreenCanvas canvas; readonly attribute OffscreenCanvas canvas;
}; };
OffscreenCanvasRenderingContext2D implements CanvasRect;
//OffscreenCanvasRenderingContext2D includes CanvasState; //OffscreenCanvasRenderingContext2D includes CanvasState;
//OffscreenCanvasRenderingContext2D includes CanvasTransform; //OffscreenCanvasRenderingContext2D includes CanvasTransform;
@ -16,7 +18,6 @@ interface OffscreenCanvasRenderingContext2D {
//OffscreenCanvasRenderingContext2D includes CanvasFillStrokeStyles; //OffscreenCanvasRenderingContext2D includes CanvasFillStrokeStyles;
//OffscreenCanvasRenderingContext2D includes CanvasShadowStyles; //OffscreenCanvasRenderingContext2D includes CanvasShadowStyles;
//OffscreenCanvasRenderingContext2D includes CanvasFilters; //OffscreenCanvasRenderingContext2D includes CanvasFilters;
//OffscreenCanvasRenderingContext2D includes CanvasRect;
//OffscreenCanvasRenderingContext2D includes CanvasDrawPath; //OffscreenCanvasRenderingContext2D includes CanvasDrawPath;
//OffscreenCanvasRenderingContext2D includes CanvasText; //OffscreenCanvasRenderingContext2D includes CanvasText;
//OffscreenCanvasRenderingContext2D includes CanvasDrawImage; //OffscreenCanvasRenderingContext2D includes CanvasDrawImage;
@ -24,3 +25,7 @@ interface OffscreenCanvasRenderingContext2D {
//OffscreenCanvasRenderingContext2D includes CanvasPathDrawingStyles; //OffscreenCanvasRenderingContext2D includes CanvasPathDrawingStyles;
//OffscreenCanvasRenderingContext2D includes CanvasTextDrawingStyles; //OffscreenCanvasRenderingContext2D includes CanvasTextDrawingStyles;
//OffscreenCanvasRenderingContext2D includes CanvasPath; //OffscreenCanvasRenderingContext2D includes CanvasPath;

View file

@ -118,7 +118,7 @@ pub enum ScriptMsg {
ChangeRunningAnimationsState(AnimationState), ChangeRunningAnimationsState(AnimationState),
/// Requests that a new 2D canvas thread be created. (This is done in the constellation because /// Requests that a new 2D canvas thread be created. (This is done in the constellation because
/// 2D canvases may use the GPU and we don't want to give untrusted content access to the GPU.) /// 2D canvases may use the GPU and we don't want to give untrusted content access to the GPU.)
CreateCanvasPaintThread(Size2D<u32>, IpcSender<(IpcSender<CanvasMsg>, CanvasId)>), CreateCanvasPaintThread(Size2D<u64>, IpcSender<(IpcSender<CanvasMsg>, CanvasId)>),
/// Notifies the constellation that this frame has received focus. /// Notifies the constellation that this frame has received focus.
Focus, Focus,
/// Requests that the constellation retrieve the current contents of the clipboard /// Requests that the constellation retrieve the current contents of the clipboard

View file

@ -1,4 +0,0 @@
[2d.composite.globalAlpha.image.html]
[OffscreenCanvas test: 2d.composite.globalAlpha.image]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.globalAlpha.image.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.globalAlpha.imagepattern.html]
[OffscreenCanvas test: 2d.composite.globalAlpha.imagepattern]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.globalAlpha.imagepattern.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.image.copy.html]
[OffscreenCanvas test: 2d.composite.image.copy]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.image.copy.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.image.destination-atop.html]
[OffscreenCanvas test: 2d.composite.image.destination-atop]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.image.destination-atop.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.image.destination-in.html]
[OffscreenCanvas test: 2d.composite.image.destination-in]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.image.destination-in.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.image.destination-out.html]
[OffscreenCanvas test: 2d.composite.image.destination-out]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.image.destination-out.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.image.destination-over.html]
[OffscreenCanvas test: 2d.composite.image.destination-over]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.image.destination-over.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.image.lighter.html]
[OffscreenCanvas test: 2d.composite.image.lighter]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.image.lighter.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.image.source-atop.html]
[OffscreenCanvas test: 2d.composite.image.source-atop]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.image.source-atop.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.image.source-in.html]
[OffscreenCanvas test: 2d.composite.image.source-in]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.image.source-in.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.image.source-out.html]
[OffscreenCanvas test: 2d.composite.image.source-out]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.image.source-out.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.image.source-over.html]
[OffscreenCanvas test: 2d.composite.image.source-over]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.image.source-over.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.image.xor.html]
[OffscreenCanvas test: 2d.composite.image.xor]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.image.xor.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.uncovered.image.copy.html]
[drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.uncovered.image.copy.worker.html]
[drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.uncovered.image.destination-atop.html]
[drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.uncovered.image.destination-atop.worker.html]
[drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.uncovered.image.destination-in.html]
[drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.uncovered.image.destination-in.worker.html]
[drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.uncovered.image.source-in.html]
[drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.uncovered.image.source-in.worker.html]
[drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.uncovered.image.source-out.html]
[drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.uncovered.image.source-out.worker.html]
[drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.uncovered.pattern.copy.html]
[Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.uncovered.pattern.copy.worker.html]
[Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.uncovered.pattern.destination-atop.html]
[Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.uncovered.pattern.destination-atop.worker.html]
[Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.uncovered.pattern.destination-in.html]
[Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.uncovered.pattern.destination-in.worker.html]
[Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.uncovered.pattern.source-in.html]
[Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.uncovered.pattern.source-in.worker.html]
[Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.uncovered.pattern.source-out.html]
[Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.composite.uncovered.pattern.source-out.worker.html]
[Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.5arg.html]
[OffscreenCanvas test: 2d.drawImage.5arg]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.5arg.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.9arg.basic.html]
[OffscreenCanvas test: 2d.drawImage.9arg.basic]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.9arg.basic.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.9arg.destpos.html]
[OffscreenCanvas test: 2d.drawImage.9arg.destpos]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.9arg.destpos.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.9arg.destsize.html]
[OffscreenCanvas test: 2d.drawImage.9arg.destsize]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.9arg.destsize.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.9arg.sourcepos.html]
[OffscreenCanvas test: 2d.drawImage.9arg.sourcepos]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.9arg.sourcepos.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.9arg.sourcesize.html]
[OffscreenCanvas test: 2d.drawImage.9arg.sourcesize]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.9arg.sourcesize.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.alpha.html]
[OffscreenCanvas test: 2d.drawImage.alpha]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.alpha.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.composite.html]
[OffscreenCanvas test: 2d.drawImage.composite]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.composite.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.negativedest.html]
[Negative destination width/height represents the correct rectangle]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.negativedest.worker.html]
[Negative destination width/height represents the correct rectangle]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.negativedir.html]
[Negative dimensions do not affect the direction of the image]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.negativedir.worker.html]
[Negative dimensions do not affect the direction of the image]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.negativesource.html]
[Negative source width/height represents the correct rectangle]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.negativesource.worker.html]
[Negative source width/height represents the correct rectangle]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.nonfinite.html]
[drawImage() with Infinity/NaN is ignored]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.nonfinite.worker.html]
[drawImage() with Infinity/NaN is ignored]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.nowrap.html]
[Stretched images do not get pixels wrapping around the edges]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.nowrap.worker.html]
[Stretched images do not get pixels wrapping around the edges]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.zerosource.html]
[drawImage with zero-sized source rectangle throws INDEX_SIZE_ERR]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.zerosource.image.html]
[drawImage with zero-sized source rectangle from image throws INDEX_SIZE_ERR]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.zerosource.image.worker.html]
[drawImage with zero-sized source rectangle from image throws INDEX_SIZE_ERR]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.drawImage.zerosource.worker.html]
[drawImage with zero-sized source rectangle throws INDEX_SIZE_ERR]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.pattern.basic.image.html]
[OffscreenCanvas test: 2d.pattern.basic.image]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.pattern.basic.image.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.pattern.paint.norepeat.basic.html]
[OffscreenCanvas test: 2d.pattern.paint.norepeat.basic]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.pattern.paint.norepeat.basic.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.pattern.paint.norepeat.coord1.html]
[OffscreenCanvas test: 2d.pattern.paint.norepeat.coord1]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.pattern.paint.norepeat.coord1.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.pattern.paint.norepeat.coord3.html]
[OffscreenCanvas test: 2d.pattern.paint.norepeat.coord3]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.pattern.paint.norepeat.coord3.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.pattern.paint.norepeat.outside.html]
[OffscreenCanvas test: 2d.pattern.paint.norepeat.outside]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.pattern.paint.norepeat.outside.worker.html]
[2d]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.pattern.paint.orientation.image.html]
[Image patterns do not get flipped when painted]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.pattern.paint.orientation.image.worker.html]
[Image patterns do not get flipped when painted]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.pattern.paint.repeat.basic.html]
[OffscreenCanvas test: 2d.pattern.paint.repeat.basic]
expected: FAIL

View file

@ -1,4 +0,0 @@
[2d.pattern.paint.repeat.basic.worker.html]
[2d]
expected: FAIL

Some files were not shown because too many files have changed in this diff Show more