{"action":"created","comment":{"url":"https://api.github.com/repos/kivy/kivy/pulls/comments/193992271","pull_request_review_id":127080292,"id":193992271,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5Mzk5MjI3MQ==","diff_hunk":"@@ -686,3 +707,36 @@ cdef SDL_Surface* flipVert(SDL_Surface* sfc):\n         memcpy(&rpixels[pos], &pixels[(pxlength - pos) - pitch], pitch)\n \n     return result\n+\n+cdef SDL_Surface* surface_from_core_image(core_image):\n+    # Create an SDL_Surface from a core image's texture pixels. Use\n+    # SDL_FreeSurface(surface) to deallocate.\n+    #\n+    # Returns NULL if the core image has no texture pixels, or if\n+    # there's a problem with the creation of an SDL Surface.\n+    cdef int width, height\n+    width, height = core_image.size\n+    cdef int pitch = width * 4\n+    cdef bytes pixels\n+    cdef char* sdl_error\n+    try:\n+        pixels = core_image.image.texture.pixels\n+    except AttributeError:\n+        return NULL\n+\n+    if pixels == None:\n+        return NULL\n+\n+    cdef Uint8 *c_pixels = pixels\n+    cdef SDL_Surface *surface\n+    surface = SDL_CreateRGBSurface(0, width, height, 32,\n+        0x00000000ff, 0x0000ff00, 0x00ff0000, 0xff000000)\n+    if surface == NULL:\n+        sdl_error = SDL_GetError()\n+        Logger.warn(\n+            \"Window: Can't create a surface from a core image: %s\" % sdl_error","path":"kivy/core/window/_window_sdl2.pyx","position":114,"original_position":114,"commit_id":"8c96bddb2fe04e2e2a3f9150ccc49b1a8096dd4e","original_commit_id":"8c96bddb2fe04e2e2a3f9150ccc49b1a8096dd4e","user":{"login":"dolang","id":20233709,"node_id":"MDQ6VXNlcjIwMjMzNzA5","avatar_url":"https://avatars3.githubusercontent.com/u/20233709?v=4","gravatar_id":"","url":"https://api.github.com/users/dolang","html_url":"https://github.com/dolang","followers_url":"https://api.github.com/users/dolang/followers","following_url":"https://api.github.com/users/dolang/following{/other_user}","gists_url":"https://api.github.com/users/dolang/gists{/gist_id}","starred_url":"https://api.github.com/users/dolang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dolang/subscriptions","organizations_url":"https://api.github.com/users/dolang/orgs","repos_url":"https://api.github.com/users/dolang/repos","events_url":"https://api.github.com/users/dolang/events{/privacy}","received_events_url":"https://api.github.com/users/dolang/received_events","type":"User","site_admin":false},"body":"Not entirely sure how `char *` interact with Python strings, yet.","created_at":"2018-06-08T08:50:31Z","updated_at":"2018-06-08T08:50:32Z","html_url":"https://github.com/kivy/kivy/pull/5785#discussion_r193992271","pull_request_url":"https://api.github.com/repos/kivy/kivy/pulls/5785","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/kivy/kivy/pulls/comments/193992271"},"html":{"href":"https://github.com/kivy/kivy/pull/5785#discussion_r193992271"},"pull_request":{"href":"https://api.github.com/repos/kivy/kivy/pulls/5785"}}},"pull_request":{"url":"https://api.github.com/repos/kivy/kivy/pulls/5785","id":192241369,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyMjQxMzY5","html_url":"https://github.com/kivy/kivy/pull/5785","diff_url":"https://github.com/kivy/kivy/pull/5785.diff","patch_url":"https://github.com/kivy/kivy/pull/5785.patch","issue_url":"https://api.github.com/repos/kivy/kivy/issues/5785","number":5785,"state":"open","locked":false,"title":"Remove SDL image dependence from SDL2 Window","user":{"login":"dolang","id":20233709,"node_id":"MDQ6VXNlcjIwMjMzNzA5","avatar_url":"https://avatars3.githubusercontent.com/u/20233709?v=4","gravatar_id":"","url":"https://api.github.com/users/dolang","html_url":"https://github.com/dolang","followers_url":"https://api.github.com/users/dolang/followers","following_url":"https://api.github.com/users/dolang/following{/other_user}","gists_url":"https://api.github.com/users/dolang/gists{/gist_id}","starred_url":"https://api.github.com/users/dolang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dolang/subscriptions","organizations_url":"https://api.github.com/users/dolang/orgs","repos_url":"https://api.github.com/users/dolang/repos","events_url":"https://api.github.com/users/dolang/events{/privacy}","received_events_url":"https://api.github.com/users/dolang/received_events","type":"User","site_admin":false},"body":"**WIP**, or rather, proof of concept. Needs review.\r\n\r\nSDL2 currently depends on the SDL image project, even when PIL is used as the image provider. There are 3 API calls in `_window_sdl2.py` which make this a necessity.\r\n\r\nThis is to remove that dependency by replacing those calls with the `core.image` API.\r\n\r\nThe `surface_from_core_image()` is adapted from `_img_sdl2.pyx`. I've been able to test both the icon code and the screenshot code, but I'm unable to enable a shaped window (with or without my modifications). Also, I'm not sure if the `SDL_FreeSurface()` is required there.\r\n\r\nSecond commit fixes a minor API inconsistency.","created_at":"2018-06-03T10:51:40Z","updated_at":"2018-06-08T08:50:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"26a1b45155d6ab193aada5a38c5b069f29067a54","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":69530413,"node_id":"MDU6TGFiZWw2OTUzMDQxMw==","url":"https://api.github.com/repos/kivy/kivy/labels/needs-analysis","name":"needs-analysis","color":"207de5","default":false},{"id":511179520,"node_id":"MDU6TGFiZWw1MTExNzk1MjA=","url":"https://api.github.com/repos/kivy/kivy/labels/needs-testing","name":"needs-testing","color":"c2e0c6","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kivy/kivy/pulls/5785/commits","review_comments_url":"https://api.github.com/repos/kivy/kivy/pulls/5785/comments","review_comment_url":"https://api.github.com/repos/kivy/kivy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kivy/kivy/issues/5785/comments","statuses_url":"https://api.github.com/repos/kivy/kivy/statuses/8c96bddb2fe04e2e2a3f9150ccc49b1a8096dd4e","head":{"label":"dolang:no-sdl-window-image-dependence","ref":"no-sdl-window-image-dependence","sha":"8c96bddb2fe04e2e2a3f9150ccc49b1a8096dd4e","user":{"login":"dolang","id":20233709,"node_id":"MDQ6VXNlcjIwMjMzNzA5","avatar_url":"https://avatars3.githubusercontent.com/u/20233709?v=4","gravatar_id":"","url":"https://api.github.com/users/dolang","html_url":"https://github.com/dolang","followers_url":"https://api.github.com/users/dolang/followers","following_url":"https://api.github.com/users/dolang/following{/other_user}","gists_url":"https://api.github.com/users/dolang/gists{/gist_id}","starred_url":"https://api.github.com/users/dolang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dolang/subscriptions","organizations_url":"https://api.github.com/users/dolang/orgs","repos_url":"https://api.github.com/users/dolang/repos","events_url":"https://api.github.com/users/dolang/events{/privacy}","received_events_url":"https://api.github.com/users/dolang/received_events","type":"User","site_admin":false},"repo":{"id":132403436,"node_id":"MDEwOlJlcG9zaXRvcnkxMzI0MDM0MzY=","name":"kivy","full_name":"dolang/kivy","owner":{"login":"dolang","id":20233709,"node_id":"MDQ6VXNlcjIwMjMzNzA5","avatar_url":"https://avatars3.githubusercontent.com/u/20233709?v=4","gravatar_id":"","url":"https://api.github.com/users/dolang","html_url":"https://github.com/dolang","followers_url":"https://api.github.com/users/dolang/followers","following_url":"https://api.github.com/users/dolang/following{/other_user}","gists_url":"https://api.github.com/users/dolang/gists{/gist_id}","starred_url":"https://api.github.com/users/dolang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dolang/subscriptions","organizations_url":"https://api.github.com/users/dolang/orgs","repos_url":"https://api.github.com/users/dolang/repos","events_url":"https://api.github.com/users/dolang/events{/privacy}","received_events_url":"https://api.github.com/users/dolang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dolang/kivy","description":"Open source UI framework written in Python, running on Windows, Linux, macOS, Android and iOS","fork":true,"url":"https://api.github.com/repos/dolang/kivy","forks_url":"https://api.github.com/repos/dolang/kivy/forks","keys_url":"https://api.github.com/repos/dolang/kivy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dolang/kivy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dolang/kivy/teams","hooks_url":"https://api.github.com/repos/dolang/kivy/hooks","issue_events_url":"https://api.github.com/repos/dolang/kivy/issues/events{/number}","events_url":"https://api.github.com/repos/dolang/kivy/events","assignees_url":"https://api.github.com/repos/dolang/kivy/assignees{/user}","branches_url":"https://api.github.com/repos/dolang/kivy/branches{/branch}","tags_url":"https://api.github.com/repos/dolang/kivy/tags","blobs_url":"https://api.github.com/repos/dolang/kivy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dolang/kivy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dolang/kivy/git/refs{/sha}","trees_url":"https://api.github.com/repos/dolang/kivy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dolang/kivy/statuses/{sha}","languages_url":"https://api.github.com/repos/dolang/kivy/languages","stargazers_url":"https://api.github.com/repos/dolang/kivy/stargazers","contributors_url":"https://api.github.com/repos/dolang/kivy/contributors","subscribers_url":"https://api.github.com/repos/dolang/kivy/subscribers","subscription_url":"https://api.github.com/repos/dolang/kivy/subscription","commits_url":"https://api.github.com/repos/dolang/kivy/commits{/sha}","git_commits_url":"https://api.github.com/repos/dolang/kivy/git/commits{/sha}","comments_url":"https://api.github.com/repos/dolang/kivy/comments{/number}","issue_comment_url":"https://api.github.com/repos/dolang/kivy/issues/comments{/number}","contents_url":"https://api.github.com/repos/dolang/kivy/contents/{+path}","compare_url":"https://api.github.com/repos/dolang/kivy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dolang/kivy/merges","archive_url":"https://api.github.com/repos/dolang/kivy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dolang/kivy/downloads","issues_url":"https://api.github.com/repos/dolang/kivy/issues{/number}","pulls_url":"https://api.github.com/repos/dolang/kivy/pulls{/number}","milestones_url":"https://api.github.com/repos/dolang/kivy/milestones{/number}","notifications_url":"https://api.github.com/repos/dolang/kivy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dolang/kivy/labels{/name}","releases_url":"https://api.github.com/repos/dolang/kivy/releases{/id}","deployments_url":"https://api.github.com/repos/dolang/kivy/deployments","created_at":"2018-05-07T03:41:35Z","updated_at":"2018-06-07T16:02:26Z","pushed_at":"2018-06-08T08:00:30Z","git_url":"git://github.com/dolang/kivy.git","ssh_url":"git@github.com:dolang/kivy.git","clone_url":"https://github.com/dolang/kivy.git","svn_url":"https://github.com/dolang/kivy","homepage":"https://kivy.org","size":61708,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kivy:master","ref":"master","sha":"1e29f4a31a3aef136e89665dd15a889aee0d9cf5","user":{"login":"kivy","id":1266152,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNjYxNTI=","avatar_url":"https://avatars0.githubusercontent.com/u/1266152?v=4","gravatar_id":"","url":"https://api.github.com/users/kivy","html_url":"https://github.com/kivy","followers_url":"https://api.github.com/users/kivy/followers","following_url":"https://api.github.com/users/kivy/following{/other_user}","gists_url":"https://api.github.com/users/kivy/gists{/gist_id}","starred_url":"https://api.github.com/users/kivy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kivy/subscriptions","organizations_url":"https://api.github.com/users/kivy/orgs","repos_url":"https://api.github.com/users/kivy/repos","events_url":"https://api.github.com/users/kivy/events{/privacy}","received_events_url":"https://api.github.com/users/kivy/received_events","type":"Organization","site_admin":false},"repo":{"id":1049095,"node_id":"MDEwOlJlcG9zaXRvcnkxMDQ5MDk1","name":"kivy","full_name":"kivy/kivy","owner":{"login":"kivy","id":1266152,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNjYxNTI=","avatar_url":"https://avatars0.githubusercontent.com/u/1266152?v=4","gravatar_id":"","url":"https://api.github.com/users/kivy","html_url":"https://github.com/kivy","followers_url":"https://api.github.com/users/kivy/followers","following_url":"https://api.github.com/users/kivy/following{/other_user}","gists_url":"https://api.github.com/users/kivy/gists{/gist_id}","starred_url":"https://api.github.com/users/kivy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kivy/subscriptions","organizations_url":"https://api.github.com/users/kivy/orgs","repos_url":"https://api.github.com/users/kivy/repos","events_url":"https://api.github.com/users/kivy/events{/privacy}","received_events_url":"https://api.github.com/users/kivy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kivy/kivy","description":"Open source UI framework written in Python, running on Windows, Linux, macOS, Android and iOS","fork":false,"url":"https://api.github.com/repos/kivy/kivy","forks_url":"https://api.github.com/repos/kivy/kivy/forks","keys_url":"https://api.github.com/repos/kivy/kivy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kivy/kivy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kivy/kivy/teams","hooks_url":"https://api.github.com/repos/kivy/kivy/hooks","issue_events_url":"https://api.github.com/repos/kivy/kivy/issues/events{/number}","events_url":"https://api.github.com/repos/kivy/kivy/events","assignees_url":"https://api.github.com/repos/kivy/kivy/assignees{/user}","branches_url":"https://api.github.com/repos/kivy/kivy/branches{/branch}","tags_url":"https://api.github.com/repos/kivy/kivy/tags","blobs_url":"https://api.github.com/repos/kivy/kivy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kivy/kivy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kivy/kivy/git/refs{/sha}","trees_url":"https://api.github.com/repos/kivy/kivy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kivy/kivy/statuses/{sha}","languages_url":"https://api.github.com/repos/kivy/kivy/languages","stargazers_url":"https://api.github.com/repos/kivy/kivy/stargazers","contributors_url":"https://api.github.com/repos/kivy/kivy/contributors","subscribers_url":"https://api.github.com/repos/kivy/kivy/subscribers","subscription_url":"https://api.github.com/repos/kivy/kivy/subscription","commits_url":"https://api.github.com/repos/kivy/kivy/commits{/sha}","git_commits_url":"https://api.github.com/repos/kivy/kivy/git/commits{/sha}","comments_url":"https://api.github.com/repos/kivy/kivy/comments{/number}","issue_comment_url":"https://api.github.com/repos/kivy/kivy/issues/comments{/number}","contents_url":"https://api.github.com/repos/kivy/kivy/contents/{+path}","compare_url":"https://api.github.com/repos/kivy/kivy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kivy/kivy/merges","archive_url":"https://api.github.com/repos/kivy/kivy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kivy/kivy/downloads","issues_url":"https://api.github.com/repos/kivy/kivy/issues{/number}","pulls_url":"https://api.github.com/repos/kivy/kivy/pulls{/number}","milestones_url":"https://api.github.com/repos/kivy/kivy/milestones{/number}","notifications_url":"https://api.github.com/repos/kivy/kivy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kivy/kivy/labels{/name}","releases_url":"https://api.github.com/repos/kivy/kivy/releases{/id}","deployments_url":"https://api.github.com/repos/kivy/kivy/deployments","created_at":"2010-11-03T20:27:32Z","updated_at":"2018-06-08T08:48:50Z","pushed_at":"2018-06-08T08:00:35Z","git_url":"git://github.com/kivy/kivy.git","ssh_url":"git@github.com:kivy/kivy.git","clone_url":"https://github.com/kivy/kivy.git","svn_url":"https://github.com/kivy/kivy","homepage":"https://kivy.org","size":61649,"stargazers_count":7673,"watchers_count":7673,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1777,"mirror_url":null,"archived":false,"open_issues_count":647,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1777,"open_issues":647,"watchers":7673,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kivy/kivy/pulls/5785"},"html":{"href":"https://github.com/kivy/kivy/pull/5785"},"issue":{"href":"https://api.github.com/repos/kivy/kivy/issues/5785"},"comments":{"href":"https://api.github.com/repos/kivy/kivy/issues/5785/comments"},"review_comments":{"href":"https://api.github.com/repos/kivy/kivy/pulls/5785/comments"},"review_comment":{"href":"https://api.github.com/repos/kivy/kivy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kivy/kivy/pulls/5785/commits"},"statuses":{"href":"https://api.github.com/repos/kivy/kivy/statuses/8c96bddb2fe04e2e2a3f9150ccc49b1a8096dd4e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dolang"}}