StageXL
StageXL copied to clipboard
clearRect() memory leak on some devices.
As described here (https://github.com/CreateJS/EaselJS/issues/305), there's a memory leak on some android devices with the clearRect method. For me it appeared on the Xperia Z tablet in a webview (stageXL project injected into PhoneGap).
just changing... _context.clearRect(0, 0, _context.canvas.width, _context.canvas.height); to... _context.clearRect(0, 0, _context.canvas.width+1, _context.canvas.height+1); ... does solve the problem.
Crazy!
isn't it ? :smile:
I've got my app finally running with PhoneGap on Xperia ! Now, I have to find if it's possible to improve the disastrous performances in the webView compared to the web Chrome version.
In PhoneGap the JS VM performance may be vastly inferior as the browser - avoid graphics, set cleverly cacheAsBitmap, and just use bitmaps.
On Thu, Oct 17, 2013 at 4:24 PM, Alain Puget [email protected]:
isn't it ? [image: :smile:]
I've got my app finally running with PhoneGap on Xperia ! Now, I have to find if it's possible to improve the disastrous performances in the webView compared to the web Chrome version.
— Reply to this email directly or view it on GitHubhttps://github.com/bp74/StageXL/issues/47#issuecomment-26510082 .
Philippe
Is it a PhoneGap problem or a more general you-should-not-have-tried-to-use-a-webView kind of problem ?
Apps WebViews != Browser. The JS VM is likely to be much slower (esp on iOS).
This is a bit off topic to this issue, but there are various projects trying to work around that, like:
- https://github.com/phonegap/phonegap-plugin-fast-canvas (which is sadly Android-only a too restrictive in terms of API)
- Ludei CocoonJS, similar to PhoneGap but with a much more elaborated OpenGL implementation of Canvas 2D and 3D (may need StageXL adaptations).
My reco would be that Bernhard should look into making StageXL compatible with CocoonJS. This would be a big selling point for StageXL.
On Thu, Oct 17, 2013 at 4:57 PM, Alain Puget [email protected]:
Is it a PhoneGap problem or a more general you-should-not-have-tried-to-use-a-webView kind of problem ?
— Reply to this email directly or view it on GitHubhttps://github.com/bp74/StageXL/issues/47#issuecomment-26514240 .
Philippe
That would be indeed really interesting ! I'm still not very comfortable with low level canvas manipulation so I can't undertake myself that kind of project with the little free time I have these days but I would be more than happy to help test thoroughly any kind of attempt in this direction.
You know, the canvas 2D API is actually fairly simple :)
On Thu, Oct 17, 2013 at 9:57 PM, Alain Puget [email protected]:
That would be indeed really interesting ! I'm still not very comfortable with low level canvas manipulation so I can't undertake myself that kind of project with the little free time I have these days but I would be more than happy to help test thoroughly any kind of attempt in this direction.
— Reply to this email directly or view it on GitHubhttps://github.com/bp74/StageXL/issues/47#issuecomment-26545412 .
Philippe
Yeah it doesn't look that much complicated but I'm used to Flash comfort and its consistent implementation on all platforms. I'm still a bit scared and appalled I must say by the fragmentation of implementations of HTML5 in general and canvas in particular. I actually favored stageXL above all other options because it offered the best consistency of display accross browsers and devices particularly for texts. Getting to know every little trick to achieve this is not something I can afford right now, though I sure would love to have that kind of knowledge :D
Hi guys! I looked at CocoonJS and i really love the idea! It's not only the performance advantage, but also the full integration as a native apps is a big selling point. You get access to the keyboard, camera, sensors, etc...
I will open a new issue especially for the CocoonJS integration.