{"action":"created","issue":{"url":"https://api.github.com/repos/openfl/openfl/issues/502","labels_url":"https://api.github.com/repos/openfl/openfl/issues/502/labels{/name}","comments_url":"https://api.github.com/repos/openfl/openfl/issues/502/comments","events_url":"https://api.github.com/repos/openfl/openfl/issues/502/events","html_url":"https://github.com/openfl/openfl/issues/502","id":57674864,"number":502,"title":"BitmapData.threshold() issues","user":{"login":"azrafe7","id":1266447,"avatar_url":"https://avatars.githubusercontent.com/u/1266447?v=3","gravatar_id":"","url":"https://api.github.com/users/azrafe7","html_url":"https://github.com/azrafe7","followers_url":"https://api.github.com/users/azrafe7/followers","following_url":"https://api.github.com/users/azrafe7/following{/other_user}","gists_url":"https://api.github.com/users/azrafe7/gists{/gist_id}","starred_url":"https://api.github.com/users/azrafe7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azrafe7/subscriptions","organizations_url":"https://api.github.com/users/azrafe7/orgs","repos_url":"https://api.github.com/users/azrafe7/repos","events_url":"https://api.github.com/users/azrafe7/events{/privacy}","received_events_url":"https://api.github.com/users/azrafe7/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-02-14T01:18:49Z","updated_at":"2015-09-24T09:52:30Z","closed_at":"2015-09-16T22:26:36Z","body":"Short desc: it doesn't work consistently across targets (tested with openfl 2.2.6 + lime 2.1.1 on win7).\r\n\r\nNow for the long one:\r\n\r\nI've written some visual tests' code to see in which cases it wouldn't work (see https://gist.github.com/azrafe7/b1acee98175c98504ce1).\r\nThe results of the tests can be summed up by looking at these screenshots (green text -> test passed, red text -> test failed):\r\n\r\n - [flash](https://dl.dropboxusercontent.com/u/32864004/dev/FPDemo/openfl-threshold/flash.png) (i.e. what to be expected - all green!)\r\n - [js](https://dl.dropboxusercontent.com/u/32864004/dev/FPDemo/openfl-threshold/js.png)\r\n - [neko](https://dl.dropboxusercontent.com/u/32864004/dev/FPDemo/openfl-threshold/neko.png)\r\n - [cpp](https://dl.dropboxusercontent.com/u/32864004/dev/FPDemo/openfl-threshold/cpp.png)\r\n\r\nThe good news is that js seems to be easily fixed (passing all tests) by just commenting out these two lines calling `__flipPixel()`: https://github.com/openfl/openfl/blob/950f9e151e15d0e68f4e88fda15854e797137004/openfl/display/BitmapData.hx#L1280-L1281.\r\n\r\nFor cpp/neko I haven't been able to find a fix, but it's interesting to note that `setPixel32()` doesn't seem to work right on neko when involving alpha, while it does on cpp! (confront the bottommost test in the screenshots for neko and cpp).\r\n\r\nSomehow related to this:\r\n - `BitmapData.clone()` has some issues in js, f.e. it won't work with the tests mentioned above (see https://gist.github.com/azrafe7/b1acee98175c98504ce1#file-thresholdtests-hx-L125)\r\n - setting the font to `_typewriter` fails on js, but works on other targets\r\n"},"comment":{"url":"https://api.github.com/repos/openfl/openfl/issues/comments/142877520","html_url":"https://github.com/openfl/openfl/issues/502#issuecomment-142877520","issue_url":"https://api.github.com/repos/openfl/openfl/issues/502","id":142877520,"user":{"login":"azrafe7","id":1266447,"avatar_url":"https://avatars.githubusercontent.com/u/1266447?v=3","gravatar_id":"","url":"https://api.github.com/users/azrafe7","html_url":"https://github.com/azrafe7","followers_url":"https://api.github.com/users/azrafe7/followers","following_url":"https://api.github.com/users/azrafe7/following{/other_user}","gists_url":"https://api.github.com/users/azrafe7/gists{/gist_id}","starred_url":"https://api.github.com/users/azrafe7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azrafe7/subscriptions","organizations_url":"https://api.github.com/users/azrafe7/orgs","repos_url":"https://api.github.com/users/azrafe7/repos","events_url":"https://api.github.com/users/azrafe7/events{/privacy}","received_events_url":"https://api.github.com/users/azrafe7/received_events","type":"User","site_admin":false},"created_at":"2015-09-24T09:52:30Z","updated_at":"2015-09-24T09:52:30Z","body":"Well... GLView says the driver supports OpenGL 2.1 at 100%:\r\n\r\n![opengl](https://cloud.githubusercontent.com/assets/1266447/10070421/aaa3fe16-62b2-11e5-82eb-7b57ede51db9.jpg)\r\n\r\n\r\nbut I recall having the same crash-at-start problem with luxe (haven't retried in a while though)."}}