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

Implement HTMLCanvasElement.toDataURL for WebGL canvas (fixes #19147) #20400

Merged
merged 1 commit into from Mar 24, 2018

Conversation

@nox
Copy link
Member

nox commented Mar 23, 2018

This change is Reviewable

@highfive
Copy link

highfive commented Mar 23, 2018

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/htmlcanvaselement.rs, components/script/dom/webglrenderingcontext.rs, components/script/dom/canvasrenderingcontext2d.rs
  • @fitzgen: components/script/dom/htmlcanvaselement.rs, components/script/dom/webglrenderingcontext.rs, components/script/dom/canvasrenderingcontext2d.rs
  • @KiChjang: components/script/dom/htmlcanvaselement.rs, components/script/dom/webglrenderingcontext.rs, components/script/dom/canvasrenderingcontext2d.rs
Copy link
Member

emilio left a comment

Looks... reasonable, but I don't know where the WebGL error there should come from, so want links :)

}

if let Some((fb_width, fb_height)) = self.get_current_framebuffer_size() {
if width > fb_width as u32 {

This comment has been minimized.

Copy link
@emilio

emilio Mar 23, 2018

Member

Use max and min?

This comment has been minimized.

Copy link
@emilio

emilio Mar 23, 2018

Member

I guess just min :)

// Used by HTMLCanvasElement.toDataURL
pub fn get_image_data(&self, mut width: u32, mut height: u32) -> Option<Vec<u8>> {
if !self.validate_framebuffer_complete() {
return None;

This comment has been minimized.

Copy link
@emilio

emilio Mar 23, 2018

Member

No error here?

This comment has been minimized.

Copy link
@nox

nox Mar 23, 2018

Author Member

validate_framebuffer_complete stores one already.

height = fb_height as u32;
}
} else {
self.webgl_error(InvalidOperation);

This comment has been minimized.

Copy link
@emilio

emilio Mar 23, 2018

Member

Needs spec quote / link.

@@ -346,11 +346,24 @@ impl HTMLCanvasElementMethods for HTMLCanvasElement {
Finite::wrap(self.Height() as f64),
)?
}
Some(CanvasContext::WebGL(ref context)) => {
if let Some(data) = context.get_image_data(self.Width(), self.Height()) {

This comment has been minimized.

Copy link
@emilio

emilio Mar 23, 2018

Member

Maybe it's cleaner with match?

@emilio
emilio approved these changes Mar 23, 2018
Copy link
Member

emilio left a comment

r=me assuming get_image_data is just moving code around :)

@nox
Copy link
Member Author

nox commented Mar 23, 2018

Yep get_image_data is just to avoid creating an ImageData for nothing in the 2D path.

@bors-servo r=emilio p=1

@bors-servo
Copy link
Contributor

bors-servo commented Mar 23, 2018

📌 Commit 16aa2fa has been approved by emilio

@highfive highfive assigned emilio and unassigned glennw Mar 23, 2018
@bors-servo
Copy link
Contributor

bors-servo commented Mar 23, 2018

Testing commit 16aa2fa with merge 2992008...

bors-servo added a commit that referenced this pull request Mar 23, 2018
Implement HTMLCanvasElement.toDataURL for WebGL canvas (fixes #19147)

<!-- 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/20400)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Mar 23, 2018

💔 Test failed - linux-rel-css

@nox
Copy link
Member Author

nox commented Mar 23, 2018

@bors-servo r=emilio

@bors-servo
Copy link
Contributor

bors-servo commented Mar 23, 2018

📌 Commit 83a6103 has been approved by emilio

@bors-servo
Copy link
Contributor

bors-servo commented Mar 23, 2018

Testing commit 83a6103 with merge d6911bc...

bors-servo added a commit that referenced this pull request Mar 23, 2018
Implement HTMLCanvasElement.toDataURL for WebGL canvas (fixes #19147)

<!-- 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/20400)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Mar 23, 2018

💔 Test failed - linux-rel-css

@jdm
Copy link
Member

jdm commented Mar 23, 2018

  ▶ OK [expected TIMEOUT] /_mozilla/webgl/conformance-1.0.3/conformance/ogles/GL/log2/log2_001_to_008.html

  ▶ Unexpected subtest result in /_mozilla/webgl/conformance-1.0.3/conformance/ogles/GL/log2/log2_001_to_008.html:
  └ PASS [expected NOTRUN] Overall test

This might just be a test that now intermittently times out.

@nox
Copy link
Member Author

nox commented Mar 23, 2018

Yes, most probably. I'll file the issue soon.

@nox
Copy link
Member Author

nox commented Mar 23, 2018

@bors-servo try

Doing a try run to see if it's a more rampant problem or just related to this one test.

@jdm
Copy link
Member

jdm commented Mar 24, 2018

@bors-servo clean try

@nox
Copy link
Member Author

nox commented Mar 24, 2018

@bors-servo r- try retry

@bors-servo
Copy link
Contributor

bors-servo commented Mar 24, 2018

Trying commit a77d35b with merge d1a14ec...

bors-servo added a commit that referenced this pull request Mar 24, 2018
Implement HTMLCanvasElement.toDataURL for WebGL canvas (fixes #19147)

<!-- 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/20400)
<!-- Reviewable:end -->
@nox
Copy link
Member Author

nox commented Mar 24, 2018

@jdm Wow, what were the odds that we would stress test Homu…

@bors-servo
Copy link
Contributor

bors-servo commented Mar 24, 2018

💔 Test failed - linux-rel-css

@nox
Copy link
Member Author

nox commented Mar 24, 2018

@bors-servo try- r=emilio #20408

@bors-servo
Copy link
Contributor

bors-servo commented Mar 24, 2018

📌 Commit a77d35b has been approved by emilio

@bors-servo
Copy link
Contributor

bors-servo commented Mar 24, 2018

Testing commit a77d35b with merge 0005853...

bors-servo added a commit that referenced this pull request Mar 24, 2018
Implement HTMLCanvasElement.toDataURL for WebGL canvas (fixes #19147)

<!-- 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/20400)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Mar 24, 2018

💔 Test failed - linux-rel-wpt

@nox
Copy link
Member Author

nox commented Mar 24, 2018

@bors-servo
Copy link
Contributor

bors-servo commented Mar 24, 2018

Testing commit a77d35b with merge 72f326b...

bors-servo added a commit that referenced this pull request Mar 24, 2018
Implement HTMLCanvasElement.toDataURL for WebGL canvas (fixes #19147)

<!-- 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/20400)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Mar 24, 2018

@bors-servo bors-servo merged commit a77d35b into master Mar 24, 2018
4 of 5 checks passed
4 of 5 checks passed
Taskcluster (pull_request) TaskGroup: failure
Details
Tidelift Dependencies checked
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.