WO2023024972A1 - 图元共享方法、电子设备、芯片及计算机可读存储介质 - Google Patents

图元共享方法、电子设备、芯片及计算机可读存储介质 Download PDF

Info

Publication number
WO2023024972A1
WO2023024972A1 PCT/CN2022/112769 CN2022112769W WO2023024972A1 WO 2023024972 A1 WO2023024972 A1 WO 2023024972A1 CN 2022112769 W CN2022112769 W CN 2022112769W WO 2023024972 A1 WO2023024972 A1 WO 2023024972A1
Authority
WO
WIPO (PCT)
Prior art keywords
chip
sub
primitive
graphic element
control
Prior art date
Application number
PCT/CN2022/112769
Other languages
English (en)
French (fr)
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 WO2023024972A1 publication Critical patent/WO2023024972A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/3287Power saving characterised by the action undertaken by switching off individual functional units in the computer system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/60Memory management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles

Definitions

  • the present application relates to the technical field of terminals, and in particular to a graphic element sharing method, an electronic device, a chip, and a computer-readable storage medium.
  • terminal devices such as smart watches
  • dual-chip dual systems on the market.
  • One operating system is relatively simple, and it is carried on a sub-chip with low power consumption and low computing power.
  • the other operating system is relatively complex. It is mounted on the main chip with high power consumption and high computing power.
  • the main and secondary chips work together to take into account both device performance and battery life.
  • the anti-aliasing algorithm cannot be integrated, resulting in aliasing when drawing graphics/text.
  • the existing solution is generally to draw some complex interfaces on the main chip side in advance and store them in the terminal device. However, if the terminal device needs to support multiple languages, it needs to draw and store multiple versions of the interface in advance, which leads to excessive occupation of the terminal device. more memory space.
  • the first aspect of the embodiment of the present application discloses a graphic element sharing method, which is applied to an electronic device, and the electronic device includes a main chip, a secondary chip, and a display screen.
  • the main chip is used to run the first operating system
  • the secondary chip is used to run the second operating system.
  • the graphic element sharing method includes: when the sub-chip draws the interface content, the sub-chip acquires a control set corresponding to the interface content, and the control set includes at least one control; The first type of control with set conditions; the sub-chip sends the drawing instruction corresponding to the first type of control to the main chip for drawing; the sub-chip obtains the drawing result of the main chip; The graphic element drawing result is synthesized, and the synthetic result is sent to the display screen, wherein the local graphic element drawing result is drawn by the sub-chip executing the drawing instruction corresponding to each control.
  • the sub-chip when the sub-chip is drawing the interface content, for controls with poor drawing effect, the sub-chip can request the main chip to assist in drawing, so as to realize the defect that the sub-chip cannot draw complex and fine interfaces due to insufficient hardware capabilities .
  • the graphic element sharing method further includes: the sub-chip calls the UI drawing framework to obtain a drawing instruction corresponding to each control in the control set.
  • the sub-chip can call a UI drawing framework, such as UIkit framework, to obtain the drawing instructions corresponding to each control, and then identify the first type of controls that do not meet the preset conditions.
  • a UI drawing framework such as UIkit framework
  • the sub-chip sends the drawing instructions corresponding to the first type of controls to the main chip for drawing, including: the sub-chip marks the controls that do not meet the preset conditions to obtain the first type of controls; The chip sends the drawing instruction corresponding to the first type of control to the main chip for drawing.
  • the sub-chip can mark controls that do not meet the preset conditions, and then entrust the marked controls to the main chip for drawing.
  • the electronic device further includes a memory, and the memory is used to store the graphic element drawing result of the main chip, and the secondary chip obtains the graphic element rendering result of the main chip, including: the secondary chip reads the graphic element drawing result of the main chip from the memory Metadrawing results.
  • the secondary chip can read the graphic element rendering result of the main chip from the memory, and the main chip can enter a dormant state after completing the entrusted control drawing.
  • the sub-chip identifies the first type of controls that do not meet the preset conditions according to the drawing instructions corresponding to each control in the control set, including: when the drawing instructions corresponding to the controls contain preset instructions, The secondary chip identifies the control as the first type of control.
  • preset instructions are defined in advance according to the graphic element drawing performance of the sub-chip, and if the drawing command of a certain control includes the preset command, the control can be identified as a control with poor drawing effect on the side of the sub-chip.
  • the sub-chip synthesizes the rendering result of the local graphics entity with the rendering result of the graphics entity of the main chip, including: the sub-chip superimposes and synthesizes the rendering result of the graphics entity of the main chip and the rendering result of the local graphics entity; Or the sub-chip replaces the part corresponding to the first type of control in the local primitive drawing result with the primitive drawing result of the main chip.
  • the embodiment of the present application provides a graphic element sharing method, which is applied to an electronic device, and the electronic device includes a main chip, a secondary chip, a memory, and a display screen.
  • the main chip is used to run the first operating system
  • the secondary chip is used to run the second operating system.
  • the graphic element sharing method includes: when the sub-chip draws the interface content, the sub-chip acquires a control set corresponding to the interface content, and the control set includes at least one control; The first type of control with the condition set; the sub-chip reads the graphics primitive drawing result corresponding to the first type of control from the memory; the sub-chip synthesizes the local graphics primitive drawing result with the graphics primitive drawing result read from the memory, and synthesizes The result is sent to the display screen, where the drawing result of the local primitive is drawn by the secondary chip executing the drawing instruction corresponding to each control.
  • the sub-chip when the sub-chip is drawing the interface content, for the controls with poor drawing effect, the sub-chip can try to read the primitives corresponding to the controls with poor drawing effect from the memory, so as to complete the sub-chip Due to insufficient hardware capabilities, it is impossible to draw complex and fine interface defects.
  • the second operating system includes at least one preset application
  • the graphic element sharing method further includes: the main chip acquires a set of controls required for the secondary chip to draw the interface content of the preset application; The controls in the set that do not meet the preset conditions; the main chip executes the drawing instructions corresponding to the controls in the set that do not meet the preset conditions, and draw multiple shared graphics primitives; the main chip stores the multiple shared graphics primitives in the memory.
  • the main chip pre-identifies controls with poor drawing effects on the side of the sub-chip, and pre-renders these controls with poor drawing effects into shared primitives and saves them in the memory, so that when the subsequent sub-chip draws interface content , try to read the primitives corresponding to these poorly drawn controls from memory.
  • the graphic element sharing method further includes: when the sub-chip fails to read the graphic element drawing result corresponding to the first type control from the memory, the sub-chip The drawing instruction corresponding to the control of the element drawing result is sent to the main chip for drawing; the main chip executes the drawing instruction sent by the sub-chip, and stores the drawing result of the primitive corresponding to the drawing instruction in the memory.
  • the sub-chip when the sub-chip is drawing the interface content, for the control with poor drawing effect, if the memory does not have the shared primitives required by the sub-chip, the sub-chip can request the main chip to assist in drawing, so as to complete the sub-chip.
  • the chip is unable to draw complex and fine interface defects due to insufficient hardware capabilities.
  • the sub-chip identifies the first type of controls that do not meet the preset conditions according to the drawing instructions corresponding to each control in the control set, including: when the drawing instructions corresponding to the controls contain preset instructions , the secondary chip identifies the control as the first type of control.
  • the preset instructions are defined in advance according to the graphic element drawing performance of the secondary chip. If the drawing instructions of a certain control include the preset instructions, the control can be identified as a control with poor drawing effect on the secondary chip side (the first type control).
  • the secondary chip synthesizes the drawing result of the local primitive and the drawing result of the primitive read from the memory, including: the secondary chip combines the drawing result of the primitive read from the memory with the drawing result of the local primitive Perform overlay synthesis; or the sub-chip replaces the part corresponding to the first type of control in the local primitive drawing result with the primitive drawing result read from the memory.
  • the embodiment of the present application provides an electronic device, including a main chip, a sub-chip, a memory, and a display screen.
  • the main chip runs the first operating system
  • the secondary chip runs the second operating system
  • the first operating system includes the first graphic element sharing service program and the graphic element drawing program
  • the second operating system includes the second graphic element sharing service program and the first application program.
  • the first application program When the first application program draws the interface content, the first application program obtains the shared graphic elements contained in the interface content, wherein the shared graphic entity is a graphic element whose drawing effect on the sub-chip side does not meet the preset requirements;
  • the second graphics primitive sharing service program and the first graphics primitive sharing service program send the drawing request of the shared graphics primitive to the graphics primitive drawing program;
  • the graphics primitive drawing program responds to the drawing request of the shared graphics primitive, and performs graphics primitive drawing;
  • the main chip The primitive drawing result of the rendering program is stored in the memory; the secondary chip synthesizes the local primitive drawing result and the primitive drawing result read from the memory, and sends the synthesized result to the display screen, wherein the local primitive drawing result is provided by the first An application drawing is obtained.
  • the sub-chip when the sub-chip is drawing the interface content, for controls with poor drawing effect, the sub-chip can request the main chip to assist in drawing, so as to realize the defect that the sub-chip cannot draw complex and fine interfaces due to insufficient hardware capabilities .
  • the memory is a first video memory
  • the sub-chip includes a second video memory
  • the second video memory is used to store local rendering results of primitives.
  • the sub-chip superimposes and synthesizes the drawing result of the local graphics entity with the drawing result of the graphics entity read from the memory, or the sub-chip replaces the part corresponding to the shared graphics entity in the drawing result of the local graphics entity with Primitive drawing result read from memory.
  • the embodiment of the present application provides a computer-readable storage medium, including computer instructions, and when the computer instructions are run on the electronic device, the electronic device executes the graphic element sharing method as described in the first aspect or the second aspect .
  • the embodiment of the present application provides a computer program product, which, when the computer program product is run on a computer, causes the computer to execute the graphic element sharing method as described in the first aspect or the second aspect.
  • the embodiment of the present application provides a device (such as a chip), which has the function of realizing the behavior of the secondary chip in the method provided in the first aspect or the second aspect.
  • the functions may be implemented by hardware, or may be implemented by executing corresponding software through hardware.
  • Hardware or software includes one or more modules corresponding to the above-mentioned functions.
  • the computer-readable storage medium described in the fourth aspect, the computer program product described in the fifth aspect, and the device described in the fifth aspect all correspond to the method of the first aspect or the second aspect above, Therefore, the beneficial effects that it can achieve can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.
  • FIG. 1 is a schematic diagram of an application scenario of a graphic element sharing method provided by an embodiment of the present application
  • FIG. 2 is a schematic diagram of a hardware module of an electronic device provided by an embodiment of the present application to realize graphic element sharing;
  • FIG. 3 is a schematic diagram of a software architecture of an electronic device implementing graphic element sharing provided by an embodiment of the present application
  • FIG. 4 is a schematic diagram of drawing a dial interface by an electronic device provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of internal data interaction of an electronic device to realize graphic element sharing provided by an embodiment of the present application
  • FIG. 6 is a schematic flowchart of a graphic element sharing method provided by an embodiment of the present application.
  • FIG. 7 is a schematic flowchart of a graphic element sharing method provided by another embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a possible electronic device provided by an embodiment of the present application.
  • words such as “exemplary” or “for example” are used as examples, illustrations or illustrations. Any embodiment or design scheme described as “exemplary” or “for example” in the embodiments of the present application shall not be interpreted as being more preferred or more advantageous than other embodiments or design schemes. Rather, the use of words such as “exemplary” or “such as” is intended to present related concepts in a concrete manner.
  • An application program which may be referred to as an application, is a software program capable of realizing one or more specific functions.
  • multiple applications can be installed in an electronic device, for example, an instant messaging application, a video application, an audio application, an image capture application, a cloud desktop application, and the like.
  • instant messaging applications for example, may include SMS applications, WeChat, WhatsApp Messenger, Line, photo sharing (instagram), Kakao Talk, DingTalk, and the like.
  • the image capturing application may include, for example, a camera application (system camera or third-party camera application).
  • Video applications for example, can include Youtube, Twitter, Douyin, iQiyi, Tencent Video, etc.
  • Audio applications may include Kugou Music, Xiami, QQ Music and so on.
  • the applications mentioned in the following embodiments may be system applications installed when the electronic device leaves the factory, or third-party applications downloaded from the Internet or obtained by other electronic devices during the use of the electronic device by the user.
  • the application scenario diagram of the graphic element sharing method provided by the embodiment of the present invention is exemplarily introduced below with reference to FIG. 1 .
  • the electronic device 100 may refer to a device with a display screen, for example, the electronic device 100 may be a device such as a smart watch, a mobile phone, a tablet computer, or a smart home.
  • the electronic device 100 can communicate with other electronic devices or servers through a communication network.
  • the communication network may be a local area network, or a wide area network switched through a relay (relay) device, or a local area network and a wide area network.
  • the communication network may be a short distance communication network such as a wifi hotspot network, a wifi P2P network, a bluetooth network, a zigbee network or a near field communication (near field communication, NFC) network.
  • the communication network may be a third-generation mobile communication technology (3rd-generation wireless telephone technology, 3G) network, a fourth-generation mobile communication technology (the 4th generation mobile communication technology, 4G ) network, the fifth-generation mobile communication technology (5th-generation mobile communication technology, 5G) network, the future evolution of the public land mobile network (public land mobile network, PLMN) or the Internet, etc.
  • the electronic device 100 can be equipped with two operating systems, the operating systems can be Or Hongmeng system, etc.
  • the electronic device 100 is a smart watch as an example for illustration, and the electronic device 100 includes a display screen 10 .
  • the display screen 10 is used to display the display interface of the application, and the display screen 10 can be a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (organic light-emitting diode, OLED) display screen, an active matrix organic light-emitting diode Or active-matrix organic light emitting diode (AMOLED) display, flexible light-emitting diode (flex light-emitting diode, FLED) display, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED) display screen etc.
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • AMOLED active matrix organic light-emitting diode Or active-matrix organic light emitting diode
  • the electronic device 100 includes a display screen 10 , a main chip 12 and a secondary chip 14 .
  • the main chip 12 is used to run the first operating system
  • the sub-chip 14 is used to run the second operating system.
  • the performance of the sub-chip 14 is lower than that of the main chip 12, and the power consumption of the sub-chip 14 is lower than that of the main chip 12.
  • the second operating system run by the secondary chip 14 may be a lightweight version of the first operating system.
  • the lightweight version of the operating system does not require high hardware configuration and can run on a low-power chip, but compared with the first operating system, the system has weaker processing capabilities and provides relatively fewer system functions.
  • the main chip 12 can be a central processing unit (central processing unit, CPU), a system-on-chip (System on Chip, SoC), an application processor (application processor, AP), etc. Strong processing chip.
  • the secondary chip 14 may be a processing chip with low power consumption and relatively weak chip computing power, such as a microcontroller (Microcontroller Unit, MCU), a single chip microcomputer (Single Chip Microcomputer, SCM).
  • the electronic device 100 is a smart watch, and the electronic device 100 includes a first working mode and a second working mode.
  • the first working mode all functions of the smart watch are turned on. At this time, the power consumption of the smart watch is relatively high.
  • the main chip 12 can draw the interface content, and the drawing result can be sent to the display screen 10 .
  • the smart watch In the second working mode, the smart watch can only turn on some routine functions (such as heart rate monitoring, notification viewing, simple dial display, etc.), and the power consumption of the smart watch is low at this time.
  • the main chip 12 is in a dormant state, and the second operating system run by the secondary chip 14 realizes these normal functions.
  • the sub-chip 14 In the second working mode, due to the limited chip computing power of the sub-chip 14, when the sub-chip 14 draws the interface content, there may be some controls with poor rendering effects, and the sub-chip 14 can entrust these controls with poor rendering effects to Draw for the main chip 12, and then the sub-chip 14 synthesizes its own drawing result with the drawing result of the main chip 12, and sends the combined result to the display screen 10, which can prevent the sub-chip 14 from seeing jagged graphics due to its poor hardware performance. Distortion defect.
  • the main chip 12 may continue to enter the dormant state after completing the commissioned drawing of the widget.
  • FIG. 3 it is a schematic diagram of an architecture of an electronic device provided in the embodiment of the present application to realize graphic element sharing.
  • the electronic device 100 includes a display screen 10 , a main chip 12 , a secondary chip 14 and a first video memory 16 .
  • the main chip 12 is used to run the first operating system
  • the sub-chip 14 is used to run the second operating system.
  • Both the main chip 12 and the secondary chip 14 have the read and write authority of the first video memory 16 .
  • the first video memory 16 is used to store the primitives shared to the sub-chip 14, for example, when the main chip 12 receives the primitive drawing request of the sub-chip 14, the main chip 12 can respond to the primitive drawing request to draw the primitives, and
  • the drawn primitives are stored in the first video memory 16 , and the secondary chip 14 can read the primitives it entrusts the main chip 12 to draw from the first video memory 16 .
  • the sub-chip 14 may also include a second video memory 140 , and the second video memory 140 is used to store graphics primitives drawn by the sub-chip 14 itself.
  • Both the first video memory 16 and the second video memory 140 can be static random access memory (Static Random-Access Memory, SRAM), synchronous dynamic random access memory (Synchronous Dynamic Random Access Memory, SDRAM), double-rate SDRAM (Double Any one of Data Rate SDRAM, DDR), etc.
  • the first video memory 16 and the second video memory 140 may also be other types of memory, which are not limited here.
  • the first operating system may include a first primitive sharing service program 121 and a primitive rendering program 122
  • the second operating system may include a second primitive sharing service program 141 , a first application program 142 and a drawing service program 143
  • the first application program 142 may be an application installed when the electronic device 100 leaves the factory, or may be a third-party application downloaded from the network or obtained by the user from other electronic devices during the use of the electronic device 100 .
  • the following takes the first application program 142 as an example of a dial application for illustration.
  • the shared graphics entity may refer to a graphics entity whose rendering effect drawn on the secondary chip side does not meet the preset requirements.
  • the preset conditions may be defined according to actual requirements, for example, the preset conditions may refer to jagged graphic elements drawn on the side of the sub-chip, or unsatisfactory definition.
  • the first application program 142 may call the drawing service program 143 to draw the dial interface
  • the drawing service program 143 may include a UI drawing framework, such as a UIkit framework.
  • the dial interface can be divided into multiple primitives, and each primitive can correspond to a control.
  • the drawing service program 143 can store the drawn graphics primitives in the second video memory 140 .
  • the UI drawing framework can identify the drawing instruction corresponding to the control.
  • the drawing instruction corresponding to a certain control includes a preset instruction
  • the preset instruction can be pre-defined according to the graphic element drawing performance of the sub-chip 14, for example, if the sub-chip 14 draws arc-shaped text, it will produce jagged, then the preset instruction can be set as a drawing instruction containing arc-shaped text.
  • the first application program 142 can obtain the shared graphics primitives contained in the dial interface, and the first application program 142 sends the drawing request of the shared graphics primitives to the second graphics primitives
  • the sharing service program 141, and the second graphic element sharing service program 141 forward the drawing request of the shared graphic entity to the first graphic entity sharing service program 121, so that the main chip 12 receives the drawing request of the shared graphic entity sent by the secondary chip 14.
  • the first primitive sharing service program 121 may send the drawing request of the shared primitive to the primitive rendering program 122, and the primitive rendering program 122 performs the drawing of the shared primitive in response to the received drawing request of the shared primitive. Due to the strong performance of the main chip 12, the shared graphics drawn by the graphics graphics program 122 have no jagged edges.
  • the main chip 12 can store the shared primitive drawn by the primitive drawing program 122 in the first video memory 16 .
  • the sub-chip 14 can read the shared primitive drawn by the main chip 12 from the first video memory 16 .
  • the drawing request for the shared primitive may include a drawing instruction corresponding to the shared primitive, and then the primitive drawing program 122 may execute the drawing instruction corresponding to the shared primitive to draw the shared primitive.
  • the sub-chip 14 can synthesize multiple graphics primitives stored in the second video memory 140 with the shared graphics primitives read from the first video memory 16, and send the composite results to the display screen 10 for decoding and display.
  • the sub-chip 14 may combine local primitives (graphic primitives drawn by the drawing service program 143 ) and shared primitives in the second video memory 140 .
  • the main chip 12 when the main chip 12 stores the shared primitives drawn by the primitive drawing program 122 into the first video memory 16, the main chip 12 can send a drawing completion message to the secondary chip 14 to prompt the secondary chip 14 that the shared primitives have been completed. The drawing is done.
  • the plurality of graphic elements drawn by the drawing service program 143 can form a complete dial interface, but some of the graphic elements drawn by the drawing service program 143 have jagged edges.
  • the sub-chip 14 can superimpose and synthesize a plurality of graphics primitives stored in the second video memory 140 and shared graphics primitives read from the first video memory 16 , so that the finally synthesized dial interface does not have jaggies.
  • the sub-chip 14 can also replace the jagged primitives among the multiple primitives stored in the second video memory 140 with the shared primitives read from the first video memory 16, so that the final synthesized dial interface does not Jaggies are present.
  • the main chip 12 may pre-identify that the interface of the preset application has poorly drawn controls on the side of the secondary chip, and these poorly drawn controls may be Marked by the main chip 12 , the main chip 12 can pre-render these marked controls into shared primitives and save them to the first video memory 16 .
  • the sub-chip 14 When the sub-chip 14 is drawing the interface content, it may try to use the shared graphics primitives stored in the first video memory 16 to replace graphics primitives with poor drawing effects. If there is no shared primitive required by the secondary chip 14 in the first video memory 16 , the secondary chip 14 may entrust the main chip 12 to draw the primitive.
  • the dial interface I1 is an interface of a preset dial application of the second operating system.
  • the dial interface I1 can be divided into multiple graphic elements, and each graphic element can correspond to a control.
  • the main chip 16 can obtain the set of controls required for drawing the dial interface I1.
  • the drawing of the dial interface I1 involves the first control c1, the second control c2, the third control c3, the fourth control c4, the fifth control c5 and the sixth control.
  • Control c6 The main chip 12 can identify whether there is a control with poor drawing effect on the side of the secondary chip 14 among the first to sixth controls c1-c6.
  • the main chip 12 can pre-execute the drawing instructions corresponding to the first control c1 and the sixth control c6 to obtain shared primitives I11, I12.
  • the main chip 16 can store the drawn shared primitives I11 and I12 in the first video memory 16 .
  • the sub-chip 14 When the sub-chip 14 is drawing the dial interface I1, the sub-chip 14 can obtain the control set required for drawing the dial interface I1.
  • the sub-chip 14 can identify controls with poor drawing effects included in the control set.
  • the secondary chip 14 can execute drawing instructions corresponding to the first to sixth controls c1 - c6 to obtain a plurality of local primitives, which can be stored in the second video memory 140 .
  • the sub-chip 14 can try to read the shared primitive corresponding to the control with poor drawing effect from the first video memory 16 , and superimpose and synthesize the local primitive and the shared primitive, and then send the composite result to the display screen 10 .
  • the secondary chip 14 may request the main chip 12 to draw the shared primitive.
  • FIG. 5 it is a schematic diagram of data interaction of functional modules of an electronic device provided by an embodiment of the present application.
  • the electronic device 100 includes a display screen 10 , a main chip 12 , a secondary chip 14 and a first video memory 16 .
  • the main chip 12 is used to run the first operating system
  • the sub-chip 14 is used to run the second operating system.
  • the secondary chip 14 includes a second video memory 140 .
  • the first operating system includes a first primitive sharing service program 121 and a primitive rendering program 122
  • the second operating system includes a second primitive sharing service program 141 , a first application program 142 and a drawing service program 143 .
  • the first application program 142 When the first application program 142 draws interface content, the first application program 142 sends an interface drawing request to the drawing service program 143.
  • the drawing service program 143 draws the interface content, and stores the drawn local primitives in the second video memory 140.
  • the drawing service program 143 may include a UI drawing framework, such as UIkit framework.
  • the drawing service program 143 can obtain the control set required for drawing interface content.
  • the drawing service program 143 then executes the drawing instruction corresponding to each control in the control set, and draws the obtained multiple primitives (local primitives).
  • the plurality of local primitives are stored in the second video memory 140 .
  • the first application program 142 obtains the shared graphic entities contained in the interface content, and sends a drawing request of the shared graphic entities to the second graphic entity sharing service program 141 .
  • the UI drawing framework can identify the drawing instruction corresponding to the control, and when the drawing instruction corresponding to a certain control includes a preset instruction, it can be considered that the primitive corresponding to the control is a shared primitive.
  • the first application program 142 may obtain the shared graphic elements included in the interface content.
  • the shared primitive can be regarded as a primitive whose rendering effect is not good when the primitive corresponding to the control is drawn on the side of the sub-chip, and requires the assistance of the main chip 12 to draw.
  • the preset instruction can be pre-defined according to the graphic element drawing performance of the sub-chip 14, for example, if the sub-chip 14 draws arc-shaped text, it will produce jagged, then the preset instruction can be set as a drawing instruction containing arc-shaped text.
  • the second graphic entity sharing service program 141 sends the drawing request of the shared graphic entity to the first graphic entity sharing service program 121.
  • the first primitive sharing service program 121 sends the drawing request of the shared primitive to the primitive drawing program 122.
  • the graphic entity drawing program 122 responds to the drawing request of the shared graphic entity, and performs shared graphic entity drawing.
  • the primitive rendering program 122 stores the drawn shared primitives in the first video memory 16.
  • the primitive drawing program 122 sends a shared primitive rendering completion message to the first primitive sharing service program 121 .
  • the first graphic entity sharing service program 121 sends a shared graphic entity rendering completion message to the second graphic entity sharing service program 141 .
  • the second graphic entity sharing service program 141 sends a shared graphic entity drawing completion message to the drawing service program 143.
  • the drawing service program 143 superimposes and synthesizes the local primitives stored in the second video memory 140 and the shared primitives stored in the first video memory 16.
  • the drawing service program 143 sends the synthesis result to the display screen 10 for decoding and displaying.
  • a graphic element sharing method provided by an embodiment of the present application is applied to an electronic device 100 .
  • the electronic device 100 includes a display screen 10 , a main chip 12 and a secondary chip 14 .
  • the main chip 12 is used to run the first operating system
  • the sub-chip 14 is used to run the second operating system.
  • the graphic element sharing method may include:
  • the secondary chip 14 draws the interface content
  • the secondary chip 14 acquires a control set corresponding to the interface content.
  • a set of controls may include at least one control.
  • the second operating system may include a UI drawing framework, and the UI drawing framework may generate a control set required for drawing the interface content according to the interface content. That is, the secondary chip 14 can obtain the control set corresponding to the interface content through the UI drawing framework.
  • the sub-chip 14 identifies the first type of controls that do not meet the preset conditions according to the drawing instruction corresponding to each control in the control set.
  • the preset condition may be defined according to actual requirements.
  • the preset condition may refer to defects such as jaggies and unsatisfactory definition of graphics primitives drawn on the secondary chip side.
  • the UI drawing framework can identify the drawing instructions corresponding to each control in the control set. When the drawing instructions corresponding to a certain control include preset instructions, it can be considered that the graphics primitives corresponding to the control are drawn on the secondary chip side and the drawing effect is not good. , requires the main chip 12 to assist in drawing, and this control is considered as the first type of control.
  • the preset instruction can be pre-defined according to the graphic element drawing performance of the sub-chip 14, for example, if the sub-chip 14 draws arc-shaped text, it will produce jagged, then the preset instruction can be set as a drawing instruction containing arc-shaped text.
  • the UI drawing framework recognizes that the drawing instruction of a certain control includes the drawing instruction of arc text, the control is considered as the first type of control that does not meet the preset condition.
  • the sub-chip 14 can also mark the controls that do not meet the preset conditions, and the marked controls are the first type of controls, so as to facilitate subsequent sending of drawing instructions corresponding to the first type of controls to the main chip 12 .
  • the secondary chip 14 sends the drawing instruction corresponding to the first type of control to the main chip 12 for drawing.
  • the main chip 12 may be a processing chip with high power consumption and strong chip computing power, such as CPU, SoC, and AP.
  • the secondary chip 14 may be a processing chip with low power consumption and relatively weak computing power, such as MCU and SCM. Since the chip performance of the main chip 12 is stronger than that of the sub-chip 14, the sub-chip 14 sends the drawing instruction corresponding to the first type of control to the main chip 12 for drawing, which can avoid defects such as sawtooth.
  • the sub-chip 14 acquires the graphic element drawing result of the main chip 12 .
  • the electronic device 100 may further include a first video memory 16 , and both the main chip 12 and the secondary chip 14 have the read permission of the first video memory 16 .
  • the main chip 12 can store the drawing results of the primitives in the first video memory 16 , and the sub-chip 14 reads the drawing results of the primitives of the main chip 12 from the first video memory 16 .
  • the main chip 12 may also send the primitive drawing result to the sub-chip 14 .
  • the sub-chip 14 synthesizes the local primitive drawing result and the primitive rendering result of the main chip 12, and sends the composite result to the display screen 10 for display.
  • the local primitive drawing result may refer to the primitive drawn by the secondary chip 14 executing the drawing instruction corresponding to each control in the control set.
  • the rendering result of the local primitives of the secondary chip 14 can constitute a complete interface content, but the synthesized interface content has jagged edges.
  • the sub-chip 14 can superimpose and synthesize the rendering result of the local primitives and the rendering result of the primitives of the main chip 12, so that there is no jaggies in the finally synthesized interface content.
  • the sub-chip 14 may also replace the jagged graphics primitives in the local graphics primitive drawing result with the graphics primitive rendering result of the main chip 12, so that the finally synthesized interface content does not have jagged graphics.
  • the sub-chip when the sub-chip is drawing the interface content, the sub-chip can request the main chip to assist in drawing the controls with poor drawing effect, so as to realize the defect that the sub-chip cannot draw complex and fine interfaces due to insufficient hardware capabilities .
  • a graphic element sharing method provided by an embodiment of the present application is applied to an electronic device 100 .
  • the electronic device 100 includes a display screen 10 , a main chip 12 , a secondary chip 14 and a first video memory 16 .
  • the main chip 12 is used to run the first operating system
  • the sub-chip 14 is used to run the second operating system.
  • the graphic element sharing method may include:
  • the secondary chip 14 draws the interface content
  • the secondary chip 14 acquires a control set corresponding to the interface content.
  • a set of controls may include at least one control.
  • the second operating system may include a UI drawing framework, and the UI drawing framework may generate a control set required for drawing the interface content according to the interface content. That is, the secondary chip 14 can obtain the control set corresponding to the interface content through the UI drawing framework.
  • the sub-chip 14 identifies the first type of controls that do not meet the preset conditions according to the drawing instruction corresponding to each control in the control set.
  • the preset condition may be defined according to actual requirements.
  • the preset condition may refer to defects such as jaggies and unsatisfactory definition of graphics primitives drawn on the secondary chip side.
  • the drawing command corresponding to a certain control includes a preset command
  • the control can be considered as the first type of control.
  • the preset instruction can be pre-defined according to the graphic element drawing performance of the sub-chip 14, for example, if the sub-chip 14 draws arc-shaped text, it will produce jagged, then the preset instruction can be set as a drawing instruction containing arc-shaped text.
  • the sub-chip 14 reads the graphic primitive drawing result corresponding to the first type of control from the first video memory 16.
  • the first video memory 16 may be any one of SRAM, SDRAM, DDR, and the like.
  • the first video memory 16 can also select other types of memory according to actual application scenarios.
  • the main chip 12 can identify controls that are poorly drawn on the side of the sub-chip. These poorly drawn controls can be marked out by the main chip 12, and the main chip 12 can pre-draw these marked controls, and store the drawing results in the first video memory 16, and then the sub-chip 14 can try to read from the first video memory 16. Get the primitive drawing result corresponding to the first type of control.
  • the main chip 12 may pre-identify that the interface of the preset application has poorly drawn controls on the side of the secondary chip, and these poorly drawn controls may be Marked by the main chip 12 , the main chip 12 can pre-render these marked controls into shared primitives and save them to the first video memory 16 .
  • the sub-chip 14 When the sub-chip 14 is drawing the interface content, it may try to use the shared graphics primitives stored in the first video memory 16 to replace graphics primitives with poor drawing effects. If there is no shared primitive required by the secondary chip 14 in the first video memory 16, the secondary chip 14 can entrust the main chip 12 to draw the primitives, and the subsequent secondary chip 14 reads from the first video memory 16 corresponding to the first type of control. The primitive drawing result of .
  • the sub-chip 14 synthesizes the local primitive drawing result and the primitive rendering result read from the first video memory 16 , and sends the composite result to the display screen 10 for display.
  • the local primitive drawing result may refer to the primitive drawn by the secondary chip 14 executing the drawing instruction corresponding to each control in the control set.
  • the rendering result of the local primitives of the secondary chip 14 can constitute a complete interface content, but the synthesized interface content has jagged edges.
  • the sub-chip 14 can superimpose and synthesize the rendering result of the local primitives and the rendering result of the primitives read from the first video memory 16, so that there is no jaggies in the finally synthesized interface content.
  • the sub-chip 14 may also replace the jagged primitives in the local primitive rendering result with the primitive rendering result read from the first video memory 16, so that the finally synthesized interface content does not have jagged.
  • the sub-chip when the sub-chip is drawing the interface content, for controls with poor drawing effect, the sub-chip can try to read the pre-drawn primitives of the main chip from the first video memory, if the first video memory does not exist the sub-chip For the required primitives, the sub-chip can request the main chip to assist in drawing, so as to realize the defect that the sub-chip cannot draw complex and fine interfaces due to insufficient hardware capabilities.
  • the electronic device 100 may include a screen 1001 , a first processor 1002 , a second processor 1003 , a memory 1004 and a communication bus 1005 .
  • the memory 1004 is used to store one or more computer programs 1006 .
  • One or more computer programs 1006 are configured to be executed by the second processor 1003 .
  • the one or more computer programs 1006 include instructions, and the execution of the instructions by the second processor 1003 may implement the above method for sharing graphic elements in the electronic device 100 .
  • the structure shown in this embodiment does not constitute a specific limitation on the electronic device 100 .
  • the electronic device 100 may include more or fewer components than shown, or combine certain components, or separate certain components, or arrange different components.
  • Both the first processor 1002 and the second processor 1003 may include one or more processing units, for example: both the first processor 1002 and the second processor 1003 may include a modem, a graphics processing unit (graphics processing unit, GPU), Image signal processor (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU) and so on. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • Both the first processor 1002 and the second processor 1003 may also be provided with memories for storing instructions and data.
  • the memories in the first processor 1002 and the second processor 1003 are cache memories.
  • the memory may store instructions or data that have just been used or are recycled by the first processor 1002 or the second processor 1003 . If the first processor 1002 and the second processor 1003 need to use the instruction or data again, they can be directly called from the memory. Repeated access is avoided, and the waiting time of the first processor 1002 and the second processor 1003 is reduced, thereby improving the efficiency of the system.
  • both the first processor 1002 and the second processor 1003 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transmitter (universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input/output (general-purpose input/output, GPIO) interface, SIM interface, and/or USB interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • the memory 1004 can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, internal memory, plug-in hard disk, smart memory card (Smart Media Card, SMC), secure digital (Secure Digital (SD) card, flash card (Flash Card), at least one disk storage device, flash memory device, or other non-volatile solid-state storage device.
  • a non-volatile memory such as a hard disk, internal memory, plug-in hard disk, smart memory card (Smart Media Card, SMC), secure digital (Secure Digital (SD) card, flash card (Flash Card), at least one disk storage device, flash memory device, or other non-volatile solid-state storage device.
  • This embodiment also provides a computer storage medium, where computer instructions are stored in the computer storage medium, and when the computer instructions are run on the electronic device, the electronic device is made to perform the above-mentioned related method steps to implement the graphic element sharing method in the above-mentioned embodiment .
  • This embodiment also provides a computer program product, which, when running on a computer, causes the computer to execute the above related steps, so as to implement the graphic element sharing method in the above embodiment.
  • an embodiment of the present application also provides a device, which may specifically be a chip, a component or a module, and the device may include a connected processor and a memory; wherein the memory is used to store computer-executable instructions, and when the device is running, The processor can execute the computer-executable instructions stored in the memory, so that the chip executes the graphic element sharing method in the above method embodiments.
  • the electronic device, computer storage medium, computer program product or chip provided in this embodiment is all used to execute the corresponding method provided above, therefore, the beneficial effects it can achieve can refer to the corresponding method provided above The beneficial effects in the method will not be repeated here.
  • the disclosed devices and methods may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components can be combined Or it can be integrated into another device, or some features can be omitted, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • the unit described as a separate component may or may not be physically separated, and a component displayed as a unit may be one physical unit or multiple physical units, which may be located in one place or distributed to multiple different places. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
  • the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a readable storage medium.
  • the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium Among them, several instructions are included to make a device (which may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disc and other media that can store program codes. .

Abstract

一种图元共享方法,涉及终端领域。电子设备(100)中的副芯片(14)在绘制界面内容时,获取与界面内容对应的控件集(61,71),副芯片(14)将控件集中绘制效果不佳的控件委托给主芯片(12)进行绘制(62,63),副芯片(14)将自身图元绘制结果与主芯片(12)的图元绘制结果进行合成,及将合成结果送至显示屏(10)(65)。可实现对于副芯片(14)绘制效果不佳的控件,副芯片(14)可以请求主芯片(12)协助绘制,实现补齐副芯片(14)因为硬件能力不足,无法绘制复杂精细界面的缺陷。

Description

图元共享方法、电子设备、芯片及计算机可读存储介质
本申请要求于2021年08月23日提交中国专利局,申请号为202110970453.7、申请名称为“图元共享方法、电子设备、芯片及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及终端技术领域,尤其涉及一种图元共享方法、电子设备、芯片及计算机可读存储介质。
背景技术
目前市面上已经有了搭载了双芯片双系统的终端设备(如智能手表),一个操作系统相对较简单,搭载在功耗低、算力低的副芯片上,另外一个操作系统相对较复杂,搭载在功耗高、算力高的主芯片上。主、副芯片协同工作,可以同时兼顾设备性能与续航。
由于副芯片的硬件性能较差,绘制较复杂、精细的界面的效果较差。同时,由于副芯片算力有限,无法融合反锯齿算法,导致绘制的图形/文本时亦会出现锯齿。现有的解决方案一般是将一些复杂界面提前在主芯片侧绘制好并存储在终端设备,但如果终端设备需要支持多国语言,需提前绘制并存储多个版本的界面,从而导致占用终端设备过多的内存空间。
发明内容
有鉴于此,有必要提供一种图元共享方法,可以解决副芯片无法绘制复杂精细界面的缺陷。
本申请实施例第一方面公开了一种图元共享方法,应用于电子设备,电子设备包括主芯片、副芯片及显示屏。主芯片用于运行第一操作系统,副芯片用于运行第二操作系统。图元共享方法包括:当副芯片绘制界面内容时,副芯片获取与界面内容对应的控件集,控件集包括至少一个控件;副芯片根据控件集中每个控件所对应的绘制指令识别出不符合预设条件的第一类型控件;副芯片将第一类型控件所对应的绘制指令发送给主芯片进行绘制;副芯片获取主芯片的图元绘制结果;副芯片将本地图元绘制结果与主芯片的图元绘制结果进行合成,及将合成结果送显至显示屏,其中本地图元绘制结果由副芯片执行每个控件所对应的绘制指令绘制得到。
通过采用该技术方案,当副芯片在进行界面内容绘制时,对于绘制效果不佳的控件,副芯片可以请求主芯片协助绘制,实现补齐副芯片因为硬件能力不足,无法绘制复杂精细界面的缺陷。
在一种可能的实现方式中,图元共享方法还包括:副芯片调用UI绘图框架获取控件集中每个控件所对应的绘制指令。
通过采用该技术方案,副芯片可以调用UI绘图框架,例如UIkit框架,来实现获取每个控件所对应的绘制指令,进而识别出不符合预设条件的第一类型控件。
在一种可能的实现方式中,副芯片将第一类型控件所对应的绘制指令发送给主芯片进行绘制,包括:副芯片对不符合预设条件的控件进行标注,得到第一类型控件;副芯片将第一类型控件所对应的绘制指令发送给主芯片进行绘制。
通过采用该技术方案,副芯片可以对不符合预设条件的控件进行标注,进而可以将标注的控件委托给主芯片进行绘制。
在一种可能的实现方式中,电子设备还包括存储器,存储器用于存储主芯片的图元绘制结果,副芯片获取主芯片的图元绘制结果,包括:副芯片从存储器读取主芯片的图元绘制结果。
通过采用该技术方案,通过设置存储器来存储主芯片的图元绘制结果,使得副芯片可以从存储器读取主芯片的图元绘制结果,主芯片在完成委托的控件绘制后可以进入休眠状态。
在一种可能的实现方式中,副芯片根据控件集中每个控件所对应的绘制指令识别出不符合预设条件的第一类型控件,包括:当控件对应的绘制指令包含有预设指令时,副芯片将控件认定为所述第一类型控件。
通过采用该技术方案,根据副芯片的图元绘制性能预先定义预设指令,若某一控件的绘制指令包括预设指令,可以将控件认定为在副芯片侧绘制效果不佳的控件。
在一种可能的实现方式中,副芯片将本地图元绘制结果与主芯片的图元绘制结果进行合成,包括:副芯片将主芯片的图元绘制结果与本地图元绘制结果进行叠加合成;或副芯片将本地图元绘制结果中与第一类型控件对应的部分替换为主芯片的图元绘制结果。
通过采用该技术方案,可以实现将副芯片所绘制的本地图元与委托给主芯片绘制的图元进行合成,使得显示屏所显示的界面内容没有锯齿等缺陷,可实现补齐副芯片因为硬件能力不足,无法绘制复杂精细界面的缺陷。
第二方面,本申请实施例提供一种图元共享方法,应用于电子设备,电子设备包括主芯片、副芯片、存储器及显示屏。主芯片用于运行第一操作系统,副芯片用于运行第二操作系统。图元共享方法包括:当副芯片绘制界面内容时,副芯片获取与界面内容对应的控件集,控件集包括至少一个控件;副芯片根据控件集中每个控件所对应的绘制指令识别出不符合预设条件的第一类型控件;副芯片从存储器读取与第一类型控件对应的图元绘制结果;副芯片将本地图元绘制结果与从存储器读取的图元绘制结果进行合成,及将合成结果送显至显示屏,其中本地图元绘制结果由副芯片执行每个控件所对应的绘制指令绘制得到。
通过采用该技术方案,当副芯片在进行界面内容绘制时,对于绘制效果不佳的控件,副芯片可以尝试从存储器读取与这些绘制效果不佳的控件对应的图元,实现补齐副芯片因为硬件能力不足,无法绘制复杂精细界面的缺陷。
在一种可能的实现方式中,第二操作系统包括至少一个预置应用,图元共享方法还包括:主芯片获取副芯片绘制预置应用的界面内容所需的控件的集合;主芯片识别出集合中不符合预设条件的控件;主芯片执行集合中不符合预设条件的控件所对应的绘制指令,绘制得到多个共享图元;主芯片将多个共享图元存储至存储器。
通过采用该技术方案,通过主芯片预先识别在副芯片侧绘制效果不佳的控件,将这些绘制效果不佳的控件预先渲染成共享图元保存到存储器,使得后续副芯片在进行界面内容绘制时,可以尝试从存储器读取与这些绘制效果不佳的控件对应的图元。
在一种可能的实现方式中,图元共享方法还包括:当副芯片未能从存储器读取到与第一类型控件对应的图元绘制结果时,副芯片将第一类型控件中不具有图元绘制结果的控件所对 应的绘制指令发送给主芯片进行绘制;主芯片执行副芯片发送的绘制指令,及将绘制指令对应的图元绘制结果存储至存储器。
通过采用该技术方案,当副芯片在进行界面内容绘制时,对于绘制效果不佳的控件,若存储器不存在副芯片所需的共享图元,副芯片可以请求主芯片协助绘制,实现补齐副芯片因为硬件能力不足,无法绘制复杂精细界面的缺陷。
在一种可能的实现方式中,副芯片根据控件集中每个控件所对应的绘制指令识别出不符合预设条件的第一类型控件,包括:当控件所对应的绘制指令包含有预设指令时,副芯片将控件认定为第一类型控件。
通过采用该技术方案,根据副芯片的图元绘制性能预先定义预设指令,若某一控件的绘制指令包括预设指令,可以将控件认定为在副芯片侧绘制效果不佳的控件(第一类型控件)。
在一种可能的实现方式中,副芯片将本地图元绘制结果与从存储器读取的图元绘制结果进行合成,包括:副芯片将从存储器读取的图元绘制结果与本地图元绘制结果进行叠加合成;或副芯片将本地图元绘制结果中与第一类型控件对应的部分替换为从存储器读取的图元绘制结果。
通过采用该技术方案,可以实现将副芯片所绘制的本地图元与从存储器读取的的图元进行合成,使得显示屏所显示的界面内容没有锯齿等缺陷,可实现补齐副芯片因为硬件能力不足,无法绘制复杂精细界面的缺陷。
第三方面,本申请实施例提供一种电子设备,包括主芯片、副芯片、存储器及显示屏。主芯片运行第一操作系统,副芯片运行第二操作系统,第一操作系统包括第一图元共享服务程序及图元绘制程序,第二操作系统包括第二图元共享服务程序及第一应用程序。当第一应用程序绘制界面内容时,第一应用程序获取界面内容包含的共享图元,其中共享图元为在副芯片侧的绘制效果不符合预设要求的图元;第一应用程序通过第二图元共享服务程序与第一图元共享服务程序将共享图元的绘制请求发送给图元绘制程序;图元绘制程序响应共享图元的绘制请求,进行图元绘制;主芯片将图元绘制程序的图元绘制结果存储至存储器;副芯片将本地图元绘制结果与从存储器读取的图元绘制结果进行合成,及将合成结果送显至显示屏,其中本地图元绘制结果由第一应用程序绘制得到。
通过采用该技术方案,当副芯片在进行界面内容绘制时,对于绘制效果不佳的控件,副芯片可以请求主芯片协助绘制,实现补齐副芯片因为硬件能力不足,无法绘制复杂精细界面的缺陷。
在一种可能的实现方式中,存储器为第一显存,副芯片包括第二显存,第二显存用于存储本地图元绘制结果。
在一种可能的实现方式中,副芯片将本地图元绘制结果与从存储器读取的图元绘制结果进行叠加合成,或者副芯片将本地图元绘制结果中与共享图元对应的部分替换为从存储器读取的图元绘制结果。
通过采用该技术方案,可以实现将副芯片所绘制的本地图元与从存储器读取的的图元进行合成,使得显示屏所显示的界面内容没有锯齿等缺陷,可实现补齐副芯片因为硬件能力不足,无法绘制复杂精细界面的缺陷。
第四方面,本申请实施例提供一种计算机可读存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行如第一方面或第二方面所述的图元共享方法。
第五方面,本申请实施例提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行如第一方面或第二方面所述的图元共享方法。
第六方面,本申请实施例提供一种装置(如芯片),该装置具有实现上述第一方面或第二方面所提供的方法中副芯片行为的功能。功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块。
可以理解地,上述提供的第四方面所述的计算机可读存储介质,第五方面所述的计算机程序产品,第五方面所述的装置均与上述第一方面或第二方面的方法对应,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。
附图说明
图1为本申请一实施例提供的图元共享方法的应用场景示意图;
图2为本申请一实施例提供的电子设备实现图元共享的的硬件模块示意图;
图3为本申请一实施例提供的电子设备实现图元共享的软件架构示意图;
图4为本申请一实施例提供的电子设备进行表盘界面绘制的示意图;
图5为本申请一实施例提供的电子设备实现图元共享的内部数据交互示意图;
图6为本申请一实施例提供的图元共享方法的流程示意图;
图7为本申请另一实施例提供的图元共享方法的流程示意图;
图8为本申请实施例提供的一种可能的电子设备的结构示意图。
具体实施方式
需要说明的是,本申请中“至少一个”是指一个或者多个,“多个”是指两个或多于两个。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。本申请的说明书和权利要求书及附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不是用于描述特定的顺序或先后次序。
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。
为了便于理解,示例的给出了部分与本申请实施例相关的概念说明以供参考。
应用程序(application,APP),可以简称应用,为能够实现某项或多项特定功能的软件程序。通常,电子设备中可以安装多个应用,例如,即时通讯类应用、视频类应用、音频类应用、图像拍摄类应用、云桌面类应用等等。其中,即时通信类应用,例如可以包括短信应用、微信(WeChat)、WhatsApp Messenger、连我(Line)、照片分享(instagram)、Kakao Talk、钉钉等。图像拍摄类应用,例如可以包括相机应用(系统相机或第三方相机应用)。视频类应用,例如可以包括Youtube、Twitter、抖音、爱奇艺,腾讯视频等等。音频类应用,例如可以包括酷狗音乐、虾米、QQ音乐等等。以下实施例中提到的应用,可以是电子设备出厂时已安装的系统应用,也可以是用户在使用电子设备的过程中从网络下载或其他电子设备获取的第三方应用。
下面结合图1示例性的介绍本发明实施例提供的图元共享方法的应用场景图。
该实施例可应用于电子设备100。电子设备100可以是指具有显示屏的设备,例如电子设备100可以为智能手表、手机、平板电脑、智能家居等设备。电子设备100可以通过通信网络与其他电子设备或服务器进行通信。通信网络可以是局域网,也可以是通过中继(relay)设备转接的广域网,或者是局域网和广域网。当该通信网络为局域网时,示例性的,该通信网络可以是wifi热点网络、wifi P2P网络、蓝牙网络、zigbee网络或近场通信(near field communication,NFC)网络等近距离通信网络。当该通信网络为广域网时,示例性的,该通信网络可以是第三代移动通信技术(3rd-generation wireless telephone technology,3G)网络、第四代移动通信技术(the 4th generation mobile communication technology,4G)网络、第五代移动通信技术(5th-generation mobile communication technology,5G)网络、未来演进的公共陆地移动网络(public land mobile network,PLMN)或因特网等。
电子设备100可以搭载两个操作系统,该操作系统可以是
Figure PCTCN2022112769-appb-000001
或鸿蒙系统等。在图1中以电子设备100为智能手表为例进行说明,电子设备100包括显示屏10。显示屏10用于显示应用的显示界面,显示屏10可以是液晶显示屏(liquid crystal display,LCD)、有机发光二极管(organic light-emitting diode,OLED)显示屏、有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode,AMOLED)显示屏、柔性发光二极管(flex light-emitting diode,FLED)显示屏、量子点发光二极管(quantum dot light emitting diodes,QLED)显示屏等。
如图2所示,电子设备100包括显示屏10、主芯片12及副芯片14。主芯片12用于运行第一操作系统,副芯片14用于运行第二操作系统。副芯片14的性能低于主芯片12的性能,副芯片14的功耗低于主芯片12的功耗,通过主芯片12与副芯片14的协同工作,可以使得电子设备100同时兼顾高性能与高续航。
在一些实施例中,由于副芯片14的性能低于主芯片12的性能,副芯片14运行的第二操作系统可以是第一操作系统的轻量级版本。轻量级版本的操作系统不需要很高的硬件配置,可以运行在低功耗芯片上,但相对于第一操作系统,系统处理能力更弱,提供的系统功能相对更少。
在一些实施例中,主芯片12可以是中央处理器(central processing unit,CPU)、系统级芯片(System on Chip,SoC)、应用处理器(application processor,AP)等功耗高、芯片算力较强的处理芯片。副芯片14可以是微控制器(Microcontroller Unit,MCU)、单片机(Single Chip Microcomputer,SCM)等功耗低、芯片算力较弱的处理芯片。
例如,电子设备100为智能手表,电子设备100包括第一工作模式及第二工作模式。第一工作模式下,智能手表的所有功能开启,此时智能手表的功耗较高,主芯片12可以进行界面内容绘制,绘制结果可以送显至显示屏10。第二工作模式下,智能手表可仅开启一些常规功能(如心率监测、通知查看、简单表盘显示等),此时智能手表的功耗较低。在第二工作模式下,主芯片12处于休眠状态,由副芯片14运行的第二操作系统来实现这些常规功能。在第二工作模式下,由于副芯片14的芯片算力有限,副芯片14在进行界面内容绘制时,可能存在一些绘制效果不佳的控件,副芯片14可以将这些绘制效果不佳的控件委托给主芯片12进行绘制,副芯片14再将自身绘制结果与主芯片12的绘制结果进行合成,合成结果送显至显示屏10,可以避免副芯片14因为自身硬件性能较差,绘图出现锯齿等失真缺陷。主芯片12可以在完成控件的委托绘制之后继续进入休眠状态。
如图3所示,为本申请实施例提供的电子设备实现图元共享的架构示意图。
电子设备100包括显示屏10、主芯片12、副芯片14及第一显存16。主芯片12用于运行第一操作系统,副芯片14用于运行第二操作系统。主芯片12与副芯片14均具有第一显存16的读写权限。第一显存16用于存储共享给副芯片14的图元,例如,当主芯片12接收到副芯片14的图元绘制请求时,主芯片12可以响应该图元绘制请求进行图元绘制,并将绘制的图元存储至第一显存16,副芯片14可以从第一显存16读取其委托主芯片12绘制的图元。副芯片14还可以包括第二显存140,第二显存140用于存储副芯片14自身绘制的图元。第一显存16、第二显存140均可以是静态随机存取存储器(Static Random-Access Memory,SRAM)、同步动态随机存取存储器(Synchronous Dynamic Random Access Memory,SDRAM)、双倍速率的SDRAM(Double Data Rate SDRAM,DDR)等中的任意一种。在一些实施例中,第一显存16、第二显存140也可以是其他类型的存储器,在此不作限定。
第一操作系统可以包括第一图元共享服务程序121及图元绘制程序122,第二操作系统可以包括第二图元共享服务程序141、第一应用程序142及绘图服务程序143。第一应用程序142可以是电子设备100出厂时已安装的应用,也可以是用户在使用电子设备100的过程中从网络下载或其他电子设备获取的第三方应用。以下以第一应用程序142为表盘应用为例进行举例说明。
当第一应用程序142在前端显示时,第一应用程序142绘制表盘界面,第一应用程序142可以获取表盘界面包含的共享图元。共享图元可以是指在副芯片侧进行绘制的绘制效果不符合预设要求的图元。预设条件可以根据实际需求进行定义,例如预设条件可以是指在副芯片侧绘制得到的图元存在锯齿、清晰度不满足要求等。
在一些实施例中,第一应用程序142可以调用绘图服务程序143来绘制表盘界面,绘图服务程序143可以包括UI绘图框架,如UIkit框架。表盘界面可以被划分为多个图元,每个图元可以对应一个控件。绘图服务程序143可以将绘制得到的多个图元存储至第二显存140。
在一些实施例中,UI绘图框架可以识别控件所对应的绘制指令,当某一控件所对应的绘制指令包括预设指令时,可以认为该控件对应的图元为共享图元,认为该控件对应的图元在副芯片侧进行绘制的绘制效果不佳,需主芯片12协助绘制。预设指令可以根据副芯片14的图元绘制性能进行预先定义,例如副芯片14绘制弧形文本会产生锯齿,则可以将预设指令设定为包含弧形文本的绘制指令。
当对表盘界面的每个控件所对应的绘制指令进行分析之后,第一应用程序142可以获取表盘界面包含的共享图元,第一应用程序142将共享图元的绘制请求发送给第二图元共享服务程序141,第二图元共享服务程序141再将共享图元的绘制请求转发给第一图元共享服务程序121,实现主芯片12接收副芯片14发送的共享图元的绘制请求。
第一图元共享服务程序121可以将共享图元的绘制请求发送给图元绘制程序122,图元绘制程序122响应接收到的共享图元的绘制请求,进行共享图元绘制。由于主芯片12的性能较强,图元绘制程序122绘制得到的共享图元无锯齿。主芯片12可以将图元绘制程序122绘制的共享图元存储至第一显存16。副芯片14可以从第一显存16读取主芯片12绘制的共享图元。
在一些实施例中,共享图元的绘制请求可以包括共享图元对应的绘制指令,进而图元绘制程序122可以执行共享图元对应的绘制指令,进行共享图元绘制。
副芯片14可以将第二显存140存储的多个图元与从第一显存16读取的共享图元进行合 成,及将合成结果送显至显示屏10进行解码显示。例如,副芯片14可以在第二显存140中进行本地图元(绘图服务程序143绘制的图元)与共享图元的合成。
在一些实施例中,当主芯片12将图元绘制程序122绘制的共享图元存储至第一显存16时,主芯片12可以发送绘制完成消息至副芯片14,以提示副芯片14共享图元已绘制完成。
在一些实施例中,绘图服务程序143绘制得到的多个图元是可以构成一个完整的表盘界面,但绘图服务程序143绘制得到的部分图元存在锯齿。副芯片14可以将第二显存140存储的多个图元与从第一显存16读取的共享图元进行叠加合成,使得最终合成得到的表盘界面不存在锯齿。
在一些实施例中,副芯片14也可以将第二显存140存储的多个图元中存在锯齿的图元替换为从第一显存16读取的共享图元,使得最终合成得到的表盘界面不存在锯齿。
在一些实施例中,对于安装在第二操作系统的预置应用,可以由主芯片12预先识别该预置应用的界面在副芯片侧绘制效果不佳的控件,这些绘制效果不佳的控件可以由主芯片12标注出来,主芯片12可以将这些标注出来的控件预渲染成共享图元保存到第一显存16。副芯片14在进行界面内容绘制时,可以尝试用第一显存16中存储的共享图元来替换绘制效果不佳的图元。若第一显存16中不存在副芯片14所需的共享图元,副芯片14可以再委托主芯片12进行图元绘制。
如图4所示,以表盘界面I1为例,表盘界面I1为第二操作系统的预置表盘应用的界面。表盘界面I1可以划分为多个图元,每个图元可以对应一个控件。主芯片16可以获取绘制表盘界面I1所需的控件集,例如表盘界面I1的绘制涉及包括第一控件c1、第二控制c2、第三控件c3、第四控件c4、第五控件c5及第六控件c6。主芯片12可以识别第一至第六控件c1~c6中是否存在在副芯片14侧绘制效果不佳的控件。假设第一控件c1与第六控件c6为在副芯片14侧绘制效果不佳的控件,则主芯片12可以预先执行第一控件c1与第六控件c6对应的绘制指令,得到共享图元I11、I12。主芯片16可以将绘制得到的共享图元I11、I12存储至第一显存16。
当副芯片14在进行表盘界面I1的绘制时,副芯片14可以获取绘制表盘界面I1所需的控件集。副芯片14可以识别控件集中所包含的绘制效果不佳的控件。副芯片14可以执行第一至第六控件c1~c6所对应的绘制指令,得到多个本地图元,多个本地图元可以存储至第二显存140。副芯片14可以尝试从第一显存16读取与绘制效果不佳的控件对应的共享图元,及将本地图元与共享图元进行叠加合成,合成结果再送显至显示屏10。
在一些实施例中,若第一显存16中不存在与绘制效果不佳的控件对应的共享图元,副芯片14可以请求主芯片12进行共享图元绘制。
参照图5所示,为本申请一实施例提供的电子设备各功能模块的数据交互示意图。
为便于下文描述,在下文所述的应用场景中,电子设备100包括显示屏10、主芯片12、副芯片14及第一显存16。主芯片12用于运行第一操作系统,副芯片14用于运行第二操作系统。副芯片14包括第二显存140。第一操作系统包括第一图元共享服务程序121及图元绘制程序122,第二操作系统包括第二图元共享服务程序141、第一应用程序142及绘图服务程序143。
501、当第一应用程序142进行界面内容绘制时,第一应用程序142发送界面绘制请求至绘图服务程序143。
502、绘图服务程序143进行界面内容绘制,及将绘制得到的本地图元存储至第二显存 140。
在一些实施例中,绘图服务程序143可以包括UI绘图框架,如UIkit框架。绘图服务程序143可以获取绘制界面内容所需的控件集。绘图服务程序143再执行控件集中每个控件对应的绘制指令,绘制得到的多个图元(本地图元)。该多个本地图元存储至第二显存140。
503、第一应用程序142获取界面内容包含的共享图元,将共享图元的绘制请求发送给第二图元共享服务程序141。
在一些实施例中,UI绘图框架可以识别控件所对应的绘制指令,当某一控件所对应的绘制指令包括预设指令时,可以认为该控件对应的图元为共享图元。当对控件集中的每个控件所对应的绘制指令进行分析之后,第一应用程序142可以获取界面内容包含的共享图元。
在一些实施例中,共享图元可以认为是该控件对应的图元在副芯片侧进行绘制的绘制效果不佳,需主芯片12协助绘制的图元。预设指令可以根据副芯片14的图元绘制性能进行预先定义,例如副芯片14绘制弧形文本会产生锯齿,则可以将预设指令设定为包含弧形文本的绘制指令。
504、第二图元共享服务程序141将共享图元的绘制请求发送给第一图元共享服务程序121。
505、第一图元共享服务程序121将共享图元的绘制请求发送给图元绘制程序122。
506、图元绘制程序122响应共享图元的绘制请求,进行共享图元绘制。
507、图元绘制程序122将绘制得到的共享图元存储至第一显存16。
508、图元绘制程序122发送共享图元绘制完成消息至第一图元共享服务程序121。
509、第一图元共享服务程序121发送共享图元绘制完成消息至第二图元共享服务程序141。
510、第二图元共享服务程序141发送共享图元绘制完成消息至绘图服务程序143。
511、绘图服务程序143将第二显存140存储的本地图元与第一显存16存储的共享图元进行叠加合成。
512、绘图服务程序143将合成结果送显至显示屏10进行解码显示。
参照图6所示,本申请实施例提供的一种图元共享方法,应用于电子设备100。电子设备100包括显示屏10、主芯片12及副芯片14。主芯片12用于运行第一操作系统,副芯片14用于运行第二操作系统。本实施例中,图元共享方法可以包括:
61、当副芯片14绘制界面内容时,副芯片14获取与界面内容对应的控件集。
在一些实施例中,控件集可以包括至少一个控件。第二操作系统可以包括UI绘图框架,UI绘图框架可以根据界面内容生成绘制该界面内容所需的控件集。即副芯片14可以通过UI绘图框架来获取与界面内容对应的控件集。
62、副芯片14根据控件集中每个控件所对应的绘制指令识别出不符合预设条件的第一类型控件。
在一些实施例中,预设条件可以根据实际需求进行定义,例如预设条件可以是指在副芯片侧绘制得到的图元存在锯齿、清晰度不满足要求等缺陷。UI绘图框架可以识别控件集中每个控件所对应的绘制指令,当某一控件所对应的绘制指令包括预设指令时,可以认为该控件对应的图元在副芯片侧进行绘制的绘制效果不佳,需主芯片12协助绘制,该控件被认为是第一类型控件。预设指令可以根据副芯片14的图元绘制性能进行预先定义,例如副芯片14绘制弧形文本会产生锯齿,则可以将预设指令设定为包含弧形文本的绘制指令。当UI绘图框架 识别到某个控件的绘制指令包括弧形文本的绘制指令,该控件被认为是不符合预设条件的第一类型控件。
在一些实施例中,副芯片14还可以对不符合预设条件的控件进行标注,该标注的控件即为第一类型控件,便于后续将第一类型控件所对应的绘制指令发送给主芯片12。
63、副芯片14将第一类型控件所对应的绘制指令发送给主芯片12进行绘制。
在一些实施例中,主芯片12可以是CPU、SoC、AP等功耗高、芯片算力较强的处理芯片。副芯片14可以是MCU、SCM等功耗低、芯片算力较弱的处理芯片。由于主芯片12的芯片性能强于副芯片14的芯片性能,副芯片14将第一类型控件所对应的绘制指令发送给主芯片12进行绘制,可以避免出现锯齿等缺陷。
64、副芯片14获取主芯片12的图元绘制结果。
在一些实施例中,电子设备100还可以包括第一显存16,主芯片12与副芯片14均具有第一显存16的读取权限。主芯片12可以将图元绘制结果存储至第一显存16,副芯片14从第一显存16读取主芯片12的图元绘制结果。在其他实施例中,主芯片12也可以将图元绘制结果发送给副芯片14。
65、副芯片14将本地图元绘制结果与主芯片12的图元绘制结果进行合成,及将合成结果送显至显示屏10。
在一些实施例中,本地图元绘制结果可以是指由副芯片14执行控件集中每个控件所对应的绘制指令绘制得到的图元。
在一些实施例中,副芯片14的本地图元绘制结果是可以构成一个完整的界面内容,但合成得到的界面内容存在锯齿。副芯片14可以将本地图元绘制结果与主芯片12的图元绘制结果进行叠加合成,使得最终合成得到的界面内容不存在锯齿。
在一些实施例中,副芯片14也可以将本地图元绘制结果中存在锯齿的图元替换为主芯片12的图元绘制结果,使得最终合成得到的界面内容不存在锯齿。
上述图元共享方法,当副芯片在进行界面内容绘制时,对于绘制效果不佳的控件,副芯片可以请求主芯片协助绘制,实现补齐副芯片因为硬件能力不足,无法绘制复杂精细界面的缺陷。
参照图7所示,本申请实施例提供的一种图元共享方法,应用于电子设备100。电子设备100包括显示屏10、主芯片12、副芯片14及第一显存16。主芯片12用于运行第一操作系统,副芯片14用于运行第二操作系统。本实施例中,图元共享方法可以包括:
71、当副芯片14绘制界面内容时,副芯片14获取与界面内容对应的控件集。
在一些实施例中,控件集可以包括至少一个控件。第二操作系统可以包括UI绘图框架,UI绘图框架可以根据界面内容生成绘制该界面内容所需的控件集。即副芯片14可以通过UI绘图框架来获取与界面内容对应的控件集。
72、副芯片14根据控件集中每个控件所对应的绘制指令识别出不符合预设条件的第一类型控件。
在一些实施例中,预设条件可以根据实际需求进行定义,例如预设条件可以是指在副芯片侧绘制得到的图元存在锯齿、清晰度不满足要求等缺陷。当某一控件所对应的绘制指令包括预设指令时,可以认为该控件是第一类型控件。预设指令可以根据副芯片14的图元绘制性能进行预先定义,例如副芯片14绘制弧形文本会产生锯齿,则可以将预设指令设定为包含弧形文本的绘制指令。
73、副芯片14从第一显存16读取与第一类型控件对应的图元绘制结果。
在一些实施例中,第一显存16可以是SRAM、SDRAM、DDR等中的任意一种。第一显存16也可以根据实际应用场景选择其他类型的存储器。主芯片12可以在电子设备100上电后,识别在副芯片侧绘制效果不佳的控件。这些绘制效果不佳的控件可以由主芯片12标注出来,主芯片12可以将这些标注出来的控件进行预先绘制,绘制结果存储至第一显存16,进而副芯片14可以尝试从第一显存16读取与第一类型控件对应的图元绘制结果。
在一些实施例中,对于安装在第二操作系统的预置应用,可以由主芯片12预先识别该预置应用的界面在副芯片侧绘制效果不佳的控件,这些绘制效果不佳的控件可以由主芯片12标注出来,主芯片12可以将这些标注出来的控件预渲染成共享图元保存到第一显存16。副芯片14在进行界面内容绘制时,可以尝试用第一显存16中存储的共享图元来替换绘制效果不佳的图元。如果第一显存16中不存在副芯片14所需的共享图元,副芯片14可以再委托主芯片12进行图元绘制,后续副芯片14再从第一显存16读取与第一类型控件对应的图元绘制结果。
74、副芯片14将本地图元绘制结果与从第一显存16读取的图元绘制结果进行合成,及将合成结果送显至显示屏10。
在一些实施例中,本地图元绘制结果可以是指由副芯片14执行控件集中每个控件所对应的绘制指令绘制得到的图元。副芯片14的本地图元绘制结果是可以构成一个完整的界面内容,但合成得到的界面内容存在锯齿。副芯片14可以将本地图元绘制结果与从第一显存16读取的图元绘制结果进行叠加合成,使得最终合成得到的界面内容不存在锯齿。
在一些实施例中,副芯片14也可以将本地图元绘制结果中存在锯齿的图元替换为从第一显存16读取的图元绘制结果,使得最终合成得到的界面内容不存在锯齿。
上述图元共享方法,当副芯片在进行界面内容绘制时,对于绘制效果不佳的控件,副芯片可以尝试从第一显存读取主芯片预先绘制的图元,若第一显存不存在副芯片所需的图元,副芯片可以请求主芯片协助绘制,实现补齐副芯片因为硬件能力不足,无法绘制复杂精细界面的缺陷。
参考图8,为本申请一实施例提供的电子设备100的硬件结构示意图。如图8所示,电子设备100可以包括屏幕1001、第一处理器1002、第二处理器1003、存储器1004及通信总线1005。存储器1004用于存储一个或多个计算机程序1006。一个或多个计算机程序1006被配置为被该第二处理器1003执行。该一个或多个计算机程序1006包括指令,第二处理器1003执行上述指令可以实现在电子设备100中执行上述图元共享方法。
可以理解的是,本实施例示意的结构并不构成对电子设备100的具体限定。在另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。
第一处理器1002与第二处理器1003均可以包括一个或多个处理单元,例如:第一处理器1002与第二处理器1003均可以包括调制解调器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
第一处理器1002与第二处理器1003还均可以设置有存储器,用于存储指令和数据。在一些实施例中,第一处理器1002与第二处理器1003中的存储器为高速缓冲存储器。该存储器可以保存第一处理器1002或第二处理器1003刚用过或循环使用的指令或数据。如果第一处理器1002与第二处理器1003需要再次使用该指令或数据,可从该存储器中直接调用。避免了重复存取,减少了第一处理器1002与第二处理器1003的等待时间,因而提高了系统的效率。
在一些实施例中,第一处理器1002与第二处理器1003均可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,SIM接口,和/或USB接口等。
在一些实施例中,存储器1004可以包括高速随机存取存储器,还可以包括非易失性存储器,例如硬盘、内存、插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)、至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。
本实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述相关方法步骤实现上述实施例中的图元共享方法。
本实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的图元共享方法。
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中的图元共享方法。
其中,本实施例提供的电子设备、计算机存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,该模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
该作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多 个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
该集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。

Claims (16)

  1. 一种图元共享方法,应用于电子设备,所述电子设备包括主芯片、副芯片及显示屏,其特征在于,所述主芯片用于运行第一操作系统,所述副芯片用于运行第二操作系统,所述图元共享方法包括:
    当所述副芯片绘制界面内容时,所述副芯片获取与所述界面内容对应的控件集,所述控件集包括至少一个控件;
    所述副芯片根据所述控件集中每个控件所对应的绘制指令识别出不符合预设条件的第一类型控件;
    所述副芯片将所述第一类型控件所对应的绘制指令发送给所述主芯片进行绘制;
    所述副芯片获取所述主芯片的图元绘制结果;
    所述副芯片将本地图元绘制结果与所述主芯片的图元绘制结果进行合成,及将合成结果送显至所述显示屏,其中,所述本地图元绘制结果由所述副芯片执行所述每个控件所对应的绘制指令绘制得到。
  2. 如权利要求1所述的图元共享方法,其特征在于,所述图元共享方法还包括:
    所述副芯片调用UI绘图框架获取所述控件集中每个控件所对应的绘制指令。
  3. 如权利要求1或2所述的图元共享方法,其特征在于,所述副芯片将所述第一类型控件所对应的绘制指令发送给所述主芯片进行绘制,包括:
    所述副芯片对不符合所述预设条件的控件进行标注,得到所述第一类型控件;
    所述副芯片将所述第一类型控件所对应的绘制指令发送给所述主芯片进行绘制。
  4. 如权利要求3所述的图元共享方法,其特征在于,所述电子设备还包括存储器,所述存储器用于存储所述主芯片的图元绘制结果,所述副芯片获取所述主芯片的图元绘制结果,包括:
    所述副芯片从所述存储器读取所述主芯片的图元绘制结果。
  5. 如权利要求1至4中任意一项所述的图元共享方法,其特征在于,所述副芯片根据所述控件集中每个控件所对应的绘制指令识别出不符合预设条件的第一类型控件,包括:
    当所述控件对应的绘制指令包含有预设指令时,所述副芯片将所述控件认定为所述第一类型控件。
  6. 如权利要求1至5中任意一项所述的图元共享方法,其特征在于,所述副芯片将本地图元绘制结果与所述主芯片的图元绘制结果进行合成,包括:
    所述副芯片将所述主芯片的图元绘制结果与所述本地图元绘制结果进行叠加合成;或
    所述副芯片将所述本地图元绘制结果中与所述第一类型控件对应的部分替换为所述主芯片的图元绘制结果。
  7. 一种图元共享方法,应用于电子设备,所述电子设备包括主芯片、副芯片、存储器及显示屏,其特征在于,所述主芯片用于运行第一操作系统,所述副芯片用于运行第二操作系统,所述图元共享方法包括:
    当所述副芯片绘制界面内容时,所述副芯片获取与所述界面内容对应的控件集,所述控件集包括至少一个控件;
    所述副芯片根据所述控件集中每个控件所对应的绘制指令识别出不符合预设条件的第一 类型控件;
    所述副芯片从所述存储器读取与所述第一类型控件对应的图元绘制结果;
    所述副芯片将本地图元绘制结果与从所述存储器读取的图元绘制结果进行合成,及将合成结果送显至所述显示屏,其中,所述本地图元绘制结果由所述副芯片执行所述每个控件所对应的绘制指令绘制得到。
  8. 如权利要求7所述的图元共享方法,其特征在于,所述第二操作系统包括至少一个预置应用,所述图元共享方法还包括:
    所述主芯片获取所述副芯片绘制所述预置应用的界面内容所需的控件的集合;
    所述主芯片识别出所述集合中不符合所述预设条件的控件;
    所述主芯片执行所述集合中不符合所述预设条件的控件所对应的绘制指令,绘制得到多个共享图元;
    所述主芯片将所述多个共享图元存储至所述存储器。
  9. 如权利要求7或8所述的图元共享方法,其特征在于,所述图元共享方法还包括:
    当所述副芯片未能从所述存储器读取到与所述第一类型控件对应的图元绘制结果时,所述副芯片将所述第一类型控件中不具有图元绘制结果的控件所对应的绘制指令发送给所述主芯片进行绘制;
    所述主芯片执行所述副芯片发送的绘制指令,及将所述绘制指令对应的图元绘制结果存储至所述存储器。
  10. 如权利要求7至9中任意一项所述的图元共享方法,其特征在于,所述副芯片根据所述控件集中每个控件所对应的绘制指令识别出不符合预设条件的第一类型控件,包括:
    当所述控件所对应的绘制指令包含有预设指令时,所述副芯片将所述控件认定为所述第一类型控件。
  11. 如权利要求7至10中任意一项所述的图元共享方法,其特征在于,所述副芯片将本地图元绘制结果与从所述存储器读取的图元绘制结果进行合成,包括:
    所述副芯片将从所述存储器读取的图元绘制结果与所述本地图元绘制结果进行叠加合成;或
    所述副芯片将所述本地图元绘制结果中与所述第一类型控件对应的部分替换为从所述存储器读取的图元绘制结果。
  12. 一种电子设备,包括主芯片、副芯片、存储器及显示屏,其特征在于,所述主芯片用于运行第一操作系统,所述副芯片用于运行第二操作系统,所述第一操作系统包括第一图元共享服务程序及图元绘制程序,所述第二操作系统包括第二图元共享服务程序及第一应用程序;
    当所述第一应用程序绘制界面内容时,所述第一应用程序获取所述界面内容包含的共享图元,其中所述共享图元为在所述副芯片侧的绘制效果不符合预设要求的图元;
    所述第一应用程序通过所述第二图元共享服务程序与所述第一图元共享服务程序将所述共享图元的绘制请求发送给所述图元绘制程序;
    所述图元绘制程序响应所述共享图元的绘制请求,进行图元绘制;
    所述主芯片将所述图元绘制程序的图元绘制结果存储至所述存储器;
    所述副芯片将本地图元绘制结果与从所述存储器读取的图元绘制结果进行合成,及将合成结果送显至所述显示屏,其中所述本地图元绘制结果由所述第一应用程序绘制得到。
  13. 如权利要求12所述的电子设备,其特征在于,所述存储器为第一显存,所述副芯片包括第二显存,所述第二显存用于存储所述本地图元绘制结果。
  14. 如权利要求12或13所述的电子设备,其特征在于,所述副芯片将所述本地图元绘制结果与从所述存储器读取的图元绘制结果进行叠加合成,或者所述副芯片将所述本地图元绘制结果中与所述共享图元对应的部分替换为从所述存储器读取的图元绘制结果。
  15. 一种计算机可读存储介质,其特征在于,包括计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如权利要求1至权利要求11中任一项所述的图元共享方法。
  16. 一种芯片,与电子设备中的存储器耦合,其特征在于,所述芯片用于控制所述电子设备执行权利要求1至权利要求11中任一项所述的图元共享方法。
PCT/CN2022/112769 2021-08-23 2022-08-16 图元共享方法、电子设备、芯片及计算机可读存储介质 WO2023024972A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110970453.7A CN115713452A (zh) 2021-08-23 2021-08-23 图元共享方法、电子设备、芯片及计算机可读存储介质
CN202110970453.7 2021-08-23

Publications (1)

Publication Number Publication Date
WO2023024972A1 true WO2023024972A1 (zh) 2023-03-02

Family

ID=85230346

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/112769 WO2023024972A1 (zh) 2021-08-23 2022-08-16 图元共享方法、电子设备、芯片及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN115713452A (zh)
WO (1) WO2023024972A1 (zh)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105718311A (zh) * 2015-07-09 2016-06-29 北京海誉动想科技股份有限公司 智能系统及其实现方法、和用于智能设备的外设
US20160317101A1 (en) * 2015-04-29 2016-11-03 Yongqiang Li Athletic performance monitoring display system and method
US20170032787A1 (en) * 2014-01-14 2017-02-02 Toyota Motor Engineering & Manufacturing North America, Inc. Smart necklace with stereo vision and onboard processing
CN110189665A (zh) * 2019-05-30 2019-08-30 Oppo广东移动通信有限公司 控制方法、穿戴设备和存储介质
CN110851062A (zh) * 2019-08-29 2020-02-28 华为技术有限公司 一种绘图方法及电子设备
CN112639731A (zh) * 2018-07-24 2021-04-09 奇跃公司 应用共享
CN112987986A (zh) * 2019-12-02 2021-06-18 Oppo广东移动通信有限公司 实现游戏应用的方法、装置、存储介质及电子设备

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170032787A1 (en) * 2014-01-14 2017-02-02 Toyota Motor Engineering & Manufacturing North America, Inc. Smart necklace with stereo vision and onboard processing
US20160317101A1 (en) * 2015-04-29 2016-11-03 Yongqiang Li Athletic performance monitoring display system and method
CN105718311A (zh) * 2015-07-09 2016-06-29 北京海誉动想科技股份有限公司 智能系统及其实现方法、和用于智能设备的外设
CN112639731A (zh) * 2018-07-24 2021-04-09 奇跃公司 应用共享
CN110189665A (zh) * 2019-05-30 2019-08-30 Oppo广东移动通信有限公司 控制方法、穿戴设备和存储介质
CN110851062A (zh) * 2019-08-29 2020-02-28 华为技术有限公司 一种绘图方法及电子设备
CN112987986A (zh) * 2019-12-02 2021-06-18 Oppo广东移动通信有限公司 实现游戏应用的方法、装置、存储介质及电子设备

Also Published As

Publication number Publication date
CN115713452A (zh) 2023-02-24

Similar Documents

Publication Publication Date Title
US20240020074A1 (en) Multi-Window Projection Method and Electronic Device
US9304813B2 (en) CPU independent graphics scheduler for performing scheduling operations for graphics hardware
WO2021121052A1 (zh) 一种多屏协同方法、系统及电子设备
WO2020173371A1 (zh) 一种图形绘制方法和电子设备
US10241932B2 (en) Power saving method and apparatus for first in first out (FIFO) memories
EP4020210A1 (en) Multi-thread synchronization method and electronic device
EP3971818A1 (en) Picture processing method and apparatus
JP2013521581A (ja) 多重プロセッサを用いて状態情報を失わずにビデオ及び/又はグラフィクスデータを処理するための方法、システム及び装置
US20160247306A1 (en) Apparatus and method for controlling display in electronic device having processors
US10558496B2 (en) Techniques for accessing a graphical processing unit memory by an application
EP3779690A1 (en) Processor core scheduling method and apparatus, terminal, and storage medium
CN113064727B (zh) 应用于Android系统的图像显示调度方法、终端及存储介质
WO2022083465A1 (zh) 电子设备的投屏方法及其介质和电子设备
WO2023001163A1 (zh) 一种可提升动效性能的屏幕刷新方法及设备
WO2022052828A1 (zh) 获取应用的下载信息的方法、系统、服务器以及存储介质
US20150063337A1 (en) Method for controlling transmission speed and electronic device thereof
CN115016631A (zh) 进程调度方法和终端设备
WO2023024972A1 (zh) 图元共享方法、电子设备、芯片及计算机可读存储介质
WO2023005751A1 (zh) 渲染方法及电子设备
CN112114965A (zh) 应用程序的运行方法、装置、终端及存储介质
CN113760192A (zh) 数据读取方法、装置、存储介质和程序产品
WO2024055867A1 (zh) 基于应用分身的界面显示方法及相关装置
US20240095990A1 (en) Display method and electronic device
WO2024046088A1 (zh) 任务调度方法及相关设备
EP4296845A1 (en) Screen projection method and system, and related apparatus

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: 22860318

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2022860318

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2022860318

Country of ref document: EP

Effective date: 20240228