{"action":"created","comment":{"url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/comments/62000827","id":62000827,"diff_hunk":"@@ -74,14 +75,54 @@ OpenGLCanvas: class extends OpenGLSurface {\n \t\tthis _renderTarget free()\n \t\tsuper()\n \t}\n-\t_bind: override func { this _renderTarget bind() }\n-\t_unbind: override func { this _renderTarget unbind() }\n+\tdrawLines: override func ~explicit (pointList: VectorList<FloatPoint2D>, pen: Pen) {\n+\t\tthis _renderTarget bind()\n+\t\tthis context backend setViewport(IntBox2D new(this size))\n+\t\tthis context backend disableBlend()\n+\t\tthis context drawLines(pointList, this _createProjection(this size toFloatVector2D(), 0.0f) * this _toLocal, pen)\n+\t\tthis _renderTarget unbind()\n+\t}\n+\tdrawPoints: override func ~explicit (pointList: VectorList<FloatPoint2D>, pen: Pen) {\n+\t\tthis _renderTarget bind()\n+\t\tthis context backend setViewport(IntBox2D new(this size))\n+\t\tthis context backend disableBlend()\n+\t\tthis context drawPoints(pointList, this _createProjection(this size toFloatVector2D(), 0.0f) * this _toLocal, pen)\n+\t\tthis _renderTarget unbind()\n+\t}\n+\t_createModelTransform: func ~LocalFloat (box: FloatBox2D, focalLength: Float) -> FloatTransform3D {\n+\t\ttoReference := FloatTransform3D createTranslation((box size x - this size x) / 2, (this size y - box size y) / 2, 0.0f)\n+\t\ttranslation := this _toLocal * FloatTransform3D createTranslation(box leftTop x, box leftTop y, focalLength) * this _toLocal\n+\t\ttranslation * toReference * FloatTransform3D createScaling(box size x / 2.0f, box size y / 2.0f, 1.0f)\n+\t}\n+\t_createModelTransformNormalized: func (imageSize: IntVector2D, box: FloatBox2D, focalLength: Float) -> FloatTransform3D {\n+\t\tthis _createModelTransform(box * imageSize toFloatVector2D(), focalLength)\n+\t}\n+\t_createView: func (targetSize: FloatVector2D, normalizedView: FloatTransform3D) -> FloatTransform3D {\n+\t\tthis _toLocal * normalizedView normalizedToReference(targetSize) * this _toLocal\n+\t}\n+\t_createProjection: func (targetSize: FloatVector2D, focalLengthPerWidth: Float) -> FloatTransform3D {\n+\t\tresult: FloatTransform3D\n+\t\tfocalLengthPerHeight := focalLengthPerWidth * targetSize x / targetSize y\n+\t\tflipX := this _coordinateTransform a as Float\n+\t\tflipY := -(this _coordinateTransform e as Float)\n+\t\tif (focalLengthPerWidth > 0.0f) {\n+\t\t\tnearPlane := 0.01f\n+\t\t\tfarPlane := 12500.0f\n+\t\t\ta := flipX * 2.0f * focalLengthPerWidth\n+\t\t\tf := flipY * 2.0f * focalLengthPerHeight\n+\t\t\tk := (farPlane + nearPlane) / (farPlane - nearPlane)\n+\t\t\to := 2.0f * farPlane * nearPlane / (farPlane - nearPlane)\n+\t\t\tresult = FloatTransform3D new(a, 0.0f, 0.0f, 0.0f, 0.0f, f, 0.0f, 0.0f, 0.0f, 0.0f, k, -1.0f, 0.0f, 0.0f, o, 0.0f)\n+\t\t} else\n+\t\t\tresult = FloatTransform3D createScaling(flipX * 2.0f / targetSize x, flipY * 2.0f / targetSize y, 0.0f)\n+\t\tresult\n+\t}","path":"source/draw/gpu/opengl/OpenGLCanvas.ooc","position":78,"original_position":78,"commit_id":"af325cf3cfb19e2b83bf1c2567b60165c6800021","original_commit_id":"af325cf3cfb19e2b83bf1c2567b60165c6800021","user":{"login":"marcusnaslund","id":14308896,"avatar_url":"https://avatars.githubusercontent.com/u/14308896?v=3","gravatar_id":"","url":"https://api.github.com/users/marcusnaslund","html_url":"https://github.com/marcusnaslund","followers_url":"https://api.github.com/users/marcusnaslund/followers","following_url":"https://api.github.com/users/marcusnaslund/following{/other_user}","gists_url":"https://api.github.com/users/marcusnaslund/gists{/gist_id}","starred_url":"https://api.github.com/users/marcusnaslund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcusnaslund/subscriptions","organizations_url":"https://api.github.com/users/marcusnaslund/orgs","repos_url":"https://api.github.com/users/marcusnaslund/repos","events_url":"https://api.github.com/users/marcusnaslund/events{/privacy}","received_events_url":"https://api.github.com/users/marcusnaslund/received_events","type":"User","site_admin":false},"body":"Did anything change here or was it just moved?","created_at":"2016-05-04T07:57:16Z","updated_at":"2016-05-04T07:57:16Z","html_url":"https://github.com/magic-lang/ooc-kean/pull/1691#discussion_r62000827","pull_request_url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1691","_links":{"self":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/comments/62000827"},"html":{"href":"https://github.com/magic-lang/ooc-kean/pull/1691#discussion_r62000827"},"pull_request":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1691"}}},"pull_request":{"url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1691","id":68692169,"html_url":"https://github.com/magic-lang/ooc-kean/pull/1691","diff_url":"https://github.com/magic-lang/ooc-kean/pull/1691.diff","patch_url":"https://github.com/magic-lang/ooc-kean/pull/1691.patch","issue_url":"https://api.github.com/repos/magic-lang/ooc-kean/issues/1691","number":1691,"state":"open","locked":false,"title":"Inlining OpenGLSurface","user":{"login":"davidpiuva","id":10193545,"avatar_url":"https://avatars.githubusercontent.com/u/10193545?v=3","gravatar_id":"","url":"https://api.github.com/users/davidpiuva","html_url":"https://github.com/davidpiuva","followers_url":"https://api.github.com/users/davidpiuva/followers","following_url":"https://api.github.com/users/davidpiuva/following{/other_user}","gists_url":"https://api.github.com/users/davidpiuva/gists{/gist_id}","starred_url":"https://api.github.com/users/davidpiuva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidpiuva/subscriptions","organizations_url":"https://api.github.com/users/davidpiuva/orgs","repos_url":"https://api.github.com/users/davidpiuva/repos","events_url":"https://api.github.com/users/davidpiuva/events{/privacy}","received_events_url":"https://api.github.com/users/davidpiuva/received_events","type":"User","site_admin":false},"body":"The content of OpenGLSurface was moved to both classes inheriting from it (OpenGLCanvas & OpenGLWindow). There is some duplicated code now but the inheritance tree is closer to making OpenGLWindow independent so that canvas can later be merged with image.\r\n\r\n* Next step is to inline GpuCanvas that only contains the default shader and texture transform so that every platform inherits directly from canvas. The problem is that the whole GPU abstraction layer including `GpuCanvasYuv420Semiplanar` might have to be inlined into the OpenGL layer. All planar images should probably be moved away from hardware specific layers.\r\n* Then things will move from canvas to image classes in an attempt to delete canvas.","created_at":"2016-05-03T11:32:58Z","updated_at":"2016-05-04T07:57:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2acd55b43e6676142189f9939ecf61edc051503f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1691/commits","review_comments_url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1691/comments","review_comment_url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/comments{/number}","comments_url":"https://api.github.com/repos/magic-lang/ooc-kean/issues/1691/comments","statuses_url":"https://api.github.com/repos/magic-lang/ooc-kean/statuses/af325cf3cfb19e2b83bf1c2567b60165c6800021","head":{"label":"davidpiuva:surface","ref":"surface","sha":"af325cf3cfb19e2b83bf1c2567b60165c6800021","user":{"login":"davidpiuva","id":10193545,"avatar_url":"https://avatars.githubusercontent.com/u/10193545?v=3","gravatar_id":"","url":"https://api.github.com/users/davidpiuva","html_url":"https://github.com/davidpiuva","followers_url":"https://api.github.com/users/davidpiuva/followers","following_url":"https://api.github.com/users/davidpiuva/following{/other_user}","gists_url":"https://api.github.com/users/davidpiuva/gists{/gist_id}","starred_url":"https://api.github.com/users/davidpiuva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidpiuva/subscriptions","organizations_url":"https://api.github.com/users/davidpiuva/orgs","repos_url":"https://api.github.com/users/davidpiuva/repos","events_url":"https://api.github.com/users/davidpiuva/events{/privacy}","received_events_url":"https://api.github.com/users/davidpiuva/received_events","type":"User","site_admin":false},"repo":{"id":28035938,"name":"ooc-kean","full_name":"davidpiuva/ooc-kean","owner":{"login":"davidpiuva","id":10193545,"avatar_url":"https://avatars.githubusercontent.com/u/10193545?v=3","gravatar_id":"","url":"https://api.github.com/users/davidpiuva","html_url":"https://github.com/davidpiuva","followers_url":"https://api.github.com/users/davidpiuva/followers","following_url":"https://api.github.com/users/davidpiuva/following{/other_user}","gists_url":"https://api.github.com/users/davidpiuva/gists{/gist_id}","starred_url":"https://api.github.com/users/davidpiuva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidpiuva/subscriptions","organizations_url":"https://api.github.com/users/davidpiuva/orgs","repos_url":"https://api.github.com/users/davidpiuva/repos","events_url":"https://api.github.com/users/davidpiuva/events{/privacy}","received_events_url":"https://api.github.com/users/davidpiuva/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/davidpiuva/ooc-kean","description":"OOC port of parts of Kean.","fork":true,"url":"https://api.github.com/repos/davidpiuva/ooc-kean","forks_url":"https://api.github.com/repos/davidpiuva/ooc-kean/forks","keys_url":"https://api.github.com/repos/davidpiuva/ooc-kean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davidpiuva/ooc-kean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davidpiuva/ooc-kean/teams","hooks_url":"https://api.github.com/repos/davidpiuva/ooc-kean/hooks","issue_events_url":"https://api.github.com/repos/davidpiuva/ooc-kean/issues/events{/number}","events_url":"https://api.github.com/repos/davidpiuva/ooc-kean/events","assignees_url":"https://api.github.com/repos/davidpiuva/ooc-kean/assignees{/user}","branches_url":"https://api.github.com/repos/davidpiuva/ooc-kean/branches{/branch}","tags_url":"https://api.github.com/repos/davidpiuva/ooc-kean/tags","blobs_url":"https://api.github.com/repos/davidpiuva/ooc-kean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davidpiuva/ooc-kean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davidpiuva/ooc-kean/git/refs{/sha}","trees_url":"https://api.github.com/repos/davidpiuva/ooc-kean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davidpiuva/ooc-kean/statuses/{sha}","languages_url":"https://api.github.com/repos/davidpiuva/ooc-kean/languages","stargazers_url":"https://api.github.com/repos/davidpiuva/ooc-kean/stargazers","contributors_url":"https://api.github.com/repos/davidpiuva/ooc-kean/contributors","subscribers_url":"https://api.github.com/repos/davidpiuva/ooc-kean/subscribers","subscription_url":"https://api.github.com/repos/davidpiuva/ooc-kean/subscription","commits_url":"https://api.github.com/repos/davidpiuva/ooc-kean/commits{/sha}","git_commits_url":"https://api.github.com/repos/davidpiuva/ooc-kean/git/commits{/sha}","comments_url":"https://api.github.com/repos/davidpiuva/ooc-kean/comments{/number}","issue_comment_url":"https://api.github.com/repos/davidpiuva/ooc-kean/issues/comments{/number}","contents_url":"https://api.github.com/repos/davidpiuva/ooc-kean/contents/{+path}","compare_url":"https://api.github.com/repos/davidpiuva/ooc-kean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davidpiuva/ooc-kean/merges","archive_url":"https://api.github.com/repos/davidpiuva/ooc-kean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davidpiuva/ooc-kean/downloads","issues_url":"https://api.github.com/repos/davidpiuva/ooc-kean/issues{/number}","pulls_url":"https://api.github.com/repos/davidpiuva/ooc-kean/pulls{/number}","milestones_url":"https://api.github.com/repos/davidpiuva/ooc-kean/milestones{/number}","notifications_url":"https://api.github.com/repos/davidpiuva/ooc-kean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davidpiuva/ooc-kean/labels{/name}","releases_url":"https://api.github.com/repos/davidpiuva/ooc-kean/releases{/id}","deployments_url":"https://api.github.com/repos/davidpiuva/ooc-kean/deployments","created_at":"2014-12-15T12:34:56Z","updated_at":"2016-01-21T11:50:29Z","pushed_at":"2016-05-04T06:03:53Z","git_url":"git://github.com/davidpiuva/ooc-kean.git","ssh_url":"git@github.com:davidpiuva/ooc-kean.git","clone_url":"https://github.com/davidpiuva/ooc-kean.git","svn_url":"https://github.com/davidpiuva/ooc-kean","homepage":null,"size":31726,"stargazers_count":0,"watchers_count":0,"language":"ooc","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"magic-lang:develop","ref":"develop","sha":"1f5190822ae323eaf5fa2d7456284afc75e79b1d","user":{"login":"magic-lang","id":16756691,"avatar_url":"https://avatars.githubusercontent.com/u/16756691?v=3","gravatar_id":"","url":"https://api.github.com/users/magic-lang","html_url":"https://github.com/magic-lang","followers_url":"https://api.github.com/users/magic-lang/followers","following_url":"https://api.github.com/users/magic-lang/following{/other_user}","gists_url":"https://api.github.com/users/magic-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/magic-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magic-lang/subscriptions","organizations_url":"https://api.github.com/users/magic-lang/orgs","repos_url":"https://api.github.com/users/magic-lang/repos","events_url":"https://api.github.com/users/magic-lang/events{/privacy}","received_events_url":"https://api.github.com/users/magic-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":25256330,"name":"ooc-kean","full_name":"magic-lang/ooc-kean","owner":{"login":"magic-lang","id":16756691,"avatar_url":"https://avatars.githubusercontent.com/u/16756691?v=3","gravatar_id":"","url":"https://api.github.com/users/magic-lang","html_url":"https://github.com/magic-lang","followers_url":"https://api.github.com/users/magic-lang/followers","following_url":"https://api.github.com/users/magic-lang/following{/other_user}","gists_url":"https://api.github.com/users/magic-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/magic-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magic-lang/subscriptions","organizations_url":"https://api.github.com/users/magic-lang/orgs","repos_url":"https://api.github.com/users/magic-lang/repos","events_url":"https://api.github.com/users/magic-lang/events{/privacy}","received_events_url":"https://api.github.com/users/magic-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/magic-lang/ooc-kean","description":"ooc port of parts of Kean.","fork":false,"url":"https://api.github.com/repos/magic-lang/ooc-kean","forks_url":"https://api.github.com/repos/magic-lang/ooc-kean/forks","keys_url":"https://api.github.com/repos/magic-lang/ooc-kean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/magic-lang/ooc-kean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/magic-lang/ooc-kean/teams","hooks_url":"https://api.github.com/repos/magic-lang/ooc-kean/hooks","issue_events_url":"https://api.github.com/repos/magic-lang/ooc-kean/issues/events{/number}","events_url":"https://api.github.com/repos/magic-lang/ooc-kean/events","assignees_url":"https://api.github.com/repos/magic-lang/ooc-kean/assignees{/user}","branches_url":"https://api.github.com/repos/magic-lang/ooc-kean/branches{/branch}","tags_url":"https://api.github.com/repos/magic-lang/ooc-kean/tags","blobs_url":"https://api.github.com/repos/magic-lang/ooc-kean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/magic-lang/ooc-kean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/magic-lang/ooc-kean/git/refs{/sha}","trees_url":"https://api.github.com/repos/magic-lang/ooc-kean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/magic-lang/ooc-kean/statuses/{sha}","languages_url":"https://api.github.com/repos/magic-lang/ooc-kean/languages","stargazers_url":"https://api.github.com/repos/magic-lang/ooc-kean/stargazers","contributors_url":"https://api.github.com/repos/magic-lang/ooc-kean/contributors","subscribers_url":"https://api.github.com/repos/magic-lang/ooc-kean/subscribers","subscription_url":"https://api.github.com/repos/magic-lang/ooc-kean/subscription","commits_url":"https://api.github.com/repos/magic-lang/ooc-kean/commits{/sha}","git_commits_url":"https://api.github.com/repos/magic-lang/ooc-kean/git/commits{/sha}","comments_url":"https://api.github.com/repos/magic-lang/ooc-kean/comments{/number}","issue_comment_url":"https://api.github.com/repos/magic-lang/ooc-kean/issues/comments{/number}","contents_url":"https://api.github.com/repos/magic-lang/ooc-kean/contents/{+path}","compare_url":"https://api.github.com/repos/magic-lang/ooc-kean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/magic-lang/ooc-kean/merges","archive_url":"https://api.github.com/repos/magic-lang/ooc-kean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/magic-lang/ooc-kean/downloads","issues_url":"https://api.github.com/repos/magic-lang/ooc-kean/issues{/number}","pulls_url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls{/number}","milestones_url":"https://api.github.com/repos/magic-lang/ooc-kean/milestones{/number}","notifications_url":"https://api.github.com/repos/magic-lang/ooc-kean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/magic-lang/ooc-kean/labels{/name}","releases_url":"https://api.github.com/repos/magic-lang/ooc-kean/releases{/id}","deployments_url":"https://api.github.com/repos/magic-lang/ooc-kean/deployments","created_at":"2014-10-15T13:42:17Z","updated_at":"2016-03-02T07:55:35Z","pushed_at":"2016-05-04T07:34:20Z","git_url":"git://github.com/magic-lang/ooc-kean.git","ssh_url":"git@github.com:magic-lang/ooc-kean.git","clone_url":"https://github.com/magic-lang/ooc-kean.git","svn_url":"https://github.com/magic-lang/ooc-kean","homepage":"","size":32272,"stargazers_count":4,"watchers_count":4,"language":"ooc","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":25,"forks":23,"open_issues":25,"watchers":4,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1691"},"html":{"href":"https://github.com/magic-lang/ooc-kean/pull/1691"},"issue":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/issues/1691"},"comments":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/issues/1691/comments"},"review_comments":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1691/comments"},"review_comment":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1691/commits"},"statuses":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/statuses/af325cf3cfb19e2b83bf1c2567b60165c6800021"}}}}