摘要 |
An HTML5 Canvas application processing method and device, and a storage medium. The method comprises: in a first thread, a CPU executing a graphic drawing application code to draw each frame of a canvas, and when it is detected that rendering is needed, caching all canvas graphic drawing instructions in the frame of the canvas rather than executing corresponding rendering; after completing the drawing of the frame of the canvas, sending all the cached canvas graphic drawing instructions of the frame of the canvas to a second thread; and in a second thread, the CPU invoking a GPU to execute all the canvas graphic drawing instructions of the frame of the canvas which are sent from the first thread, and the GPU performing rendering on each frame of the canvas in sequence according to the canvas graphic drawing instructions. The concurrent thread processing is realized by way of caching the graphic drawing instructions, so as to make JavaScript codes and the rendering be executed simultaneously, thereby making full use of resources in different threads, greatly improving the reaction speed of the HTML5 Canvas application, and realizing the performance improvement of the HTML5 Canvas application. |