Auto merge of #26697 - utsavoza:ugo/issue-11681/22-05-2020, r=jdm

Implement CanvasRenderingContext2d.fillText

The PR consists of broadly two main changes:
- Implementation of Canvas2dRenderingContext.font
- Basic implementation of Canvas2dRenderingContext.fillText

Although I am not fully sure about the long term goals for the canvas backend in Servo, I assumed limited scope for font and text handling (should support simple text drawing with font selection) in the current implementation as I believe a more complete implementation would eventually be brought in as a part of #22957.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #11681
- [x] There are tests for these changes
This commit is contained in:
bors-servo 2020-06-12 13:43:51 -04:00 committed by GitHub
commit 721271dcd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
57 changed files with 928 additions and 183 deletions

View file

@ -879,8 +879,13 @@ fn create_constellation(
Box::new(FontCacheWR(compositor_proxy.clone())),
);
let (canvas_chan, ipc_canvas_chan) = CanvasPaintThread::start(
Box::new(CanvasWebrenderApi(compositor_proxy.clone())),
font_cache_thread.clone(),
);
let initial_state = InitialConstellationState {
compositor_proxy: compositor_proxy.clone(),
compositor_proxy,
embedder_proxy,
debugger_chan,
devtools_chan,
@ -899,9 +904,6 @@ fn create_constellation(
user_agent,
};
let (canvas_chan, ipc_canvas_chan) =
CanvasPaintThread::start(Box::new(CanvasWebrenderApi(compositor_proxy)));
let constellation_chan = Constellation::<
script_layout_interface::message::Msg,
layout_thread::LayoutThread,