Method, apparatus and storage medium for processing HTML5 canvas application

    公开(公告)号:US10346018B2

    公开(公告)日:2019-07-09

    申请号:US14980590

    申请日:2015-12-28

    Inventor: Xuxin Yi

    Abstract: The present invention provides a method, an apparatus and a storage medium for processing an HTML5 Canvas application, said method comprising: in the first thread: CPU executes codes of a graphic drawing application to draw each frame of canvas, when it is detected that rendering is needed, all canvas drawing commands of said frame of canvas are cached without executing the corresponding rendering, and when the drawing of said frame of canvas is completed, all the cached canvas drawing commands of said frame of canvas are sent to a second thread; in the second thread, CPU calls GPU to execute all canvas drawing commands of each frame of canvas sent by the first thread, and GPU performs rendering on each frame of canvas according to the canvas drawing commands. The present invention realizes concurrent thread processing by means of caching drawing commands such that JavaScript codes and rendering can be executed simultaneously. As a result, resources of different threads are fully used to greatly increase the response speed of the HTML5 Canvas application and improve the performance of the HTML5 Canvas application.

    Canvas element rendering method and apparatus implemented on android system based on GPU

    公开(公告)号:US10013503B2

    公开(公告)日:2018-07-03

    申请号:US14901431

    申请日:2013-11-22

    Inventor: Jie Liang Xuxin Yi

    CPC classification number: G06F16/9577 G06F16/957 G06F17/2247 G06T1/20

    Abstract: Embodiments of the disclosure are directed to HTML5 Canvas element rendering methods implemented on an Android system based on GPU hardware. The methods may include after a rendering operation instruction for a Canvas element in an HTML5 web page is detected and an initialization operation is completed, converting an invoking instruction for a 2D Canvas drawing API into an invoking instruction for an OpenGL ES API through a Skia GPU function library; setting EGL Context created during the initialization operation as a current context of a thread where a rendering operation is located; rendering the Canvas element in an off-screen local window created during the initialization operation by using the GPU; and copying the rendered Canvas element to a current active window of a device from the off-screen local window by using a mapping operation function of the GPU. The methods, by making use of a local window rendering mechanism provided by an Android operating system and the OpenGL ES API, allow the Canvas element to be drawn and mixed by using the GPU, thereby improving the performance of Canvas rendering by using GPU hardware acceleration.

Patent Agency Ranking