You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/04/13 16:57:54 UTC

[GitHub] [cordova-android] d410 opened a new issue #714: OffscreenCanvas is not functional in Cordova Android, but functional in Chrome Mobile.

d410 opened a new issue #714: OffscreenCanvas is not functional in Cordova Android, but functional in Chrome Mobile.
URL: https://github.com/apache/cordova-android/issues/714
 
 
   # Bug Report
   
   OffscreenCanvas is an interface that allows drawing access to a HTMLCanvasElement without being tied to the DOM (Or document object). It is much different than a canvas created with document.createElement("canvas') as OffscreenCanvas does not require the document object to be created. This lets you use it as a Canvas without requiring synchronization to the DOM, and you can use it as a way of using Canvas within Web Workers.
   
   Many industry standard Javascript graphics libraries like three.js use OffscreenCanvas. It is essential for gaming.
   
   https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas
   
   ## Problem
   
   1. The OffscreenCanvas performs its drawing and updating on Chrome for Windows, Chrome for Android, but not Android Webview.  It does not update or display the OffscreenCanvas on Cordova for Android, using the Android Webview.
   
   2/ The OffscreenCanvas used within a WebWorker performs drawing and updating to OffscreenCanvas on Chrome for Desktop and Chrome for Android, but not for a Cordova Application. It does not update or display the OffscreenCanvas on Cordova for Android, using the Android Webview.
   
   ### What is expected to happen?
   
   In the attached samples, the user should be able to view a red rectangle within a blue rectangle. The first example uses OffscreenCanvas within the main thread. The second uses OffscreenCanvas within a worker thread. On Chrome Mobile v 73, both examples function correctly. On a Cordova Android application featuring the same code as in the examples, nothing displays.
   
   ### What does actually happen?
   
   Nothing Displays in a Cordova Android Application in either example.
   
   ## Information
   Unit testing cannot be performed since this is an issue involving the Canvas API. However, the below code examples demonstrate the code that does not work on Cordova Android.
   
   ### Command or Code
   
   Single-threaded
   Attached is the code for drawing to a canvas with OffscreenCanvas and Canvas2D API.
   https://pastebin.com/PUC48kgk
   
   Multi-threaded
   Attached is the code for drawing to a canvas with OffscreenCanvas and Canvas2D API.
   https://pastebin.com/jfCsbBW3
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you experiencing the issue? -->
   
   Have tested Cordova Android application on a battery of Android capable Phones.
   TCL LX
   LG K7
   LG Aristo
   LG Tribute Dynasty
   All using Chrome Mobile v 73.
   
   
   
   ### Version information
   
   I am using no plugins. Have tried on Cordova as a NPM package 6.x, 7.x, and 8.x, and Cordova 9.
   
   
   ## Checklist
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org