{"action":"created","comment":{"url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/pulls/comments/60194918","id":60194918,"diff_hunk":"@@ -0,0 +1,84 @@\n+// Copyright (c) 2016 Lightricks. All rights reserved.\n+// Created by Michael Kupchick.\n+\n+#import <Expecta/Expecta.h>\n+#import <GLKit/GLKit.h>\n+#import <Specta/Specta.h>\n+\n+#import \"RectRenderer.h\"\n+#import \"ResourceFactory.h\"\n+#import \"TestUtils.h\"\n+#import \"UIImageUtils.h\"\n+\n+SpecBegin(RectRenderer)\n+\n+  __block EAGLContext *glContext;\n+  __block id<Program> program;\n+  __block id<Texture2D> texture;\n+  __block RectRenderer *renderer;\n+\n+  __block uint8_t sourceData[] = {0, 1, 2, 3,\n+    4, 5, 6, 7,\n+    8, 9, 10, 11,\n+    12, 13, 14, 15};\n+\n+  __block uint8_t *sourceDataPtr = &sourceData[0];\n+\n+  beforeEach(^{\n+    glContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];\n+    program = [ResourceFactory programFromBundleWithResourceName:@\"Rect\"];\n+\n+    Texture2DProps *props = [[Texture2DProps alloc] initWithWidth:2 heigth:2\n+                                                             type:TEX_TYPE_UNSIGNED_BYTE\n+                                                           format:TEX_FRMT_RGBA];\n+    texture = [ResourceFactory textureWithProps:props andData:sourceDataPtr];\n+    renderer = [[RectRenderer alloc] initWithTexture:texture program:program];\n+  });\n+  \n+  it(@\"should not be null and have properties set\", ^{\n+    expect(renderer).notTo.beNil();\n+    expect(renderer.sourceTexture).to.beIdenticalTo(texture);\n+    expect(renderer.program).to.beIdenticalTo(program);\n+  });\n+\n+//  it(@\"should render image to texture with same size correctly\", ^{\n+//    id<FrameBuffer> frameBuffer = [ResourceFactory frameBuffer];\n+//    id<Texture2D> targetTexture = [ResourceFactory textureWithProps:texture.props andData:NULL];\n+//\n+//    size_t bytesPerRow = texture.props.bitsPerPixel / 8 * texture.props.width;\n+//    size_t bytesCount = bytesPerRow * texture.props.height;\n+//\n+//    __block uint8_t resultData[16];\n+//    memset(resultData, 0, bytesCount);\n+//    __block uint8_t *resultDataPtr = &resultData[0];\n+//\n+//    [Scope bind:frameBuffer andExecute:^{\n+//      RectI viewPortRect = RectIMake(0, 0, (int32_t)texture.props.width, (int32_t)texture.props.height);\n+//\n+//      frameBuffer.colorAttachment = targetTexture;\n+//      NSError *error = [frameBuffer checkStatus];\n+//      expect(error).to.beNil();\n+//\n+//      [frameBuffer viewPortRect:viewPortRect];\n+//\n+//      CGRect rect = CGRectMake(0, 0, viewPortRect.width, viewPortRect.height);\n+//      [renderer drawRect:rect];\n+//\n+//      [frameBuffer readPixelsFromRect:viewPortRect format:targetTexture.props.format\n+//                                 type:targetTexture.props.type data:resultDataPtr];\n+//    }];\n+//\n+//    /// image will be rendered upside down due to opengl coordinate system.\n+//    BOOL equal = YES;\n+//    for (size_t row = 0; row < texture.props.height && equal; ++row) {\n+//      uint8_t *sourcePtr = sourceDataPtr + row * bytesPerRow;\n+//      uint8_t *resultPtr = (uint8_t *)resultDataPtr + (texture.props.height - row - 1) * bytesPerRow;\n+//      for (size_t x = 0; x < bytesPerRow && equal; ++x) {\n+//        equal = sourcePtr[x] == resultPtr[x];\n+//      }\n+//    }\n+//\n+//    expect(equal).to.beTruthy();\n+//  });\n+\n+SpecEnd","path":"opengl-exTests/RectRendererSpec.mm","position":84,"original_position":84,"commit_id":"4b8a384ffa0de49777f5e902faa38d73ba0546a6","original_commit_id":"4b8a384ffa0de49777f5e902faa38d73ba0546a6","user":{"login":"amit-goldstein","id":3172498,"avatar_url":"https://avatars.githubusercontent.com/u/3172498?v=3","gravatar_id":"","url":"https://api.github.com/users/amit-goldstein","html_url":"https://github.com/amit-goldstein","followers_url":"https://api.github.com/users/amit-goldstein/followers","following_url":"https://api.github.com/users/amit-goldstein/following{/other_user}","gists_url":"https://api.github.com/users/amit-goldstein/gists{/gist_id}","starred_url":"https://api.github.com/users/amit-goldstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amit-goldstein/subscriptions","organizations_url":"https://api.github.com/users/amit-goldstein/orgs","repos_url":"https://api.github.com/users/amit-goldstein/repos","events_url":"https://api.github.com/users/amit-goldstein/events{/privacy}","received_events_url":"https://api.github.com/users/amit-goldstein/received_events","type":"User","site_admin":false},"body":"missing empty line","created_at":"2016-04-19T08:59:43Z","updated_at":"2016-04-19T08:59:43Z","html_url":"https://github.com/amit-goldstein/ToneMapperMichael/pull/1#discussion_r60194918","pull_request_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/pulls/comments/60194918"},"html":{"href":"https://github.com/amit-goldstein/ToneMapperMichael/pull/1#discussion_r60194918"},"pull_request":{"href":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/pulls/1","id":66178713,"html_url":"https://github.com/amit-goldstein/ToneMapperMichael/pull/1","diff_url":"https://github.com/amit-goldstein/ToneMapperMichael/pull/1.diff","patch_url":"https://github.com/amit-goldstein/ToneMapperMichael/pull/1.patch","issue_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/issues/1","number":1,"state":"open","locked":false,"title":"Feature/opengl wrapper","user":{"login":"michaellightricks","id":17297304,"avatar_url":"https://avatars.githubusercontent.com/u/17297304?v=3","gravatar_id":"","url":"https://api.github.com/users/michaellightricks","html_url":"https://github.com/michaellightricks","followers_url":"https://api.github.com/users/michaellightricks/followers","following_url":"https://api.github.com/users/michaellightricks/following{/other_user}","gists_url":"https://api.github.com/users/michaellightricks/gists{/gist_id}","starred_url":"https://api.github.com/users/michaellightricks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaellightricks/subscriptions","organizations_url":"https://api.github.com/users/michaellightricks/orgs","repos_url":"https://api.github.com/users/michaellightricks/repos","events_url":"https://api.github.com/users/michaellightricks/events{/privacy}","received_events_url":"https://api.github.com/users/michaellightricks/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-12T15:32:45Z","updated_at":"2016-04-19T08:59:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5cbbb05b96392950065cbcb987537039ef761e38","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/pulls/1/commits","review_comments_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/pulls/1/comments","review_comment_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/pulls/comments{/number}","comments_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/issues/1/comments","statuses_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/statuses/4b8a384ffa0de49777f5e902faa38d73ba0546a6","head":{"label":"michaellightricks:feature/opengl_wrapper","ref":"feature/opengl_wrapper","sha":"4b8a384ffa0de49777f5e902faa38d73ba0546a6","user":{"login":"michaellightricks","id":17297304,"avatar_url":"https://avatars.githubusercontent.com/u/17297304?v=3","gravatar_id":"","url":"https://api.github.com/users/michaellightricks","html_url":"https://github.com/michaellightricks","followers_url":"https://api.github.com/users/michaellightricks/followers","following_url":"https://api.github.com/users/michaellightricks/following{/other_user}","gists_url":"https://api.github.com/users/michaellightricks/gists{/gist_id}","starred_url":"https://api.github.com/users/michaellightricks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaellightricks/subscriptions","organizations_url":"https://api.github.com/users/michaellightricks/orgs","repos_url":"https://api.github.com/users/michaellightricks/repos","events_url":"https://api.github.com/users/michaellightricks/events{/privacy}","received_events_url":"https://api.github.com/users/michaellightricks/received_events","type":"User","site_admin":false},"repo":{"id":54562807,"name":"ToneMapperMichael","full_name":"michaellightricks/ToneMapperMichael","owner":{"login":"michaellightricks","id":17297304,"avatar_url":"https://avatars.githubusercontent.com/u/17297304?v=3","gravatar_id":"","url":"https://api.github.com/users/michaellightricks","html_url":"https://github.com/michaellightricks","followers_url":"https://api.github.com/users/michaellightricks/followers","following_url":"https://api.github.com/users/michaellightricks/following{/other_user}","gists_url":"https://api.github.com/users/michaellightricks/gists{/gist_id}","starred_url":"https://api.github.com/users/michaellightricks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaellightricks/subscriptions","organizations_url":"https://api.github.com/users/michaellightricks/orgs","repos_url":"https://api.github.com/users/michaellightricks/repos","events_url":"https://api.github.com/users/michaellightricks/events{/privacy}","received_events_url":"https://api.github.com/users/michaellightricks/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/michaellightricks/ToneMapperMichael","description":"","fork":true,"url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael","forks_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/forks","keys_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/keys{/key_id}","collaborators_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/teams","hooks_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/hooks","issue_events_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/issues/events{/number}","events_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/events","assignees_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/assignees{/user}","branches_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/branches{/branch}","tags_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/tags","blobs_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/git/refs{/sha}","trees_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/git/trees{/sha}","statuses_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/statuses/{sha}","languages_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/languages","stargazers_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/stargazers","contributors_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/contributors","subscribers_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/subscribers","subscription_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/subscription","commits_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/commits{/sha}","git_commits_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/git/commits{/sha}","comments_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/comments{/number}","issue_comment_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/issues/comments{/number}","contents_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/contents/{+path}","compare_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/compare/{base}...{head}","merges_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/merges","archive_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/downloads","issues_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/issues{/number}","pulls_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/pulls{/number}","milestones_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/milestones{/number}","notifications_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/labels{/name}","releases_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/releases{/id}","deployments_url":"https://api.github.com/repos/michaellightricks/ToneMapperMichael/deployments","created_at":"2016-03-23T13:42:14Z","updated_at":"2016-03-23T12:45:36Z","pushed_at":"2016-04-12T16:21:08Z","git_url":"git://github.com/michaellightricks/ToneMapperMichael.git","ssh_url":"git@github.com:michaellightricks/ToneMapperMichael.git","clone_url":"https://github.com/michaellightricks/ToneMapperMichael.git","svn_url":"https://github.com/michaellightricks/ToneMapperMichael","homepage":null,"size":1599,"stargazers_count":0,"watchers_count":0,"language":null,"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":"amit-goldstein:master","ref":"master","sha":"8c9bc7ee3d163e2c6d098986314c98b3dd2837a2","user":{"login":"amit-goldstein","id":3172498,"avatar_url":"https://avatars.githubusercontent.com/u/3172498?v=3","gravatar_id":"","url":"https://api.github.com/users/amit-goldstein","html_url":"https://github.com/amit-goldstein","followers_url":"https://api.github.com/users/amit-goldstein/followers","following_url":"https://api.github.com/users/amit-goldstein/following{/other_user}","gists_url":"https://api.github.com/users/amit-goldstein/gists{/gist_id}","starred_url":"https://api.github.com/users/amit-goldstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amit-goldstein/subscriptions","organizations_url":"https://api.github.com/users/amit-goldstein/orgs","repos_url":"https://api.github.com/users/amit-goldstein/repos","events_url":"https://api.github.com/users/amit-goldstein/events{/privacy}","received_events_url":"https://api.github.com/users/amit-goldstein/received_events","type":"User","site_admin":false},"repo":{"id":54559095,"name":"ToneMapperMichael","full_name":"amit-goldstein/ToneMapperMichael","owner":{"login":"amit-goldstein","id":3172498,"avatar_url":"https://avatars.githubusercontent.com/u/3172498?v=3","gravatar_id":"","url":"https://api.github.com/users/amit-goldstein","html_url":"https://github.com/amit-goldstein","followers_url":"https://api.github.com/users/amit-goldstein/followers","following_url":"https://api.github.com/users/amit-goldstein/following{/other_user}","gists_url":"https://api.github.com/users/amit-goldstein/gists{/gist_id}","starred_url":"https://api.github.com/users/amit-goldstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amit-goldstein/subscriptions","organizations_url":"https://api.github.com/users/amit-goldstein/orgs","repos_url":"https://api.github.com/users/amit-goldstein/repos","events_url":"https://api.github.com/users/amit-goldstein/events{/privacy}","received_events_url":"https://api.github.com/users/amit-goldstein/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/amit-goldstein/ToneMapperMichael","description":"","fork":false,"url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael","forks_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/forks","keys_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/teams","hooks_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/hooks","issue_events_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/issues/events{/number}","events_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/events","assignees_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/assignees{/user}","branches_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/branches{/branch}","tags_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/tags","blobs_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/git/refs{/sha}","trees_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/statuses/{sha}","languages_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/languages","stargazers_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/stargazers","contributors_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/contributors","subscribers_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/subscribers","subscription_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/subscription","commits_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/commits{/sha}","git_commits_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/git/commits{/sha}","comments_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/comments{/number}","issue_comment_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/issues/comments{/number}","contents_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/contents/{+path}","compare_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/merges","archive_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/downloads","issues_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/issues{/number}","pulls_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/pulls{/number}","milestones_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/milestones{/number}","notifications_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/labels{/name}","releases_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/releases{/id}","deployments_url":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/deployments","created_at":"2016-03-23T12:45:36Z","updated_at":"2016-03-23T12:45:36Z","pushed_at":"2016-04-12T16:21:08Z","git_url":"git://github.com/amit-goldstein/ToneMapperMichael.git","ssh_url":"git@github.com:amit-goldstein/ToneMapperMichael.git","clone_url":"https://github.com/amit-goldstein/ToneMapperMichael.git","svn_url":"https://github.com/amit-goldstein/ToneMapperMichael","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/pulls/1"},"html":{"href":"https://github.com/amit-goldstein/ToneMapperMichael/pull/1"},"issue":{"href":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/issues/1"},"comments":{"href":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/amit-goldstein/ToneMapperMichael/statuses/4b8a384ffa0de49777f5e902faa38d73ba0546a6"}}}}