mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
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:
commit
fdafc833ae
131 changed files with 145 additions and 551 deletions
|
@ -176,7 +176,7 @@ pub struct CanvasData<'a> {
|
|||
|
||||
impl<'a> CanvasData<'a> {
|
||||
pub fn new(
|
||||
size: Size2D<u32>,
|
||||
size: Size2D<u64>,
|
||||
webrender_api_sender: webrender_api::RenderApiSender,
|
||||
antialias: AntialiasMode,
|
||||
canvas_id: CanvasId,
|
||||
|
@ -708,13 +708,13 @@ impl<'a> CanvasData<'a> {
|
|||
.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?
|
||||
DrawTarget::new(BackendType::Skia, size.to_i32(), SurfaceFormat::B8G8R8A8)
|
||||
}
|
||||
|
||||
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.saved_states.clear();
|
||||
// Webrender doesn't let images change size, so we clear the webrender image key.
|
||||
|
|
|
@ -77,7 +77,7 @@ impl<'a> CanvasPaintThread<'a> {
|
|||
|
||||
pub fn create_canvas(
|
||||
&mut self,
|
||||
size: Size2D<u32>,
|
||||
size: Size2D<u64>,
|
||||
webrender_api_sender: webrender_api::RenderApiSender,
|
||||
antialias: bool,
|
||||
) -> CanvasId {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue