{"action":"created","issue":{"url":"https://api.github.com/repos/servo/servo/issues/5769","labels_url":"https://api.github.com/repos/servo/servo/issues/5769/labels{/name}","comments_url":"https://api.github.com/repos/servo/servo/issues/5769/comments","events_url":"https://api.github.com/repos/servo/servo/issues/5769/events","html_url":"https://github.com/servo/servo/pull/5769","id":69790620,"number":5769,"title":"Refactor WebGL implementation","user":{"login":"ecoal95","id":1323194,"avatar_url":"https://avatars.githubusercontent.com/u/1323194?v=3","gravatar_id":"","url":"https://api.github.com/users/ecoal95","html_url":"https://github.com/ecoal95","followers_url":"https://api.github.com/users/ecoal95/followers","following_url":"https://api.github.com/users/ecoal95/following{/other_user}","gists_url":"https://api.github.com/users/ecoal95/gists{/gist_id}","starred_url":"https://api.github.com/users/ecoal95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecoal95/subscriptions","organizations_url":"https://api.github.com/users/ecoal95/orgs","repos_url":"https://api.github.com/users/ecoal95/repos","events_url":"https://api.github.com/users/ecoal95/events{/privacy}","received_events_url":"https://api.github.com/users/ecoal95/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/servo/servo/labels/S-awaiting-review","name":"S-awaiting-review","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-21T09:12:11Z","updated_at":"2015-04-21T12:17:32Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/servo/servo/pulls/5769","html_url":"https://github.com/servo/servo/pull/5769","diff_url":"https://github.com/servo/servo/pull/5769.diff","patch_url":"https://github.com/servo/servo/pull/5769.patch"},"body":"This PR uses customized GL context creation code, right now only working under Linux, so I expect the clearcolor test to fail on other platforms.\r\n\r\nIt addresses some other problems:\r\n  * Propagates context creation error to the top, returning null if not found.\r\n  * Uses `GLContextAttributes`, which will allow us to write `WebGLContextAttributes` easily.\r\n  * Doesn't allow a 2d context and a WebGL context coexist.\r\n  * Panics when resizing the context to larger dimensions (to be fixed soon, but better than blindly allowing it).\r\n  * Removes some unused dependencies\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/servo/servo/5769)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/servo/servo/issues/comments/94772831","html_url":"https://github.com/servo/servo/pull/5769#issuecomment-94772831","issue_url":"https://api.github.com/repos/servo/servo/issues/5769","id":94772831,"user":{"login":"jdm","id":27658,"avatar_url":"https://avatars.githubusercontent.com/u/27658?v=3","gravatar_id":"","url":"https://api.github.com/users/jdm","html_url":"https://github.com/jdm","followers_url":"https://api.github.com/users/jdm/followers","following_url":"https://api.github.com/users/jdm/following{/other_user}","gists_url":"https://api.github.com/users/jdm/gists{/gist_id}","starred_url":"https://api.github.com/users/jdm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdm/subscriptions","organizations_url":"https://api.github.com/users/jdm/orgs","repos_url":"https://api.github.com/users/jdm/repos","events_url":"https://api.github.com/users/jdm/events{/privacy}","received_events_url":"https://api.github.com/users/jdm/received_events","type":"User","site_admin":false},"created_at":"2015-04-21T12:17:32Z","updated_at":"2015-04-21T12:17:32Z","body":"\n\n\n\nReviewed files:\n- components/canvas/Cargo.toml @ r1\n- components/canvas/lib.rs @ r1\n- components/canvas/webgl_paint_task.rs @ r1\n- components/script/dom/htmlcanvaselement.rs @ r1\n- components/script/dom/webglrenderingcontext.rs @ r1\n- components/script/dom/webidls/HTMLCanvasElement.webidl @ r1\n- components/servo/Cargo.lock @ r1\n- ports/cef/Cargo.lock @ r1\n- ports/gonk/Cargo.lock @ r1\n- tests/ref/webgl-context/clearcolor.html @ r1\n\n---\n\n<sup>**[components/canvas/webgl_paint_task.rs, line 91 \\[r1\\]](https://reviewable.io:443/reviews/servo/servo/5769#-JnQt-Dw6ILS2zqNsLCi)** ([raw file](https://github.com/servo/servo/blob/ca8799037c3e2ab35a25d5f0f83b1b9896813dda/components/canvas/webgl_paint_task.rs#L91)):</sup>\nnit: || on the previous line.\n\n---\n\n<sup>**[components/script/dom/htmlcanvaselement.rs, line 174 \\[r1\\]](https://reviewable.io:443/reviews/servo/servo/5769#-JnQtEdkbaxySrrCR1IS)** ([raw file](https://github.com/servo/servo/blob/ca8799037c3e2ab35a25d5f0f83b1b9896813dda/components/script/dom/htmlcanvaselement.rs#L174)):</sup>\nUse debug! instead of println!\n\n---\n\n<sup>**[components/script/dom/htmlcanvaselement.rs, line 190 \\[r1\\]](https://reviewable.io:443/reviews/servo/servo/5769#-JnQu1nqJCIi90Uxolky)** ([raw file](https://github.com/servo/servo/blob/ca8799037c3e2ab35a25d5f0f83b1b9896813dda/components/script/dom/htmlcanvaselement.rs#L190)):</sup>\nWhy not use or_init here like before?\n\n---\n\n<sup>**[components/script/dom/htmlcanvaselement.rs, line 192 \\[r1\\]](https://reviewable.io:443/reviews/servo/servo/5769#-JnQtmGLPzVNwmfgGxKg)** ([raw file](https://github.com/servo/servo/blob/ca8799037c3e2ab35a25d5f0f83b1b9896813dda/components/script/dom/htmlcanvaselement.rs#L192)):</sup>\nWhy this change?\n\n---\n\n<sup>**[components/script/dom/htmlcanvaselement.rs, line 196 \\[r1\\]](https://reviewable.io:443/reviews/servo/servo/5769#-JnQtYCAz0Gc7CSWCbvP)** ([raw file](https://github.com/servo/servo/blob/ca8799037c3e2ab35a25d5f0f83b1b9896813dda/components/script/dom/htmlcanvaselement.rs#L196)):</sup>\nThis match can be a call to `self.context_webgl.get().map` instead.\n\n---\n\n<sup>**[components/script/dom/webglrenderingcontext.rs, line 43 \\[r1\\]](https://reviewable.io:443/reviews/servo/servo/5769#-JnQuG5ATWfysf9MB5_p)** ([raw file](https://github.com/servo/servo/blob/ca8799037c3e2ab35a25d5f0f83b1b9896813dda/components/script/dom/webglrenderingcontext.rs#L43)):</sup>\nLet's use error! instead of println!\n\n---\n\n\n---\n\nComments from the [review on Reviewable.io](https://reviewable.io:443/reviews/servo/servo/5769)\n<!-- Sent from Reviewable.io -->\n"}}