Skip to content

Implement pattern fill style for canvas. - #6157

Merged
bors-servo merged 1 commit into
servo:masterfrom
hyowon:canvas_pattern_fill
Jun 13, 2015
Merged

bors-servo merged 1 commit into
servo:masterfrom
hyowon:canvas_pattern_fill

Conversation

@hyowon

@hyowon hyowon commented May 22, 2015

Copy link
Copy Markdown
Contributor

Issue #6056
Depends on servo/rust-azure#160

Review on Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label May 22, 2015
@highfive

Copy link
Copy Markdown

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @Manishearth (or someone else) soon.

@hoppipolla-critic-bot

Copy link
Copy Markdown

Critic review: https://critic.hoppipolla.co.uk/r/5076

This is an external review system which you may optionally use for the code review of your pull request.

In order to help critic track your changes, please do not make in-place history rewrites (e.g. via git rebase -i or git commit --amend) when updating this pull request.

@hyowon

hyowon commented May 22, 2015

Copy link
Copy Markdown
Contributor Author

cc @jdm
cc @yichoi

@nox

nox commented May 26, 2015

Copy link
Copy Markdown
Contributor

Review status: all files reviewed, 7 unresolved discussions, all commit checks successful.
Reviewed files:

  • components/canvas_traits/lib.rs @ r1
  • components/script/dom/bindings/trace.rs @ r1
  • components/script/dom/canvaspattern.rs @ r1
  • components/script/dom/canvasrenderingcontext2d.rs @ r2
  • components/script/dom/webidls/CanvasRenderingContext2D.webidl @ r1
  • tests/wpt/metadata/2dcontext/compositing/2d.composite.globalAlpha.imagepattern.html.ini @ r3
  • tests/wpt/metadata/2dcontext/compositing/2d.composite.uncovered.pattern.copy.html.ini @ r3
  • tests/wpt/metadata/2dcontext/compositing/2d.composite.uncovered.pattern.destination-atop.html.ini @ r3
  • tests/wpt/metadata/2dcontext/compositing/2d.composite.uncovered.pattern.destination-in.html.ini @ r3
  • tests/wpt/metadata/2dcontext/compositing/2d.composite.uncovered.pattern.source-in.html.ini @ r3
  • tests/wpt/metadata/2dcontext/compositing/2d.composite.uncovered.pattern.source-out.html.ini @ r3
  • tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.animated.gif.html.ini @ r3
  • tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.basic.image.html.ini @ r3
  • tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.basic.type.html.ini @ r3
  • tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.crosscanvas.html.ini @ r3
  • tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.image.broken.html.ini @ r3
  • tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.image.null.html.ini @ r3
  • tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.image.string.html.ini @ r3
  • tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.image.undefined.html.ini @ r3
  • tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.modify.image1.html.ini @ r3
  • tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.modify.image2.html.ini @ r3
  • tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.paint.norepeat.basic.html.ini @ r3
  • tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord1.html.ini @ r3
  • tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord2.html.ini @ r3
  • tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.paint.norepeat.outside.html.ini @ r3
  • tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.paint.orientation.image.html.ini @ r3
  • tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeat.basic.html.ini @ r3
  • tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeat.coord1.html.ini @ r3
  • tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeat.coord2.html.ini @ r3
  • tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeat.coord3.html.ini @ r3
  • tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeat.outside.html.ini @ r3
  • tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeatx.basic.html.ini @ r3
  • tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeatx.outside.html.ini @ r3
  • tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeaty.basic.html.ini @ r3
  • tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeaty.outside.html.ini @ r3
  • tests/wpt/metadata/2dcontext/shadows/2d.shadow.pattern.transparent.1.html.ini @ r3

components/canvas_traits/lib.rs, line 297 [r3] (raw file):
Are the explicit values actually needed?


components/script/dom/canvaspattern.rs, line 10 [r3] (raw file):
Nit: superfluous braces.


components/script/dom/canvasrenderingcontext2d.rs, line 12 [r3] (raw file):
I would just import Error and qualify its constructors, that's what is done in most other DOM implementations AFAICT.


components/script/dom/canvasrenderingcontext2d.rs, line 980 [r3] (raw file):
SyntaxError, says the specification.


tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.image.null.html.ini, line 4 [r3] (raw file):
Why does this test fail?


tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.image.string.html.ini, line 4 [r3] (raw file):
Same remark about failing test.


tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.image.undefined.html.ini, line 4 [r3] (raw file):
Same remark about failing test.


Comments from the review on Reviewable.io

@jdm jdm added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels May 27, 2015
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels May 27, 2015
@hyowon

hyowon commented May 27, 2015

Copy link
Copy Markdown
Contributor Author

Review status: 34 of 36 files reviewed, 7 unresolved discussions, some commit checks failed.


components/canvas_traits/lib.rs, line 297 [r3] (raw file):
No, they seem to not need the explicit values.


components/script/dom/canvaspattern.rs, line 10 [r3] (raw file):
Done.


components/script/dom/canvasrenderingcontext2d.rs, line 12 [r3] (raw file):
I tried to search using Error in other files.
But this kind of using Error seems to be common.
I'm sorry but could you show me an example?


components/script/dom/canvasrenderingcontext2d.rs, line 980 [r3] (raw file):
Done.


tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.image.null.html.ini, line 4 [r3] (raw file):
Canvas pattern tests have not been performed properly in the meantime.
These new failed tests are to check invalid parameters in CreatePattern.
Actually I have no idea where I can catch them and return errors.
I am a newbie. I'll try to fix it if you give me some advice,
or is it a bad idea to leave them as another issue?


tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.image.string.html.ini, line 4 [r3] (raw file):
Ditto.


tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.image.undefined.html.ini, line 4 [r3] (raw file):
Ditto.


Comments from the review on Reviewable.io

@hyowon

hyowon commented May 27, 2015

Copy link
Copy Markdown
Contributor Author

@nox Thank you for your review! :D

@nox

nox commented May 27, 2015

Copy link
Copy Markdown
Contributor
$ ./mach test-tidy
components/script/dom/canvaspattern.rs:40: (much) overlong line
components/script/dom/canvasrenderingcontext2d.rs:830: (much) overlong line

@nox

nox commented May 27, 2015

Copy link
Copy Markdown
Contributor

Review status: all files reviewed, 3 unresolved discussions, some commit checks failed.
Reviewed files:

  • components/script/dom/canvaspattern.rs @ r4
  • components/script/dom/canvasrenderingcontext2d.rs @ r4

components/canvas_traits/lib.rs, line 297 [r3] (raw file):
Remove them then, if they are not useful. :)


components/script/dom/canvasrenderingcontext2d.rs, line 12 [r3] (raw file):
Apparently I'm wrong and more often constructors themselves are imported in scope. Oh well.


tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.image.null.html.ini, line 4 [r3] (raw file):
The createPattern method used to not exist at all, so obviously the tests passed before. Not a bad idea to leave them as another issue, I was just being curious.

It's quite weird because CodegenRust should have generated code that reject such values. I would like to take a look at the generated code but I didn't manage to build Servo with your rust-azure fork.

Please just file a follow-up issue or I'll do it myself.


Comments from the review on Reviewable.io

@nox

nox commented May 27, 2015

Copy link
Copy Markdown
Contributor

Two general remarks:

  • How did you manage to build and run the tests with the rust-azure PR? I get:
/Users/nox/src/servo/components/canvas/canvas_paint_task.rs:82:28: 82:78 error: this function takes 3 parameters but 2 parameters were supplied [E0061]
/Users/nox/src/servo/components/canvas/canvas_paint_task.rs:82         let draw_options = DrawOptions::new(self.state.draw_options.alpha, 0);
                                                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/nox/src/servo/components/canvas/canvas_paint_task.rs:178:27: 178:51 error: this function takes 3 parameters but 2 parameters were supplied [E0061]
/Users/nox/src/servo/components/canvas/canvas_paint_task.rs:178             draw_options: DrawOptions::new(1.0, 0),
                                                                                          ^~~~~~~~~~~~~~~~~~~~~~~~
  • I think we generally prefer if there are no commits where tests could end up with unexpected results, the test commit should be squashed with its predecessor.

@hyowon

hyowon commented May 27, 2015

Copy link
Copy Markdown
Contributor Author

Building servo with my rust-azure is being broken because servo/rust-azure@faba68 was already merged but the relevant patch #6065 is in progress.

So I've been working with a temporary branch 'my_commits' in hyowon/rust-azure.
Please checkout the 'my_commits' branch for rust-azure if you want to build and test this PR.
Sorry for the inconvenience.


Review status: all files reviewed, 3 unresolved discussions, some commit checks failed.


components/canvas_traits/lib.rs, line 297 [r3] (raw file):
Done.


components/script/dom/canvasrenderingcontext2d.rs, line 12 [r3] (raw file):
That's no problem. :)


tests/wpt/metadata/2dcontext/fill-and-stroke-styles/2d.pattern.image.null.html.ini, line 4 [r3] (raw file):
I've filed a new issue #6194.
Thank you in advance for spending your time on looking at this.


Comments from the review on Reviewable.io

@hyowon
hyowon force-pushed the canvas_pattern_fill branch from c14ab0d to 9a4f578 Compare May 27, 2015 12:35
@nox

nox commented May 27, 2015

Copy link
Copy Markdown
Contributor
components/script/dom/canvasrenderingcontext2d.rs:830: (much) overlong line

:)

@nox

nox commented May 27, 2015

Copy link
Copy Markdown
Contributor

Review status: all files reviewed, all discussions resolved, some commit checks failed.
Reviewed files:

  • components/canvas_traits/lib.rs @ r5
  • components/script/dom/canvaspattern.rs @ r5

Comments from the review on Reviewable.io

@hyowon

hyowon commented May 27, 2015

Copy link
Copy Markdown
Contributor Author

The 830 line in components/script/dom/canvasrenderingcontext2d.rs has only '}'.
I didn't even modify the line. It's weird. :(

@nox

nox commented May 27, 2015

Copy link
Copy Markdown
Contributor

The problem is probably line 827.

@hyowon
hyowon force-pushed the canvas_pattern_fill branch 2 times, most recently from 5bdcb1f to d2fc700 Compare May 27, 2015 13:21
@hyowon

hyowon commented May 27, 2015

Copy link
Copy Markdown
Contributor Author

I've fixed it after rebase.

@nox

nox commented May 27, 2015

Copy link
Copy Markdown
Contributor

Review status: :shipit: all files reviewed, all discussions resolved, all commit checks successful.
Reviewed files:

  • components/script/dom/bindings/trace.rs @ r6
  • components/script/dom/canvasrenderingcontext2d.rs @ r6

Comments from the review on Reviewable.io

@Manishearth

Copy link
Copy Markdown
Member

@bors-servo: r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit d2fc700 has been approved by Manishearth

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit d2fc700 with merge 4a867d3...

@Manishearth

Copy link
Copy Markdown
Member

@bors-servo: r-

This apparently depends on another PR. Sorry.

@nox

nox commented Jun 12, 2015

Copy link
Copy Markdown
Contributor

@hyowon #6348 landed.

@nox nox added S-needs-squash Some (or all) of the commits in the PR should be combined. and removed S-blocked-on-external Something, somewhere else, needs to happen before this PR can be merged. labels Jun 12, 2015
@hyowon
hyowon force-pushed the canvas_pattern_fill branch from 0f84597 to 7a0743b Compare June 12, 2015 23:54
@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jun 12, 2015
@hyowon

hyowon commented Jun 13, 2015

Copy link
Copy Markdown
Contributor Author

@nox All done!

@nox

nox commented Jun 13, 2015

Copy link
Copy Markdown
Contributor

@bors-servo: r+

-S-awaiting-review -S-needs-squash +S-awaiting-merge


Review status: :shipit: all files reviewed, all discussions resolved, all commit checks successful.
Reviewed files:

  • components/canvas/canvas_paint_task.rs @ r9
  • components/canvas_traits/lib.rs @ r9
  • components/script/dom/bindings/trace.rs @ r9
  • components/script/dom/canvasrenderingcontext2d.rs @ r9
  • components/script/dom/webidls/CanvasRenderingContext2D.webidl @ r9

Comments from the review on Reviewable.io

@nox nox added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. S-needs-squash Some (or all) of the commits in the PR should be combined. labels Jun 13, 2015
@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 7a0743b has been approved by nox

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 7a0743b with merge e76125c...

@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - mac1

@hyowon
hyowon force-pushed the canvas_pattern_fill branch from 7a0743b to 00240e5 Compare June 13, 2015 05:35
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jun 13, 2015
@hyowon

hyowon commented Jun 13, 2015

Copy link
Copy Markdown
Contributor Author

@nox Please retry~

@jdm

jdm commented Jun 13, 2015

Copy link
Copy Markdown
Member

@bors-servo: r=nox

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 00240e5 has been approved by nox

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 00240e5 with merge 9474e62...

@jdm jdm added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jun 13, 2015
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, gonk, linux1, linux2, linux3, mac1, mac2, mac3

@bors-servo
bors-servo merged commit 00240e5 into servo:master Jun 13, 2015
@hyowon
hyowon deleted the canvas_pattern_fill branch June 16, 2015 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants