Nothing Special   »   [go: up one dir, main page]

WO2023160282A1 - Display rendering method and apparatus, electronic device and readable storage medium - Google Patents

Display rendering method and apparatus, electronic device and readable storage medium Download PDF

Info

Publication number
WO2023160282A1
WO2023160282A1 PCT/CN2023/071284 CN2023071284W WO2023160282A1 WO 2023160282 A1 WO2023160282 A1 WO 2023160282A1 CN 2023071284 W CN2023071284 W CN 2023071284W WO 2023160282 A1 WO2023160282 A1 WO 2023160282A1
Authority
WO
WIPO (PCT)
Prior art keywords
canvas
redrawing
sub
target element
interface
Prior art date
Application number
PCT/CN2023/071284
Other languages
French (fr)
Chinese (zh)
Inventor
刘鹏宇
Original Assignee
京东方科技集团股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 京东方科技集团股份有限公司 filed Critical 京东方科技集团股份有限公司
Publication of WO2023160282A1 publication Critical patent/WO2023160282A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present disclosure relates to the computer field, and in particular to a display rendering method, device, electronic equipment and readable storage medium.
  • the display interface When updating the display interface of an electronic device, the display interface is usually redrawn and refreshed based on the canvas (Canvas), but the content displayed by the electronic device may include more complex objects, such as complex pictures or handwriting, etc.
  • the redrawing of complex objects takes a long time, which takes a long time to update the display interface of large-size or high-resolution electronic devices, which may cause flickering or freeze on the display interface, affecting the display Effect.
  • an embodiment of the present disclosure provides a display rendering method applied to an electronic device, and the method includes the following steps:
  • the repainting canvas is overlaid and drawn to the interface rendering canvas, and the display interface is refreshed according to the interface rendering canvas.
  • the generating a repainting canvas, and drawing the target element on the redrawing canvas includes:
  • the plurality of redrawing sub-canvases are superimposed on the redrawing canvas.
  • the multiple redrawing sub-threads are parallel.
  • the number of redrawing sub-canvases is determined according to the computing capability of the electronic device.
  • the redrawing thread and the interface rendering thread are serial.
  • the generating a repainting canvas, and drawing the target element on the repainting canvas further includes:
  • the visible area is an area of the canvas corresponding to the display interface of the electronic device
  • the target element is an element located in the visible area in the canvas data.
  • the target element includes an element corresponding to handwriting corresponding to a writing operation on the electronic device.
  • the electronic device is an intelligent interactive tablet.
  • an embodiment of the present disclosure provides a display rendering device, which is applied to an electronic device, including:
  • the target element acquisition module is used to determine the target element located in the visible area when the canvas data changes;
  • a repainting canvas generating module configured to generate a repainting canvas, and draw the target element on the repainting canvas
  • the interface refreshing module is configured to, in the interface rendering thread, overlay and draw the repainting canvas to the interface rendering canvas, and refresh the display interface according to the interface rendering canvas.
  • an embodiment of the present disclosure provides an electronic device, including: a memory, a processor, and a program stored in the memory and operable on the processor;
  • the processor is configured to read the program in the memory to implement the steps in the display rendering method according to any one of the first aspect.
  • the embodiments of the present disclosure provide a readable storage medium for storing a program, and when the program is executed by a processor, the steps in the display rendering method according to any one of the first aspect are implemented.
  • FIG. 1 is a flowchart of a display rendering method according to an embodiment of the present disclosure
  • FIG. 2 is another flowchart of a display rendering method according to an embodiment of the present disclosure
  • FIG. 3 is a structural diagram showing a rendering device according to an embodiment of the present disclosure
  • FIG. 4 is a structural diagram of an electronic device in an embodiment of the present disclosure.
  • An embodiment of the present disclosure provides a display rendering method.
  • the display rendering method is applied to an electronic device.
  • the electronic device is specifically an intelligent interactive panel, and the intelligent interactive panel usually has a larger display panel and a higher resolution, such as 2K or 4K or even higher resolution.
  • the smart interactive tablet can run based on operating systems such as the Android system.
  • the content to be drawn can be understood as points, lines, arcs, etc. Composed of various elements, if the content to be drawn is complex, it will increase the time to draw the content, which may cause stuttering, flickering and other phenomena during the screen update process, affecting the display effect.
  • the display rendering method includes the following steps:
  • Step 101 When the canvas data changes, determine the target element located in the visible area.
  • the visible area can be understood as the corresponding area on the current display screen, that is, the area corresponding to the canvas and the display interface of the electronic device.
  • the size of the handwriting interface is equal to the display interface of the electronic device, and all the handwriting interfaces are displayed on the display interface. At this point, all handwriting interfaces are visible areas.
  • the display interface only displays a part of the area of the handwriting interface. At this time, the area displayed on the electronic device is a visible area, and the canvas data corresponding to this area is a target element located in the visible area.
  • the display screen displays the area corresponding to all canvases, the visible area corresponds to the entire canvas. In some cases, the display screen corresponds to a part of the canvas area. The screen displayed by the device is only a part of the canvas.
  • the boundary of the visible area can be determined according to the current display interface, and further, elements within the boundary of the visible area can be determined as target elements.
  • Step 102 In the redrawing thread, generate a redrawing canvas, and draw the target element on the redrawing canvas.
  • a redrawing thread is established.
  • a redrawing canvas is provided, and target elements to be drawn are drawn on the redrawing canvas.
  • step 102 includes:
  • the preset number threshold is determined according to the hardware and software performance of the electronic device. It should be understood that electronic devices with different hardware and software can provide different computing capabilities. If the computing capabilities provided are relatively The higher the number of elements that can be drawn in the unit time of a redrawing thread, the more elements can be drawn in the unit time of a redrawing thread. Correspondingly, if the provided computing power is relatively low, the The number of elements is also reduced.
  • the target elements can be directly drawn on the redrawing canvas.
  • the preset number threshold can be determined according to the computing power provided by the electronic device.
  • the preset number threshold can be set to be equal to or slightly lower than the number of redrawing threads that can be drawn per unit time. The value of the number of elements.
  • the target elements can be directly drawn on the repainting canvas.
  • the number of target elements is relatively large, for example greater than the preset number threshold, multiple redrawing threads are established to increase the drawing speed of the target elements.
  • the plurality of redrawing sub-canvases are superimposed on the redrawing canvas.
  • each redrawing sub-thread corresponds to a redrawing sub-canvas, in other words, there is a one-to-one correspondence between redrawing sub-canvas and redrawing sub-threads.
  • the corresponding target elements are drawn in parallel on multiple redrawing sub-canvases. The drawing speed of the element.
  • Parallel is also called parallel communication, and refers to a communication mode in which multiple channels of data are transmitted at the same time. In this embodiment, it can be specifically understood that multiple redrawing sub-threads are performed at the same time.
  • the obtained redrawing canvas includes all target elements. Threads are parallel, which can effectively save the drawing time of target elements.
  • the number of redrawing canvases is determined according to the computing power of the electronic device. Specifically, according to the unoccupied remaining computing power of the electronic device, a certain number of redrawing sub-threads are established, and the established redrawing The computing power occupied by the sub-threads is not greater than the remaining computing power.
  • the computing power occupied by the established redrawing sub-thread is not greater than 30% of the remaining computing power. Obviously, this value can be set to 10%, 10% or 10% according to needs. 20%, 25% and other different values.
  • the technical solution of this embodiment can make full use of the computing power of the electronic device, and at the same time avoid occupying the computing power required by other threads and avoid affecting other threads.
  • all elements in the canvas data can be evenly or approximately evenly distributed to three redrawing sub-threads.
  • all elements include elements located in the visible area and primitives located outside the visible area.
  • the number of target elements allocated to each redrawing sub-thread is also equal or substantially equal.
  • only target elements may be evenly or approximately evenly distributed to each redrawing sub-thread, and elements in non-visible areas are not processed because they do not need to be displayed.
  • the assigned elements are all elements, during the traversal process, it is necessary to confirm whether the corresponding element is the target element, and ensure that the target element has been drawn on the corresponding redrawing sub-canvas. If the assigned element is the target element, it is necessary to ensure that the target element has been drawn on the corresponding redrawing sub-canvas during the traversal process.
  • each redrawing sub-thread traverses the corresponding elements in parallel, the drawing of the target element on each redrawing sub-canvas is completed, and further, each redrawing sub-canvas is superimposed on the redrawing canvas to obtain all Repaints the canvas for the target element.
  • Step 103 In the interface rendering thread, overlay the repainting canvas to the interface rendering canvas, and refresh the display interface according to the interface rendering canvas.
  • the data required by the interface rendering thread is processed in the interface rendering thread. It can be understood that in related technologies, the target element is drawn on the canvas in the interface rendering thread for display The update of the screen will increase the load on the interface rendering thread and increase the processing time.
  • a redrawing thread is further set, and the drawing of the target element on the canvas is completed in the redrawing thread. Specifically, the target element is drawn on the redrawing canvas in the redrawing thread.
  • the interface rendering thread can directly call the redrawing canvas provided by the redrawing thread to draw the target element.
  • the redraw thread and the interface rendering thread are serial.
  • Serial is also called serial communication, which refers to the communication method of transmitting one bit of data each time on the data channel and continuously performing the above single process, that is to say, the redrawing thread and the interface rendering thread are carried out sequentially , when the redrawing thread ends, it will output the processed redrawing canvas to the interface rendering thread for the interface rendering thread to update the interface.
  • the interface rendering canvas can be provided through the UI interface (User Interface, human-computer interaction interface), and then the repainting canvas is superimposed and drawn on the interface rendering canvas.
  • UI interface User Interface, human-computer interaction interface
  • the repainting canvas is superimposed and drawn on the interface rendering canvas.
  • the update thread of the UI interface only one drawing action is required. Complete the update of the content on the interface rendering canvas.
  • the redrawing thread first obtain the boundary of the visible area, and determine the target element located in the visible area.
  • the preset number threshold is 100 for illustration.
  • the repainting canvas is directly drawn in the redrawing thread.
  • the number of target elements is greater than 100, multiple redrawing sub-threads are established, and the target elements are assigned to multiple redrawing sub-threads for drawing respectively.
  • the interface rendering thread calls the redrawing canvas generated by the redrawing thread.
  • the interface rendering thread notifies the UI interface to update the display interface.
  • the UI interface superimposes the redrawing on the interface rendering canvas, and finally completes the redrawing and rendering process.
  • An embodiment of the present disclosure provides a display rendering device, which is applied to electronic equipment.
  • the display rendering device 300 includes:
  • a target element acquisition module 301 configured to determine the target element 302 located in the visible area when the canvas data changes;
  • a repainting canvas generating module configured to generate a repainting canvas, and draw the target element on the repainting canvas
  • the interface refreshing module 303 is configured to overlay and draw the redrawing canvas to the interface rendering canvas in the interface rendering thread, and refresh the display interface according to the interface rendering canvas.
  • the repainting canvas generation module 302 includes:
  • Establishing a sub-module configured to establish a plurality of redrawing sub-threads, and generate a redrawing sub-canvas in the redrawing sub-threads, wherein the redrawing sub-threads correspond to the redrawing sub-canvases one by one;
  • a dividing sub-module configured to divide the target element into the redrawing sub-canvas, and draw the target element corresponding to each redrawing sub-canvas to the corresponding redrawing sub-canvas;
  • the overlay submodule is configured to overlay the multiple redrawing sub-canvases on the redrawing canvas.
  • the multiple redrawing sub-threads are parallel.
  • the number of redrawing sub-canvases is determined according to the computing capability of the electronic device.
  • the redrawing thread and the interface rendering thread are serial.
  • the repainting canvas generation module 302 includes:
  • a detection submodule is used to detect the quantity of the target element
  • the drawing submodule is specifically configured to perform the step of dividing the canvas data into multiple redrawing canvases if the number of the target elements is greater than a preset number threshold;
  • the drawing submodule is further configured to draw the target elements on the repainting canvas if the number of the target elements is not greater than the preset number threshold.
  • the visible area is an area of the canvas corresponding to the display interface of the electronic device
  • the target element is an element located in the visible area in the canvas data.
  • the target element includes an element corresponding to handwriting corresponding to a writing operation on the electronic device.
  • the electronic device is an intelligent interactive tablet.
  • the embodiment of the present invention also provides an electronic device.
  • the electronic device may include a processor 401 , a memory 402 and a program 4021 stored in the memory 402 and executable on the processor 401 .
  • the program 4021 is executed by the processor 401, any steps in the method embodiment corresponding to FIG. 1 can be implemented and the same beneficial effect can be achieved, so details will not be repeated here.
  • An embodiment of the present invention also provides a readable storage medium, where a computer program is stored on the readable storage medium, and when the computer program is executed by a processor, any step in the above-mentioned method embodiment corresponding to FIG. 1 can be implemented, and The same technical effect can be achieved, so in order to avoid repetition, details will not be repeated here.
  • the storage medium is, for example, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and the like.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • magnetic disk or an optical disk and the like.
  • the division of the above modules is only a division of logical functions, which may be fully or partially integrated into a physical entity or physically separated during actual implementation.
  • these modules can all be implemented in the form of calling software through processing elements; they can also be implemented in the form of hardware; some modules can also be implemented in the form of calling software through processing elements, and some modules can be implemented in the form of hardware.
  • the determining module may be a separate processing element, or may be integrated into a chip of the above-mentioned device.
  • it may also be stored in the memory of the above-mentioned device in the form of program code, and a certain processing element of the above-mentioned device may Call and execute the functions of the modules identified above.
  • each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or an instruction in the form of software.
  • each module, unit, subunit or submodule may be one or more integrated circuits configured to implement the above method, for example: one or more specific integrated circuits (Application Specific Integrated Circuit, ASIC), or, one or Multiple microprocessors (digital signal processor, DSP), or, one or more field programmable gate arrays (Field Programmable Gate Array, FPGA), etc.
  • ASIC Application Specific Integrated Circuit
  • DSP digital signal processor
  • FPGA Field Programmable Gate Array
  • the processing element may be a general-purpose processor, such as a central processing unit (Central Processing Unit, CPU) or other processors that can call program codes.
  • these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).
  • SOC system-on-a-chip

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Image Generation (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The present disclosure provides a display rendering method and apparatus, an electronic device and a readable storage medium. The display rendering method is applied to the electronic device, and comprises the following steps: when canvas data is changed, determining a target element located in a visual area; in a redraw thread, generating redraw canvas, and drawing the target element on the redraw canvas; and in an interface render thread, superposing and drawing the redraw canvas to interface rendering canvas, and refreshing a display interface according to the interface rendering canvas.

Description

一种显示渲染方法、装置、电子设备和可读存储介质A display rendering method, device, electronic device and readable storage medium
相关申请的交叉引用Cross References to Related Applications
本申请主张在2022年2月25日在中国提交的中国专利申请No.202210179865.3的优先权,其全部内容通过引用包含于此。This application claims priority to Chinese Patent Application No. 202210179865.3 filed in China on February 25, 2022, the entire contents of which are hereby incorporated by reference.
技术领域technical field
本公开涉及计算机领域,尤其涉及一种显示渲染方法、装置、电子设备和可读存储介质。The present disclosure relates to the computer field, and in particular to a display rendering method, device, electronic equipment and readable storage medium.
背景技术Background technique
在对电子设备的显示界面进行更新时,通常是基于画布(Canvas)对显示界面进行重绘刷新,然而电子设备显示的内容可能包括较复杂的对象,例如复杂的图片或笔迹等,而对于这些复杂的对象的重绘需要耗费较长的时间,这导致大尺寸或高分辨率电子设备的显示界面进行更新时,需要耗费较长的时间,可能导致显示界面出现闪烁或卡顿等,影响显示效果。When updating the display interface of an electronic device, the display interface is usually redrawn and refreshed based on the canvas (Canvas), but the content displayed by the electronic device may include more complex objects, such as complex pictures or handwriting, etc. The redrawing of complex objects takes a long time, which takes a long time to update the display interface of large-size or high-resolution electronic devices, which may cause flickering or freeze on the display interface, affecting the display Effect.
发明内容Contents of the invention
在其中一些方面,本公开实施例提供了一种显示渲染方法,应用于电子设备,所述方法包括以下步骤:In some aspects, an embodiment of the present disclosure provides a display rendering method applied to an electronic device, and the method includes the following steps:
在画布数据发生变化的情况下,确定位于可视区域内的目标元素;When the canvas data changes, determine the target element located in the visible area;
在重绘线程中,生成重绘画布,并在所述重绘画布上绘制所述目标元素;In the redrawing thread, generate a redrawing canvas, and draw the target element on the redrawing canvas;
在界面渲染线程中,将所述重绘画布叠加绘制到界面渲染画布,并根据所述界面渲染画布刷新显示界面。In the interface rendering thread, the repainting canvas is overlaid and drawn to the interface rendering canvas, and the display interface is refreshed according to the interface rendering canvas.
在一些实施例中,所述生成重绘画布,并在所述重绘画布上绘制所述目标元素,包括:In some embodiments, the generating a repainting canvas, and drawing the target element on the redrawing canvas includes:
建立多个重绘子线程,并在所述重绘子线程中生成重绘子画布,其中,所述重绘子线程和所述重绘子画布一一对应;Establishing a plurality of redrawing sub-threads, and generating a redrawing sub-canvas in the redrawing sub-threads, wherein the redrawing sub-threads correspond to the redrawing sub-canvases one by one;
将所述目标元素划分至所述重绘子画布,并将各所述重绘子画布对应的 目标元素绘制到相对应的重绘子画布;Divide the target element into the redrawing sub-canvas, and draw the target element corresponding to each redrawing sub-canvas to the corresponding redrawing sub-canvas;
将所述多个重绘子画布叠加至所述重绘画布。The plurality of redrawing sub-canvases are superimposed on the redrawing canvas.
在一些实施例中,所述多个重绘子线程是并行的。In some embodiments, the multiple redrawing sub-threads are parallel.
在一些实施例中,所述重绘子画布的数量是根据所述电子设备的运算能力确定的。In some embodiments, the number of redrawing sub-canvases is determined according to the computing capability of the electronic device.
在一些实施例中,所述重绘线程和所述界面渲染线程是串行的。In some embodiments, the redrawing thread and the interface rendering thread are serial.
在一些实施例中,所述生成重绘画布,并在所述重绘画布上绘制所述目标元素,还包括:In some embodiments, the generating a repainting canvas, and drawing the target element on the repainting canvas, further includes:
检测所述目标元素的数量;detecting the quantity of said target element;
若所述目标元素的数量大于预设数量阈值,则执行建立多个重绘子线程的步骤;If the number of the target elements is greater than the preset number threshold, then execute the step of establishing multiple redrawing sub-threads;
若所述目标元素的数量不大于所述预设数量阈值,则在所述重绘画布上绘制所述目标元素。If the number of the target elements is not greater than the preset number threshold, draw the target elements on the repainting canvas.
在一些实施例中,所述可视区域为画布与所述电子设备的显示界面对应的区域,所述目标元素为所述画布数据中位于所述可视区域的元素。In some embodiments, the visible area is an area of the canvas corresponding to the display interface of the electronic device, and the target element is an element located in the visible area in the canvas data.
在一些实施例中,所述目标元素包括在所述电子设备上的书写操作对应的笔迹对应的元素。In some embodiments, the target element includes an element corresponding to handwriting corresponding to a writing operation on the electronic device.
在一些实施例中,所述电子设备为智能交互平板。In some embodiments, the electronic device is an intelligent interactive tablet.
在其中一些方面,本公开实施例提供了一种显示渲染装置,应用于电子设备,包括:In some aspects, an embodiment of the present disclosure provides a display rendering device, which is applied to an electronic device, including:
目标元素获取模块,用于在画布数据发生变化的情况下,确定位于可视区域内的目标元素;The target element acquisition module is used to determine the target element located in the visible area when the canvas data changes;
重绘画布生成模块,用于生成重绘画布,并在所述重绘画布上绘制所述目标元素;A repainting canvas generating module, configured to generate a repainting canvas, and draw the target element on the repainting canvas;
界面刷新模块,用于在界面渲染线程中,将所述重绘画布叠加绘制到界面渲染画布,并根据所述界面渲染画布刷新显示界面。The interface refreshing module is configured to, in the interface rendering thread, overlay and draw the repainting canvas to the interface rendering canvas, and refresh the display interface according to the interface rendering canvas.
在其中一些方面,本公开实施例提供了一种电子设备,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的程序;In some aspects, an embodiment of the present disclosure provides an electronic device, including: a memory, a processor, and a program stored in the memory and operable on the processor;
所述处理器,用于读取存储器中的程序实现如第一方面中任一项所述的 显示渲染方法中的步骤。The processor is configured to read the program in the memory to implement the steps in the display rendering method according to any one of the first aspect.
在其中一些方面,本公开实施例提供了一种可读存储介质,用于存储程序,所述程序被处理器执行时实现如第一方面中任一项所述的显示渲染方法中的步骤。In some aspects, the embodiments of the present disclosure provide a readable storage medium for storing a program, and when the program is executed by a processor, the steps in the display rendering method according to any one of the first aspect are implemented.
附图说明Description of drawings
为了更清楚地说明本公开实施例的技术方案,下面将对本公开实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获取其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments of the present disclosure. Obviously, the accompanying drawings in the following description are only some embodiments of the present disclosure. For those skilled in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1是本公开一实施例显示渲染方法的流程图;FIG. 1 is a flowchart of a display rendering method according to an embodiment of the present disclosure;
图2是本公开一实施例显示渲染方法的又一流程图;FIG. 2 is another flowchart of a display rendering method according to an embodiment of the present disclosure;
图3是本公开一实施例显示渲染装置的结构图;FIG. 3 is a structural diagram showing a rendering device according to an embodiment of the present disclosure;
图4是本公开一实施例中电子设备的结构图。FIG. 4 is a structural diagram of an electronic device in an embodiment of the present disclosure.
具体实施方式Detailed ways
下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开一部分实施例,而不是全部的实施例。不冲突的情况下,下述实施例及实施例中的特征可以相互组合。基于本公开中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获取的所有其他实施例,都属于本公开保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present disclosure with reference to the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are part of the embodiments of the present disclosure, not all of them. In the case of no conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in the present disclosure, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present disclosure.
本公开实施例提供了一种显示渲染方法。An embodiment of the present disclosure provides a display rendering method.
该显示渲染方法应用于电子设备,在其中一些实施例中,电子设备具体为智能交互平板,智能交互平板通常具有尺寸较大的显示面板以及较高的分辨率,例如2K或4K甚至更高的分辨率。该智能交互平板可以基于安卓系统等操作系统运行。The display rendering method is applied to an electronic device. In some embodiments, the electronic device is specifically an intelligent interactive panel, and the intelligent interactive panel usually has a larger display panel and a higher resolution, such as 2K or 4K or even higher resolution. The smart interactive tablet can run based on operating systems such as the Android system.
需要理解的是,一些操作系统在对显示界面进行更新时,需要首先将原有的内容清除,然后在画布上绘制新的内容,所需绘制的内容可以理解为由点、直线、弧线等各种不同的元素构成的,如果需要绘制的内容较为复杂, 则会导致绘制内容的时间增加,这可能导致画面更新过程中出现卡顿、闪烁等现象,影响显示效果。What needs to be understood is that when some operating systems update the display interface, they need to clear the original content first, and then draw new content on the canvas. The content to be drawn can be understood as points, lines, arcs, etc. Composed of various elements, if the content to be drawn is complex, it will increase the time to draw the content, which may cause stuttering, flickering and other phenomena during the screen update process, affecting the display effect.
需要理解的是,本实施例的技术方案还可以应用于其他操作系统的电子设备,只要该操作系统中的画面更新是基于上述原理进行的即可。It should be understood that the technical solution of this embodiment can also be applied to electronic devices with other operating systems, as long as the screen update in the operating system is performed based on the above principles.
其中一些实施例,显示渲染方法包括以下步骤:In some embodiments, the display rendering method includes the following steps:
步骤101:在画布数据发生变化的情况下,确定位于可视区域内的目标元素。Step 101: When the canvas data changes, determine the target element located in the visible area.
本实施例的技术方案中,在画布数据发生变化时,以对显示界面进行更新。In the technical solution of this embodiment, when the canvas data changes, the display interface is updated.
在对显示画面进行更新时,首先确定可视区域。本实施例中,可视区域可以理解为当前显示画面上对应的区域,也就是画布与电子设备的显示界面对应的区域。When updating the display screen, first determine the visible area. In this embodiment, the visible area can be understood as the corresponding area on the current display screen, that is, the area corresponding to the canvas and the display interface of the electronic device.
示例性的,在电子设备的手写界面,在一个视图下,手写界面的尺寸与电子设备的显示界面相等,且在显示界面显示了全部手写界面。此时,全部手写界面均为可视区域。当对手写界面进行放大时,显示界面仅显示了手写界面的一部分区域,此时,电子设备上显示的区域为可视区域,该区域对应的画布数据为位于该可视区域的目标元素。Exemplarily, in the handwriting interface of the electronic device, in one view, the size of the handwriting interface is equal to the display interface of the electronic device, and all the handwriting interfaces are displayed on the display interface. At this point, all handwriting interfaces are visible areas. When the handwriting interface is enlarged, the display interface only displays a part of the area of the handwriting interface. At this time, the area displayed on the electronic device is a visible area, and the canvas data corresponding to this area is a target element located in the visible area.
需要理解的是,如果显示画面显示全部画布对应的区域时,则可视区域对应整个画布,在某些情况下,显示画面对应画布的一部分区域,例如,用户放大观察某一局部区域时,电子设备所显示的画面仅为画布的一部分。It should be understood that if the display screen displays the area corresponding to all canvases, the visible area corresponds to the entire canvas. In some cases, the display screen corresponds to a part of the canvas area. The screen displayed by the device is only a part of the canvas.
实施时,根据当前的显示界面,能够确定可视区域的边界,进一步的,将可视区域的边界内的元素确定为目标元素。During implementation, the boundary of the visible area can be determined according to the current display interface, and further, elements within the boundary of the visible area can be determined as target elements.
步骤102:在重绘线程中,生成重绘画布,并在所述重绘画布上绘制所述目标元素。Step 102: In the redrawing thread, generate a redrawing canvas, and draw the target element on the redrawing canvas.
本实施例中,建立一个重绘线程,在该重绘线程中,提供一重绘画布,将需要绘制的目标元素绘制到该重绘画布上。In this embodiment, a redrawing thread is established. In the redrawing thread, a redrawing canvas is provided, and target elements to be drawn are drawn on the redrawing canvas.
在其中一些实施例中,步骤102包括:In some of these embodiments, step 102 includes:
检测所述目标元素的数量;detecting the quantity of said target element;
若所述目标元素的数量大于预设数量阈值,则执行建立多个重绘子线程 的步骤;If the quantity of the target element is greater than the preset quantity threshold, then perform the step of establishing multiple redrawing sub-threads;
若所述目标元素的数量不大于所述预设数量阈值,则在所述重绘画布上绘制所述目标元素。If the number of the target elements is not greater than the preset number threshold, draw the target elements on the repainting canvas.
本实施例的技术方案中,该预设数量阈值是根据电子设备的软硬件性能确定的,需要理解的是,具有不同软硬件的电子设备能够提供不同的运算能力,如果所提供的运算能力相对较高,则在一个重绘线程的单位时间内能够绘制的元素的数量也就越多,相应的,如果所提供的运算能力相对较低,则在一个重绘线程的单位时间内能够绘制的元素的数量也就越少。In the technical solution of this embodiment, the preset number threshold is determined according to the hardware and software performance of the electronic device. It should be understood that electronic devices with different hardware and software can provide different computing capabilities. If the computing capabilities provided are relatively The higher the number of elements that can be drawn in the unit time of a redrawing thread, the more elements can be drawn in the unit time of a redrawing thread. Correspondingly, if the provided computing power is relatively low, the The number of elements is also reduced.
如果目标元素的总数量相对较少,例如小于或接近一个重绘线程的单位时间内能够绘制的元素的数量,则在重绘线程中,可以直接在重绘画布上绘制目标元素。If the total number of target elements is relatively small, for example, less than or close to the number of elements that can be drawn per unit time of one redrawing thread, then in the redrawing thread, the target elements can be directly drawn on the redrawing canvas.
本实施例中,可以根据电子设备所提供的运算能力确定预设数量阈值,示例性的,可以将预设数量阈值设定为一个等于或略低于一个重绘线程的单位时间内能够绘制的元素的数量的值。In this embodiment, the preset number threshold can be determined according to the computing power provided by the electronic device. For example, the preset number threshold can be set to be equal to or slightly lower than the number of redrawing threads that can be drawn per unit time. The value of the number of elements.
如果目标元素的数量不大于该预设数量阈值,则可以直接在重绘画布上绘制目标元素。If the number of target elements is not greater than the preset number threshold, the target elements can be directly drawn on the repainting canvas.
如果目标元素的数量相对较多,例如大于该预设数量阈值,则建立多个重绘线程以提高对于目标元素的绘制速度。If the number of target elements is relatively large, for example greater than the preset number threshold, multiple redrawing threads are established to increase the drawing speed of the target elements.
具体的,如果目标元素的数量大于该预设数量阈值,则执行以下步骤:Specifically, if the number of target elements is greater than the preset number threshold, the following steps are performed:
建立多个重绘子线程,并在所述重绘子线程中生成重绘子画布,其中,所述重绘子线程和所述重绘子画布一一对应Create a plurality of redrawing sub-threads, and generate a redrawing sub-canvas in the redrawing sub-threads, wherein the redrawing sub-threads correspond to the redrawing sub-canvases one by one
将所述目标元素划分至所述重绘子画布,并将各所述重绘子画布对应的目标元素绘制到相对应的重绘子画布;dividing the target element into the redrawing sub-canvas, and drawing the target element corresponding to each redrawing sub-canvas to the corresponding redrawing sub-canvas;
将所述多个重绘子画布叠加至所述重绘画布。The plurality of redrawing sub-canvases are superimposed on the redrawing canvas.
本实施例中,在重绘线程中建立了多个重绘子线程,每一重绘子线程对应一个重绘子画布,换句话说,重绘子画布和重绘子线程是一一对应的。通过建立多个重绘子线程,在多个重绘子画布上并行绘制相应的目标元素,也就是说,多个重绘画布上的目标元素的绘制线程是并行进行的,从而能够提高对于目标元素的绘制速度。In this embodiment, multiple redrawing sub-threads are established in the redrawing thread, each redrawing sub-thread corresponds to a redrawing sub-canvas, in other words, there is a one-to-one correspondence between redrawing sub-canvas and redrawing sub-threads. By establishing multiple redrawing sub-threads, the corresponding target elements are drawn in parallel on multiple redrawing sub-canvases. The drawing speed of the element.
并行也称并行通信,指的是多路数据同时进行传输的通信方式,本实施例中具体可以理解为多个重绘子线程是同时进行的。Parallel is also called parallel communication, and refers to a communication mode in which multiple channels of data are transmitted at the same time. In this embodiment, it can be specifically understood that multiple redrawing sub-threads are performed at the same time.
在各个重绘子画布上绘制完相应的目标元素之后,将全部的重绘子画布叠加获得重绘画布,这样,所获得的重绘画布就包括了全部目标元素,同时,由于各重绘子线程是并行的,能够有效的节约目标元素的绘制时间。After the corresponding target elements are drawn on each redrawing sub-canvas, all the redrawing sub-canvas are superimposed to obtain the redrawing canvas. In this way, the obtained redrawing canvas includes all target elements. Threads are parallel, which can effectively save the drawing time of target elements.
在一些实施例中,重绘画布的数量是根据电子设备的运算能力确定的,具体而言,根据电子设备未被占用的剩余运算能力,建立一定数量的重绘子线程,所建立的重绘子线程占用的运算能力不大于剩余运算能力。In some embodiments, the number of redrawing canvases is determined according to the computing power of the electronic device. Specifically, according to the unoccupied remaining computing power of the electronic device, a certain number of redrawing sub-threads are established, and the established redrawing The computing power occupied by the sub-threads is not greater than the remaining computing power.
在一些实施例中,为了避免对可能需要建立的线程造成影响,所建立的重绘子线程占用的运算能力不大于剩余运算能力的30%,显然,该数值可以根据需要设定为10%、20%、25%等不同的数值。In some embodiments, in order to avoid affecting the threads that may need to be established, the computing power occupied by the established redrawing sub-thread is not greater than 30% of the remaining computing power. Obviously, this value can be set to 10%, 10% or 10% according to needs. 20%, 25% and other different values.
这样,本实施例的技术方案能够充分利用电子设备的运算能力,同时也能够避免占用其他线程所需的运算能力,避免对其他线程造成影响。In this way, the technical solution of this embodiment can make full use of the computing power of the electronic device, and at the same time avoid occupying the computing power required by other threads and avoid affecting other threads.
以设置了三个重绘子线程及其一一对应的三个重绘子画布做示例性说明。Take three redrawing sub-threads and their one-to-one corresponding three redrawing sub-canvases as an example.
实施时,可以将画布数据中的全部元素平均或近似平均的分配至三个重绘子线程,这里,全部元素包括位于可视区域中的元素和位于可视区域之外的原始,在一些实施例中,为了平衡各重绘子线程的处理时间,分配至每一重绘子线程的目标元素的数量也是相等或基本相等的。During implementation, all elements in the canvas data can be evenly or approximately evenly distributed to three redrawing sub-threads. Here, all elements include elements located in the visible area and primitives located outside the visible area. In some implementations In an example, in order to balance the processing time of each redrawing sub-thread, the number of target elements allocated to each redrawing sub-thread is also equal or substantially equal.
在另外一些实施例中,也可以仅将目标元素平均或近似平均的分配至每一重绘子线程,针对非可视区域的元素,由于不需要显示,所以对其不做处理。In some other embodiments, only target elements may be evenly or approximately evenly distributed to each redrawing sub-thread, and elements in non-visible areas are not processed because they do not need to be displayed.
针对其中的每一个重绘子线程对应的元素,依次进行遍历。The elements corresponding to each of the redrawing sub-threads are traversed sequentially.
如果分配的元素为全部元素,则在遍历过程中,需要确认相应的元素是否为目标元素,并确保目标元素已经被绘制在相应的重绘子画布上。如果分配的元素为目标元素,则在遍历过程中,需要确保目标元素已经被绘制在相应的重绘子画布上。If the assigned elements are all elements, during the traversal process, it is necessary to confirm whether the corresponding element is the target element, and ensure that the target element has been drawn on the corresponding redrawing sub-canvas. If the assigned element is the target element, it is necessary to ensure that the target element has been drawn on the corresponding redrawing sub-canvas during the traversal process.
遍历一个重绘子线程对应的元素之后,能够确保该重绘子线程对应的全部目标元素已经被绘制在了该重绘子线程对应的重绘子画布。After traversing the elements corresponding to a redrawing sub-thread, it can be ensured that all target elements corresponding to the redrawing sub-thread have been drawn on the redrawing sub-canvas corresponding to the redrawing sub-thread.
依照上述步骤,各重绘子线程并行遍历相对应的元素之后,完成各重绘子画布上目标元素的绘制,进一步的,将各重绘子画布叠加至重绘画布,即可获得包括了全部目标元素的重绘画布。According to the above steps, after each redrawing sub-thread traverses the corresponding elements in parallel, the drawing of the target element on each redrawing sub-canvas is completed, and further, each redrawing sub-canvas is superimposed on the redrawing canvas to obtain all Repaints the canvas for the target element.
步骤103:在界面渲染线程中,将所述重绘画布叠加绘制到界面渲染画布,并根据所述界面渲染画布刷新显示界面。Step 103: In the interface rendering thread, overlay the repainting canvas to the interface rendering canvas, and refresh the display interface according to the interface rendering canvas.
需要理解的是,相关技术中,界面渲染线程所需的数据均是在界面渲染线程中处理的,可以理解为,相关技术中是在界面渲染线程中将目标元素绘制到画布上,以进行显示画面的更新的,这将导致界面渲染线程的负荷增加,处理时间增加。It should be understood that in related technologies, the data required by the interface rendering thread is processed in the interface rendering thread. It can be understood that in related technologies, the target element is drawn on the canvas in the interface rendering thread for display The update of the screen will increase the load on the interface rendering thread and increase the processing time.
本实施例的技术方案中,进一步设置了重绘线程,在重绘线程中完成目标元素在画布上的绘制,具体的,在重绘线程中将目标元素绘制到重绘画布上,接下来,界面渲染线程可以直接调用重绘线程提供的绘制有目标元素的重绘画布。In the technical solution of this embodiment, a redrawing thread is further set, and the drawing of the target element on the canvas is completed in the redrawing thread. Specifically, the target element is drawn on the redrawing canvas in the redrawing thread. Next, The interface rendering thread can directly call the redrawing canvas provided by the redrawing thread to draw the target element.
在一些实施例中,重绘线程和界面渲染线程是串行的。In some embodiments, the redraw thread and the interface rendering thread are serial.
串行也称串行通信,指的是在数据通道上,每次传输一个位元数据,并连续进行以上单次过程的通信方式,也就是说,重绘线程和界面渲染线程是依次进行的,当重绘线程结束之后,会将其处理得到的重绘画布输出至界面渲染线程,供界面渲染线程进行界面更新操作。Serial is also called serial communication, which refers to the communication method of transmitting one bit of data each time on the data channel and continuously performing the above single process, that is to say, the redrawing thread and the interface rendering thread are carried out sequentially , when the redrawing thread ends, it will output the processed redrawing canvas to the interface rendering thread for the interface rendering thread to update the interface.
具体的,可以通过UI界面(User Interface,人机交互界面)提供界面渲染画布,然后将重绘画布叠加绘制到界面渲染画布上,在UI界面的更新线程中,只需要进行一次绘制动作即可完成界面渲染画布上内容的更新。Specifically, the interface rendering canvas can be provided through the UI interface (User Interface, human-computer interaction interface), and then the repainting canvas is superimposed and drawn on the interface rendering canvas. In the update thread of the UI interface, only one drawing action is required. Complete the update of the content on the interface rendering canvas.
如图2所示,本实施例的技术方案可以概括为以下步骤。As shown in FIG. 2 , the technical solution of this embodiment can be summarized as the following steps.
如果画布数据发生了变化,需要进行重绘渲染,则进入重绘线程。If the canvas data has changed and needs to be redrawn, it will enter the redraw thread.
在重绘线程中,首先获取可视区域的边界,并确定位于可视区域中的目标元素。In the redrawing thread, first obtain the boundary of the visible area, and determine the target element located in the visible area.
检测目标元素的数量是否大于预设数量阈值,本实施例中,以预设数量阈值为100做示例性说明。Detect whether the number of target elements is greater than a preset number threshold. In this embodiment, the preset number threshold is 100 for illustration.
如果目标元素的数量不大于100,则在重绘线程中直接对重绘画布进行绘制。If the number of target elements is not greater than 100, the repainting canvas is directly drawn in the redrawing thread.
如果目标元素的数量大于100,则建立多个重绘子线程,将目标元素分配至多个重绘子线程,分别进行绘制。If the number of target elements is greater than 100, multiple redrawing sub-threads are established, and the target elements are assigned to multiple redrawing sub-threads for drawing respectively.
在上述的每一个重绘子线程的目标元素的绘制过程中,对每一重绘子线程对应的元素进行遍历,如果被遍历到的元素为目标元素,则进一步将该目标元素绘制到重绘子画布上。最后,将多个重绘线程对应的重绘子画布叠加获得重绘画布。In the above-mentioned drawing process of the target element of each redrawing sub-thread, the elements corresponding to each redrawing sub-thread are traversed, and if the traversed element is the target element, the target element is further drawn to the redrawing sub-thread on canvas. Finally, the redrawing canvas is obtained by superimposing the redrawing sub-canvas corresponding to multiple redrawing threads.
界面渲染线程调用重绘线程生成的重绘画布。界面渲染线程通知UI界面进行显示界面的更新,在进入界面渲染线程之后,UI界面将重绘画叠加绘制到界面渲染画布上,最终,完成了重绘渲染的过程。The interface rendering thread calls the redrawing canvas generated by the redrawing thread. The interface rendering thread notifies the UI interface to update the display interface. After entering the interface rendering thread, the UI interface superimposes the redrawing on the interface rendering canvas, and finally completes the redrawing and rendering process.
本公开实施例提供了一种显示渲染装置,应用于电子设备。An embodiment of the present disclosure provides a display rendering device, which is applied to electronic equipment.
如图3所示,在一个实施例中,显示渲染装置300包括:As shown in FIG. 3, in one embodiment, the display rendering device 300 includes:
目标元素获取模块301,用于在画布数据发生变化的情况下,确定位于可视区域内的目标元素302;A target element acquisition module 301, configured to determine the target element 302 located in the visible area when the canvas data changes;
重绘画布生成模块,用于生成重绘画布,并在所述重绘画布上绘制所述目标元素;A repainting canvas generating module, configured to generate a repainting canvas, and draw the target element on the repainting canvas;
界面刷新模块303,用于在界面渲染线程中,将所述重绘画布叠加绘制到界面渲染画布,并根据所述界面渲染画布刷新显示界面。The interface refreshing module 303 is configured to overlay and draw the redrawing canvas to the interface rendering canvas in the interface rendering thread, and refresh the display interface according to the interface rendering canvas.
在一些实施例中,所述重绘画布生成模块302包括:In some embodiments, the repainting canvas generation module 302 includes:
建立子模块,用于建立多个重绘子线程,并在所述重绘子线程中生成重绘子画布,其中,所述重绘子线程和所述重绘子画布一一对应;Establishing a sub-module, configured to establish a plurality of redrawing sub-threads, and generate a redrawing sub-canvas in the redrawing sub-threads, wherein the redrawing sub-threads correspond to the redrawing sub-canvases one by one;
划分子模块,用于将所述目标元素划分至所述重绘子画布,并将各所述重绘子画布对应的目标元素绘制到相对应的重绘子画布;A dividing sub-module, configured to divide the target element into the redrawing sub-canvas, and draw the target element corresponding to each redrawing sub-canvas to the corresponding redrawing sub-canvas;
叠加子模块,用于将所述多个重绘子画布叠加至所述重绘画布。The overlay submodule is configured to overlay the multiple redrawing sub-canvases on the redrawing canvas.
在一些实施例中,所述多个重绘子线程是并行的。In some embodiments, the multiple redrawing sub-threads are parallel.
在一些实施例中,所述重绘子画布的数量是根据所述电子设备的运算能力确定的。In some embodiments, the number of redrawing sub-canvases is determined according to the computing capability of the electronic device.
在一些实施例中,所述重绘线程和所述界面渲染线程是串行的。In some embodiments, the redrawing thread and the interface rendering thread are serial.
在一些实施例中,所述重绘画布生成模块302包括:In some embodiments, the repainting canvas generation module 302 includes:
检测子模块,用于检测所述目标元素的数量;A detection submodule is used to detect the quantity of the target element;
所述绘制子模块,具体用于若所述目标元素的数量大于预设数量阈值,则执行将所述画布数据划分至多个重绘画布的步骤;The drawing submodule is specifically configured to perform the step of dividing the canvas data into multiple redrawing canvases if the number of the target elements is greater than a preset number threshold;
所述绘制子模块,还用于若所述目标元素的数量不大于所述预设数量阈值,则在所述重绘画布上绘制所述目标元素。The drawing submodule is further configured to draw the target elements on the repainting canvas if the number of the target elements is not greater than the preset number threshold.
在一些实施例中,所述可视区域为画布与所述电子设备的显示界面对应的区域,所述目标元素为所述画布数据中位于所述可视区域的元素。In some embodiments, the visible area is an area of the canvas corresponding to the display interface of the electronic device, and the target element is an element located in the visible area in the canvas data.
在一些实施例中,所述目标元素包括在所述电子设备上的书写操作对应的笔迹对应的元素。In some embodiments, the target element includes an element corresponding to handwriting corresponding to a writing operation on the electronic device.
在一些实施例中,所述电子设备为智能交互平板。In some embodiments, the electronic device is an intelligent interactive tablet.
本发明实施例还提供一种电子设备。请参见图4,电子设备可以包括处理器401、存储器402及存储在存储器402上并可在处理器401上运行的程序4021。程序4021被处理器401执行时可实现图1对应的方法实施例中的任意步骤及达到相同的有益效果,此处不再赘述。The embodiment of the present invention also provides an electronic device. Referring to FIG. 4 , the electronic device may include a processor 401 , a memory 402 and a program 4021 stored in the memory 402 and executable on the processor 401 . When the program 4021 is executed by the processor 401, any steps in the method embodiment corresponding to FIG. 1 can be implemented and the same beneficial effect can be achieved, so details will not be repeated here.
本领域普通技术人员可以理解实现上述实施例方法的全部或者部分步骤是可以通过程序指令相关的硬件来完成,所述的程序可以存储于一可读取介质中。Those of ordinary skill in the art can understand that all or part of the steps for implementing the methods of the above embodiments can be completed by program instructions related hardware, and the program can be stored in a readable medium.
本发明实施例还提供一种可读存储介质,所述可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时可实现上述图1对应的方法实施例中的任意步骤,且能达到相同的技术效果,为避免重复,这里不再赘述。An embodiment of the present invention also provides a readable storage medium, where a computer program is stored on the readable storage medium, and when the computer program is executed by a processor, any step in the above-mentioned method embodiment corresponding to FIG. 1 can be implemented, and The same technical effect can be achieved, so in order to avoid repetition, details will not be repeated here.
所述的存储介质,如只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。The storage medium is, for example, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and the like.
需要说明的是,应理解以上各个模块的划分仅仅是一种逻辑功能的划分,实际实现时可以全部或部分集成到一个物理实体上,也可以物理上分开。且这些模块可以全部以软件通过处理元件调用的形式实现;也可以全部以硬件的形式实现;还可以部分模块通过处理元件调用软件的形式实现,部分模块通过硬件的形式实现。例如,确定模块可以为单独设立的处理元件,也可以集成在上述装置的某一个芯片中实现,此外,也可以以程序代码的形式存储于上述装置的存储器中,由上述装置的某一个处理元件调用并执行以上确定模块的功能。其它模块的实现与之类似。此外这些模块全部或部分可以集成 在一起,也可以独立实现。这里所述的处理元件可以是一种集成电路,具有信号的处理能力。在实现过程中,上述方法的各步骤或以上各个模块可以通过处理器元件中的硬件的集成逻辑电路或者软件形式的指令完成。It should be noted that it should be understood that the division of the above modules is only a division of logical functions, which may be fully or partially integrated into a physical entity or physically separated during actual implementation. And these modules can all be implemented in the form of calling software through processing elements; they can also be implemented in the form of hardware; some modules can also be implemented in the form of calling software through processing elements, and some modules can be implemented in the form of hardware. For example, the determining module may be a separate processing element, or may be integrated into a chip of the above-mentioned device. In addition, it may also be stored in the memory of the above-mentioned device in the form of program code, and a certain processing element of the above-mentioned device may Call and execute the functions of the modules identified above. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, and can also be implemented independently. The processing element mentioned here may be an integrated circuit with signal processing capability. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or an instruction in the form of software.
例如,各个模块、单元、子单元或子模块可以是被配置成实施以上方法的一个或多个集成电路,例如:一个或多个特定集成电路(Application Specific Integrated Circuit,ASIC),或,一个或多个微处理器(digital signal processor,DSP),或,一个或者多个现场可编程门阵列(Field Programmable Gate Array,FPGA)等。再如,当以上某个模块通过处理元件调度程序代码的形式实现时,该处理元件可以是通用处理器,例如中央处理器(Central Processing Unit,CPU)或其它可以调用程序代码的处理器。再如,这些模块可以集成在一起,以片上系统(system-on-a-chip,SOC)的形式实现。For example, each module, unit, subunit or submodule may be one or more integrated circuits configured to implement the above method, for example: one or more specific integrated circuits (Application Specific Integrated Circuit, ASIC), or, one or Multiple microprocessors (digital signal processor, DSP), or, one or more field programmable gate arrays (Field Programmable Gate Array, FPGA), etc. For another example, when one of the above modules is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (Central Processing Unit, CPU) or other processors that can call program codes. For another example, these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).
以上所述是本发明实施例的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明所述原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above descriptions are preferred implementations of the embodiments of the present invention. It should be pointed out that for those of ordinary skill in the art, some improvements and modifications can be made without departing from the principles of the present invention. These improvements and Retouching should also be regarded as the protection scope of the present invention.

Claims (12)

  1. 一种显示渲染方法,应用于电子设备,所述方法包括以下步骤:A display rendering method applied to electronic equipment, said method comprising the following steps:
    在画布数据发生变化的情况下,确定位于可视区域内的目标元素;When the canvas data changes, determine the target element located in the visible area;
    在重绘线程中,生成重绘画布,并在所述重绘画布上绘制所述目标元素;In the redrawing thread, generate a redrawing canvas, and draw the target element on the redrawing canvas;
    在界面渲染线程中,将所述重绘画布叠加绘制到界面渲染画布,并根据所述界面渲染画布刷新显示界面。In the interface rendering thread, the repainting canvas is overlaid and drawn to the interface rendering canvas, and the display interface is refreshed according to the interface rendering canvas.
  2. 如权利要求1所述的方法,其中,所述生成重绘画布,并在所述重绘画布上绘制所述目标元素,包括:The method according to claim 1, wherein said generating a redrawing canvas and drawing said target element on said redrawing canvas comprises:
    建立多个重绘子线程,并在所述重绘子线程中生成重绘子画布,其中,所述重绘子线程和所述重绘子画布一一对应;Establishing a plurality of redrawing sub-threads, and generating a redrawing sub-canvas in the redrawing sub-threads, wherein the redrawing sub-threads correspond to the redrawing sub-canvases one by one;
    将所述目标元素划分至所述重绘子画布,并将各所述重绘子画布对应的目标元素绘制到相对应的重绘子画布;dividing the target element into the redrawing sub-canvas, and drawing the target element corresponding to each redrawing sub-canvas to the corresponding redrawing sub-canvas;
    将所述多个重绘子画布叠加至所述重绘画布。The plurality of redrawing sub-canvases are superimposed on the redrawing canvas.
  3. 如权利要求2所述的方法,其中,所述多个重绘子线程是并行的。The method of claim 2, wherein the plurality of redrawing sub-threads are parallel.
  4. 如权利要求2所述的方法,其中,所述重绘子画布的数量是根据所述电子设备的运算能力确定的。The method according to claim 2, wherein the number of redrawing the sub-canvas is determined according to the computing capability of the electronic device.
  5. 如权利要求1或2所述的方法,其中,所述重绘线程和所述界面渲染线程是串行的。The method according to claim 1 or 2, wherein the redrawing thread and the interface rendering thread are serial.
  6. 如权利要求2至4中任一项所述的方法,其中,所述生成重绘画布,并在所述重绘画布上绘制所述目标元素,还包括:The method according to any one of claims 2 to 4, wherein said generating a repainting canvas, and drawing said target element on said repainting canvas, further comprises:
    检测所述目标元素的数量;detecting the quantity of said target element;
    若所述目标元素的数量大于预设数量阈值,则执行建立多个重绘子线程的步骤;If the number of the target elements is greater than the preset number threshold, then execute the step of establishing multiple redrawing sub-threads;
    若所述目标元素的数量不大于所述预设数量阈值,则在所述重绘画布上绘制所述目标元素。If the number of the target elements is not greater than the preset number threshold, draw the target elements on the repainting canvas.
  7. 如权利要求1至4中任一项所述的方法,其中,所述可视区域为画布与所述电子设备的显示界面对应的区域,所述目标元素为所述画布数据中位于所述可视区域的元素。The method according to any one of claims 1 to 4, wherein the visible area is the area where the canvas corresponds to the display interface of the electronic device, and the target element is located in the visible area in the canvas data. Elements of the viewport.
  8. 如权利要求7中任一项所述的方法,其中,所述目标元素包括在所述电子设备上的书写操作对应的笔迹对应的元素。The method according to any one of claims 7, wherein the target element includes an element corresponding to handwriting corresponding to a writing operation on the electronic device.
  9. 如权利要求1至4中任一项所述的方法,其中,所述电子设备为智能交互平板。The method according to any one of claims 1 to 4, wherein the electronic device is an intelligent interactive tablet.
  10. 一种显示渲染装置,应用于电子设备,包括:A display rendering device applied to electronic equipment, comprising:
    目标元素获取模块,用于在画布数据发生变化的情况下,确定位于可视区域内的目标元素;The target element acquisition module is used to determine the target element located in the visible area when the canvas data changes;
    重绘画布生成模块,用于生成重绘画布,并在所述重绘画布上绘制所述目标元素;A repainting canvas generating module, configured to generate a repainting canvas, and draw the target element on the repainting canvas;
    界面刷新模块,用于在界面渲染线程中,将所述重绘画布叠加绘制到界面渲染画布,并根据所述界面渲染画布刷新显示界面。The interface refreshing module is configured to, in the interface rendering thread, overlay and draw the repainting canvas to the interface rendering canvas, and refresh the display interface according to the interface rendering canvas.
  11. 一种电子设备,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的程序;An electronic device, comprising: a memory, a processor, and a program stored in the memory and operable on the processor;
    所述处理器,用于读取存储器中的程序实现如权利要求1至9中任一项所述的显示渲染方法中的步骤。The processor is configured to read the program in the memory to implement the steps in the display rendering method according to any one of claims 1-9.
  12. 一种可读存储介质,用于存储程序,所述程序被处理器执行时实现如权利要求1至9中任一项所述的显示渲染方法中的步骤。A readable storage medium for storing a program, and when the program is executed by a processor, the steps in the display rendering method according to any one of claims 1 to 9 are realized.
PCT/CN2023/071284 2022-02-25 2023-01-09 Display rendering method and apparatus, electronic device and readable storage medium WO2023160282A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210179865.3A CN114527980A (en) 2022-02-25 2022-02-25 Display rendering method and device, electronic equipment and readable storage medium
CN202210179865.3 2022-02-25

Publications (1)

Publication Number Publication Date
WO2023160282A1 true WO2023160282A1 (en) 2023-08-31

Family

ID=81625284

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/071284 WO2023160282A1 (en) 2022-02-25 2023-01-09 Display rendering method and apparatus, electronic device and readable storage medium

Country Status (2)

Country Link
CN (1) CN114527980A (en)
WO (1) WO2023160282A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117557682A (en) * 2024-01-09 2024-02-13 腾讯科技(深圳)有限公司 Data processing method, apparatus, product, device, and medium

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114527980A (en) * 2022-02-25 2022-05-24 京东方科技集团股份有限公司 Display rendering method and device, electronic equipment and readable storage medium
CN117687771B (en) * 2023-07-24 2024-09-06 荣耀终端有限公司 Buffer allocation device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150279058A1 (en) * 2013-12-19 2015-10-01 Huawei Technologies Co., Ltd. Page Rendering Method and Apparatus
WO2017024144A1 (en) * 2015-08-04 2017-02-09 Google Inc. Systems and methods for interactively presenting a visible portion of a rendering surface on a user device
CN108665520A (en) * 2018-04-24 2018-10-16 微梦创科网络科技(中国)有限公司 A kind of method and device that page animation renders
CN112233009A (en) * 2020-10-13 2021-01-15 广州南方卫星导航仪器有限公司 Picture rendering method, device, equipment and storage medium
CN113052928A (en) * 2021-03-08 2021-06-29 北京房江湖科技有限公司 Image processing method and image processing system
CN114527980A (en) * 2022-02-25 2022-05-24 京东方科技集团股份有限公司 Display rendering method and device, electronic equipment and readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150279058A1 (en) * 2013-12-19 2015-10-01 Huawei Technologies Co., Ltd. Page Rendering Method and Apparatus
WO2017024144A1 (en) * 2015-08-04 2017-02-09 Google Inc. Systems and methods for interactively presenting a visible portion of a rendering surface on a user device
CN108665520A (en) * 2018-04-24 2018-10-16 微梦创科网络科技(中国)有限公司 A kind of method and device that page animation renders
CN112233009A (en) * 2020-10-13 2021-01-15 广州南方卫星导航仪器有限公司 Picture rendering method, device, equipment and storage medium
CN113052928A (en) * 2021-03-08 2021-06-29 北京房江湖科技有限公司 Image processing method and image processing system
CN114527980A (en) * 2022-02-25 2022-05-24 京东方科技集团股份有限公司 Display rendering method and device, electronic equipment and readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117557682A (en) * 2024-01-09 2024-02-13 腾讯科技(深圳)有限公司 Data processing method, apparatus, product, device, and medium
CN117557682B (en) * 2024-01-09 2024-04-19 腾讯科技(深圳)有限公司 Data processing method, apparatus, product, device, and medium

Also Published As

Publication number Publication date
CN114527980A (en) 2022-05-24

Similar Documents

Publication Publication Date Title
WO2023160282A1 (en) Display rendering method and apparatus, electronic device and readable storage medium
EP3259753B1 (en) Systems and methods for reducing memory bandwidth using low quality tiles
US8384738B2 (en) Compositing windowing system
CN110989878B (en) Animation display method and device in applet, electronic equipment and storage medium
CN105487848B (en) A kind of the display method for refreshing and system of 3D application
WO2019041863A1 (en) Image processing system, image displaying method, display device, and storage medium
KR20130138143A (en) System and method for display mirroring
WO2018000372A1 (en) Picture display method and terminal
US20190089927A1 (en) Block-based power efficient timing engine for smart display panels
WO2022179362A1 (en) Image alpha-blending method and apparatus
US10068549B2 (en) Cursor handling in a variable refresh rate environment
US10416808B2 (en) Input event based dynamic panel mode switch
CN102103849B (en) OSD controller
CN113316018A (en) Method, device and storage medium for overlaying time information on video picture display
CN112130948A (en) Display control method and device, computer readable medium and electronic device
US20140292617A1 (en) System, method, and computer program product for reducing image artifacts on multiple displays
US10546558B2 (en) Request aggregation with opportunism
US20100182331A1 (en) Method and apparatus for drawing image
US9251557B2 (en) System, method, and computer program product for recovering from a memory underflow condition associated with generating video signals
US12094433B2 (en) Low power display refresh during semi-active workloads
WO2017000605A1 (en) System on chip, graphic plotting method, intermediate layer, embedded device and medium
CN113674704A (en) Image display control method and device and display equipment
US20230082747A1 (en) System and method for improving graphical user interface rendering
CN112445318B (en) Object display method and device, electronic equipment and storage medium
US12105934B2 (en) Electronic apparatus and UI providing method thereof

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23758907

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE