CN110609669A - Interface processing method and device, storage medium and electronic equipment - Google Patents

Interface processing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN110609669A
CN110609669A CN201910824689.2A CN201910824689A CN110609669A CN 110609669 A CN110609669 A CN 110609669A CN 201910824689 A CN201910824689 A CN 201910824689A CN 110609669 A CN110609669 A CN 110609669A
Authority
CN
China
Prior art keywords
target
pixel
color information
interface
format
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN201910824689.2A
Other languages
Chinese (zh)
Inventor
李杨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oppo Chongqing Intelligent Technology Co Ltd
Original Assignee
Oppo Chongqing Intelligent Technology Co Ltd
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 Oppo Chongqing Intelligent Technology Co Ltd filed Critical Oppo Chongqing Intelligent Technology Co Ltd
Priority to CN201910824689.2A priority Critical patent/CN110609669A/en
Publication of CN110609669A publication Critical patent/CN110609669A/en
Pending legal-status Critical Current

Links

Classifications

    • 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/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/1407General aspects irrespective of display type, e.g. determination of decimal point position, display with fixed or driving decimal point, suppression of non-significant zeros
    • 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

Abstract

The application discloses an interface processing method, an interface processing device, a storage medium and electronic equipment. The method comprises the following steps: when a target interface needs to be displayed, acquiring pixel data corresponding to the target interface; determining a first format of the pixel data, and a second format supported by a display driver; when the first format is not matched with the second format, converting the pixel data from the first format to the second format to obtain target pixel data; and generating and displaying the target interface based on the target pixel data and the display drive. The method and the device can avoid more code flow changes, thereby reducing workload.

Description

Interface processing method and device, storage medium and electronic equipment
Technical Field
The present application relates to the field of electronic technologies, and in particular, to an interface processing method and apparatus, a storage medium, and an electronic device.
Background
When the Android version or the chip platform is updated, the updating of the bottom layer display driver is also accompanied. For some interfaces drawn by using the old framework interface, the interfaces may not be compatible with the updated display driver, so that the interfaces cannot be displayed in the updated Android version or the chip platform. At present, aiming at the problem, the adopted mode is to adopt a new frame interface, namely, the frame interface compatible with the updated display driver can be used for realizing the drawing of the whole interface again. However, if some special interfaces, such as rendering of a Recovery mode interface, are implemented in the above manner, more code flow changes may be caused, and thus, the workload may be increased.
Disclosure of Invention
The embodiment of the application provides an interface processing method, an interface processing device, a storage medium and an electronic device, which can avoid more code flow changes, thereby reducing the workload.
The embodiment of the application provides an interface processing method, which is applied to electronic equipment, wherein the electronic equipment comprises a display driver and comprises the following steps:
when a target interface needs to be displayed, acquiring pixel data corresponding to the target interface;
determining a first format of the pixel data, and a second format supported by a display driver;
when the first format is not matched with the second format, converting the pixel data from the first format to the second format to obtain target pixel data;
and generating and displaying the target interface based on the target pixel data and the display drive.
An embodiment of the present application provides an interface processing apparatus, which is applied to an electronic device, where the electronic device includes a display driver, including:
the acquisition module is used for acquiring pixel data corresponding to a target interface when the target interface needs to be displayed;
a determining module for determining a first format of the pixel data and a second format supported by a display driver;
the conversion module is used for converting the pixel data from the first format to the second format to obtain target pixel data when the first format is not matched with the second format;
and the display module is used for generating and displaying the target interface based on the target pixel data and the display drive.
The embodiment of the present application provides a storage medium, on which a computer program is stored, and when the computer program is executed on a computer, the computer is caused to execute the flow in the interface processing method provided by the embodiment of the present application.
The embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the processor is configured to execute the flow in the interface processing method provided in the embodiment of the present application by calling the computer program stored in the memory.
In the embodiment of the application, when the first format of the pixel data obtained by drawing the target interface by using the old frame interface is not matched with the second format supported by the updated display driver, the display driver cannot successfully read the pixel data to display the target interface, so that the pixel data can be converted from the first format to the second format to obtain the target pixel data when the first format is not matched with the second format. Because the format of the target pixel data matches the format supported by the updated display driver, the display driver can successfully read the pixel data to display the target interface. As can be seen from the above, in the embodiment of the present application, even if the old framework interface is used to draw the target interface, the interface processing method provided in the embodiment of the present application can also successfully display the target interface. The interface processing method provided by the embodiment of the application can still adopt the old framework interface to realize the drawing of the target interface, so that the change of more code flows can be avoided, and the workload can be reduced.
Drawings
The technical solutions and advantages of the present application will become apparent from the following detailed description of specific embodiments of the present application when taken in conjunction with the accompanying drawings.
Fig. 1 is a first flowchart illustrating an interface processing method according to an embodiment of the present application.
Fig. 2 is a second flowchart of the interface processing method according to the embodiment of the present application.
Fig. 3 is a third schematic flow chart of an interface processing method according to an embodiment of the present application.
Fig. 4 is a fourth flowchart illustrating an interface processing method according to an embodiment of the present application.
Fig. 5 is a schematic structural diagram of an interface processing apparatus according to an embodiment of the present application.
Fig. 6 is a schematic structural diagram of a first electronic device according to an embodiment of the present application.
Fig. 7 is a schematic structural diagram of a second electronic device according to an embodiment of the present application.
Detailed Description
Referring to the drawings, wherein like reference numbers refer to like elements, the principles of the present application are illustrated as being implemented in a suitable computing environment. The following description is based on illustrated embodiments of the application and should not be taken as limiting the application with respect to other embodiments that are not detailed herein.
It is understood that the execution subject of the embodiment of the present application may be an electronic device such as a smart phone or a tablet computer.
Referring to fig. 1, fig. 1 is a first flowchart illustrating an interface processing method according to an embodiment of the present disclosure, where the interface processing method is applicable to an electronic device, the electronic device may include a display driver, and a flow of the interface processing method may include:
101. and when the target interface needs to be displayed, acquiring pixel data corresponding to the target interface.
For example, the user may cause the electronic device to enter the recovery mode by triggering a pressing operation of a preset key. When the electronic device is in the recovery mode, the electronic device needs to display an initial interface of the recovery mode (i.e., a first interface displayed when the electronic device enters the recovery mode), and the initial interface may be a target interface. Or, the user performs a click operation on the current interface, and if a certain virtual key displayed on the current interface is clicked, the electronic device enters a next interface corresponding to the virtual key, that is, the electronic device needs to display the next interface, which is a target interface.
The Recovery mode is a mode which is provided by the electronic equipment based on the Android system and can modify data or a system in the electronic equipment. After the electronic device enters the Recovery mode, the electronic device can be restored to factory settings, a system of the electronic device can be upgraded, the electronic device can be refreshed, and the like.
For example, when the target interface needs to be displayed, the electronic device may obtain pixel data corresponding to the target interface. For example, the electronic device may first determine an element corresponding to the target interface, a type of the element, and a location where the element is located. For example, the electronic device may determine which icons, text, or graphics, etc. need to be displayed by the target interface, the location of the icons, text, or graphics (i.e., where they need to be displayed), and which icons, which types, sizes, text, and graphics are the icons. After the electronic device determines the element corresponding to the target interface, the type of the element, and the position of the element, the electronic device may draw the target interface to obtain pixel data corresponding to the target interface.
For example, the electronic device may draw the target interface by using a framebuffer layer frame interface to obtain pixel data corresponding to the target interface. Or, the electronic device may draw the target interface by using a mini layer frame interface to obtain pixel data corresponding to the target interface.
102. A first format of pixel data is determined, and a second format supported by the display driver.
For example, after acquiring the pixel data corresponding to the target interface, the electronic device may determine a first format of the pixel data and a second format supported by the display driver.
The display driver can translate the pixel data into a form recognized by the display card, so that the target interface can be successfully displayed by the display screen. Each type of display driver has its own data format, i.e. the display driver recognizes only fixed pixel data in several formats.
It should be noted that formats of pixel data obtained by drawing the target interface by using different layer-frame interfaces may also be different. In the related art, it is usually required to make a layer frame interface consistent with a format supported by a display driver, so that an interface drawn by using the layer frame interface can be successfully displayed. Therefore, in the related art, when the display driver is updated to the display driver with a new format and cannot support the format of the pixel data obtained by the old layer frame interface, the new layer frame interface is adopted to re-draw the whole interface, so as to obtain the pixel data in the format supported by the new display driver. However, for some special interfaces, such as interfaces implemented in C language, when the interfaces are drawn, each pixel point in a plurality of pixel points corresponding to the interfaces needs to be drawn. For example, if the interface corresponds to 100 pixels, 100 times of rendering is required. In terms of code level, updating an old graph layer framework interface to a new graph layer framework interface can cause more code flow changes, thereby greatly increasing the workload.
In this embodiment, even if the display driver is updated to a display driver in a new format, the target interface may still be drawn by using the old layer frame to obtain the pixel data corresponding to the target interface. Pixel data resulting from rendering a target interface using an old layer frame can be identified by the display driver. Therefore, after obtaining the pixel data corresponding to the target interface, the electronic device may determine the format of the pixel data, i.e., the first format, and determine the format supported by the display driver, i.e., the second format.
103. And when the first format is not matched with the second format, converting the pixel data from the first format to the second format to obtain target pixel data.
For example, after determining a first format of pixel data and a second format supported by the display driver, the electronic device may detect whether the first format matches the second format. If the first format is not matched with the second format, the electronic device may convert the pixel data from the first format to the second format to obtain the target pixel data, that is, the target pixel data has the second format, so that it is known that the format of the target pixel data is the same as the format supported by the display driver. In some embodiments, the electronic device may generate and display the target interface based directly on the display driver and the pixel data when the first format matches the second format.
104. And generating and displaying a target interface based on the target pixel data and the display drive.
For example, the electronic device may obtain the target pixel data according to a format supported by the display driver by using the display driver, and compile the target pixel data into a form supported by the display card, so that a target interface corresponding to the target pixel data may be displayed on the display screen.
In the embodiment of the application, when the first format of the pixel data obtained by drawing the target interface by using the old frame interface is not matched with the second format supported by the updated display driver, the display driver cannot successfully read the pixel data to display the target interface, so that the pixel data can be converted from the first format to the second format to obtain the target pixel data when the first format is not matched with the second format. Because the format of the target pixel data matches the format supported by the updated display driver, the display driver can successfully read the pixel data to display the target interface. As can be seen from the above, in the embodiment of the present application, even if the old framework interface is used to draw the target interface, the interface processing method provided in the embodiment of the present application can also successfully display the target interface. The interface processing method provided by the embodiment of the application can still adopt the old framework interface to realize the drawing of the target interface, so that the change of more code flows can be avoided, and the workload can be reduced.
Referring to fig. 2, fig. 2 is a second flowchart illustrating an interface processing method according to an embodiment of the present disclosure, where the interface processing method is applicable to an electronic device, the electronic device may include a display driver, and the process may include:
201. when the target interface needs to be displayed, the electronic equipment acquires pixel data corresponding to the target interface, wherein the pixel data comprises a plurality of pixel points.
For example, the user may cause the electronic device to enter the recovery mode by triggering a pressing operation of a preset key. When the electronic device is in the recovery mode, the electronic device needs to display an initial interface of the recovery mode (i.e., a first interface displayed when the electronic device enters the recovery mode), and the initial interface may be a target interface. Or, the user performs a click operation on the current interface, and if a certain virtual key displayed on the current interface is clicked, the electronic device enters a next interface corresponding to the virtual key, that is, the electronic device needs to display the next interface, which is a target interface.
The Recovery mode is a mode which is provided by the electronic equipment based on the Android system and can modify data or a system in the electronic equipment. After the electronic device enters the Recovery mode, the electronic device can be restored to factory settings, a system of the electronic device can be upgraded, the electronic device can be refreshed, and the like.
For example, when the target interface needs to be displayed, the electronic device may obtain pixel data corresponding to the target interface. For example, the electronic device may first determine an element corresponding to the target interface, a type of the element, and a location where the element is located. For example, the electronic device may determine which icons, text, or graphics, etc. need to be displayed by the target interface, the location of the icons, text, or graphics (i.e., where they need to be displayed), and which icons, which types, sizes, text, and graphics are the icons. After the electronic device determines the element corresponding to the target interface, the type of the element, and the position of the element, the electronic device may draw the target interface to obtain pixel data corresponding to the target interface. The pixel data comprises a plurality of pixel points.
For example, in the electronic device, the application layer may draw the target interface by using a framebuffer layer frame interface, so as to obtain a plurality of pixel points corresponding to the target interface. Wherein, the data structure of the frame buffer layer frame is as follows: layer width, layer height, layer size (layer size: layer width: layer height: 2), and pixel-specific data. And the number of bytes occupied by each pixel point in the plurality of pixel points obtained by drawing the target interface by adopting the framebuffer layer frame interface is 2. Because one byte is equal to 8 bits, the number of bits occupied by each pixel point in a plurality of pixel points obtained by drawing the target interface by adopting the framebuffer layer frame interface is 16.
For another example, in the electronic device, the application layer may use a mini layer frame interface to draw the target interface, so as to obtain a plurality of pixel points corresponding to the target interface. Wherein, the data structure of the mini graphic layer frame is as follows: the method comprises the following steps of layer width, layer height, byte number occupied by a display screen, byte number occupied by each pixel and specific pixel data. And the number of bytes occupied by each pixel point in the plurality of pixel points obtained by drawing the target interface by adopting the mini layer frame interface is 4. Because one byte is equal to 8 bits, the number of bits occupied by each pixel point in a plurality of pixel points obtained by drawing the target interface by adopting the mini layer frame interface is 32.
It is understood that an interface may include n layers, where n is greater than or equal to 1. The n layers are superposed to form an interface. The 1 layer may include n pixel points. The size of n depends on the number of bytes that can be held by the display screen and the number of bytes occupied by each pixel point. For example, assuming that the number of bytes that can be accommodated by the display screen is 100, and the number of bytes occupied by each pixel point is 2, then n is less than or equal to 50. Since there may also be some blank pixels on the display screen, in this case n is less than 50.
202. The electronic device determines a first digit occupied by each pixel point and a second digit corresponding to each pixel point supported by the display driver.
For example, if the electronic device uses a framebuffer layer frame interface to draw a target interface to obtain a plurality of pixel points, the number of bits occupied by each pixel point in the plurality of pixel points is 16, that is, the first number of bits is 16. Therefore, when the electronic device adopts the framebuffer layer frame interface to draw the target interface, the electronic device can determine that the first digit occupied by each pixel point is 16.
For another example, if the electronic device uses the mini layer frame interface to draw the target interface to obtain a plurality of pixel points, the number of bits occupied by each pixel point in the plurality of pixel points is 32, that is, the first number is 32. Therefore, when the electronic equipment adopts the mini layer frame interface to draw the target interface, the electronic equipment can determine that the first digit occupied by each pixel point is 32.
In the related art, the target interface can be successfully displayed only when the number of bits occupied by each pixel point in a plurality of pixel points obtained by drawing the target interface through the layer frame interface is the same as the number of bits corresponding to each pixel point supported by the display driver, and the display driver translates an instruction carrying the plurality of pixel points into an electronic signal instruction which can be recognized by the display card. It can be understood that, when the number of bits occupied by each pixel point in the plurality of pixel points obtained by drawing the target interface through the layer frame interface is different from the number of bits corresponding to each pixel point supported by the display driver, the display driver translates the instruction carrying the plurality of pixel points into the electronic signal instruction which can be recognized by the display card, and the target interface cannot be displayed.
In the related art, in order to successfully display a target interface, after a bottom layer display driver is updated, if the number of bits corresponding to each pixel point supported by the updated display driver is different from the number of bits of each pixel point in a plurality of pixel points obtained by performing interface rendering on an old image layer frame interface, the old image layer frame interface is usually replaced with a new image layer frame interface, so that the new image layer frame interface is used to implement the rendering of the whole interface. It can be understood that the number of bits of each pixel point in the plurality of pixel points obtained by performing interface rendering using the new layer frame interface is the same as the number of bits corresponding to each pixel point supported by the updated display driver.
However, for some special interfaces, such as interfaces implemented in C language, when the interfaces are drawn, each pixel point in a plurality of pixel points corresponding to the interfaces needs to be drawn. For example, if the interface corresponds to 100 pixels, 100 times of drawing is required. In terms of code level, updating an old graph layer framework interface to a new graph layer framework interface can cause more code flow changes, thereby greatly increasing the workload.
In the embodiment of the present application, after the display driver is updated, the old layer framework interface may not be replaced with the new layer framework interface. Therefore, after the display driver is updated, when the target interface needs to be displayed, the electronic device can still draw the target interface by using the old image layer frame interface to obtain a plurality of pixel points. After obtaining the plurality of pixel points, the electronic device may determine a first digit of each pixel point of the plurality of pixel points and a second digit corresponding to each pixel point supported by the updated display driver. Assuming that the old layer frame interface is a framebuffer layer frame interface, it can be known that the first digit number occupied by each of the plurality of pixel points is 16.
203. When the first digit is not equal to the second digit, the electronic equipment converts the digit occupied by each pixel point from the first digit to the second digit to obtain a plurality of target pixel points.
For example, assuming that the first digit occupied by each pixel is 16, and the second digit corresponding to each pixel supported by the display driver is 32, it may be determined that the first digit is not equal to the second digit. Therefore, the electronic equipment can convert the number of bits occupied by each pixel point from the first number of bits to the second number of bits to obtain a plurality of target pixel points. For example, the electronic device may convert the number of bits occupied by each pixel point from 16 to 32, so as to obtain a plurality of target pixel points. It can be understood that each target pixel point of the plurality of target pixel points occupies 32 bits.
204. The electronic device generates and displays a target interface based on the plurality of target pixel points and the display driver.
For example, after obtaining a plurality of target pixel points, the electronic device may further store the plurality of target pixel points in the memory, and form a corresponding instruction. Wherein, the instruction carries the plurality of target pixel points. Then, the electronic device may use the display driver to obtain the instruction carrying the target pixels from the memory. Then, the electronic device can translate the instruction carrying the target pixel points into an electronic signal instruction which can be recognized by the display card by adopting a display driver, so that a target interface is generated and displayed.
In some embodiments, each pixel includes first color information, second color information, and third color information, and when the first digit number occupied by each pixel is 16, the first color information of each pixel, the second color information of each pixel, and the digit number occupied by the third color information of each pixel are all less than 8, as shown in fig. 3, when the first digit number occupied by each pixel is 16, and the second digit number corresponding to each pixel supported by the display driver is 32, the electronic device converts the digit number occupied by each pixel from the first digit number to the second digit number, and obtains a plurality of target pixel flows, which may include:
2031. the electronic equipment extracts the first color information, the second color information and the third color information from each pixel point.
2032. The electronic equipment increases the number of bits occupied by the first color information of each pixel point, the second color information of each pixel point and the third color information of each pixel point to 8, and obtains first target color information, second target color information and third target color information.
2033. The electronic equipment acquires transparency information of each pixel point.
2034. And the electronic equipment controls the number of bits occupied by the transparency information of each pixel point to be 8, so as to obtain the target transparency information.
2035. And each first target color information, each second target color information, each third target color information and each target transparency information form each target pixel point to obtain a plurality of target pixel points.
Each pixel point can include three color components of RGB (red, green and blue). Therefore, the electronic device can extract an R (red) color component, i.e., first color information, a B (blue) color component, i.e., second color information, and a G (green) color component, i.e., third color information, from each pixel point. When the first digit occupied by each pixel point is 16, the digits occupied by the first color information, the second color information and the third color information may all be less than 8.
Then, the electronic device may increase the first color information of each pixel point, for example, the number of bits occupied by the R color component to 8, to obtain first target color information; increasing the number of bits occupied by the second color information, such as the B color component, of each pixel point to 8 to obtain second target color information; and increasing the number of bits occupied by the third color information, for example, the G color component, of each pixel point to 8 to obtain third target color information.
Subsequently, the electronic device can also obtain the transparency information of each pixel point, and control the number of bits occupied by the transparency information of each pixel point to be 8 bits, so as to obtain the target transparency information. Therefore, each first target color information, each second target color information, each third target color information and each target transparency information can form each target pixel point, and a plurality of target pixel points are obtained. Wherein, the number of bits occupied by each target pixel point is 32.
In some embodiments, when the first number of bits occupied by each pixel point is 16, the number of bits occupied by the first color information of each pixel point and the second color information of each pixel point is 5, and the number of bits occupied by the third color information of each pixel point is 6. For example, for each pixel point, 5 bits may be used to represent the R color component, 6 bits may be used to represent the G color component, and 5 bits may be used to represent the B color component.
For example, each pixel point can be represented as follows: RRRRRGGGG GGGBBBB. Wherein, R represents the R color component, and the value can be 0 or 1; g represents a G color component, and the value of G can be 0 or 1; and B represents a B color component and can take a value of 0 or 1.
When the first digit occupied by each pixel point is 16, each pixel point is expressed as: RRRRRGGG GGGBBBBB, when the second digit number corresponding to each pixel point supported by the display driver is 32, each target pixel point can be expressed as follows: RRRRR000GGGGGG00 BBBBB000 AAAAAA. Namely, an R color component, a G color component and a B color component are extracted from each pixel point, and zero padding processing is carried out at the tail ends of the R color component, the G color component and the B color component, so that the number of bits occupied by the R color component, the G color component and the B color component is increased to 8 bits. Then, the electronic device can also obtain the transparency information of each pixel point and control the number of bits occupied by the transparency information of each pixel point to be 8 bits. That is, a represents the transparency information of each pixel point, and the value may be 0 or 1.
When the second digit number corresponding to each pixel point supported by the display driver is 32, the display driver can obtain data every 8 digits when translating the instruction carrying a plurality of target pixel points into an electronic signal instruction which can be identified by the display card, and when the data is obtained for 4 times, the display driver can translate the data obtained by the data for 4 times into one pixel point.
If the representation form of the pixel point is as follows: RRRRRGGG GGGBBBB, the display driver translates RRRRRGGG GGGBBBB RRRGGG GGGBBBB into a pixel point. It can be understood that rrrrrggggggggbbbb RRRRRGGGGGGBBBB originally has two pixel points, and therefore the number of the pixel points corresponding to the target interface translated by the display driver is only half of the number of the pixel points originally corresponding to the target interface, and the target interface cannot be successfully displayed.
If the representation form of the pixel point is as follows: RRRRR000GGGGGG00 BBBBB000 AAAAAA, the display driver translates RRRRR000GGGG 00 BBB000 AAAAAAAA into a pixel point. It can be understood that the rrrrrrr 000GGGGGG00 bbbbbbb 000 AAAAAAAA originally is a pixel point, and therefore the display driver can successfully translate each pixel point corresponding to the target interface, and the target interface can be successfully displayed.
As shown in fig. 4, in some embodiments, the process 201 may include:
2011. when the target interface needs to be displayed, the electronic equipment detects whether the electronic equipment is currently in a recovery mode.
2022. And if the current mode is the recovery mode, the electronic equipment acquires pixel data corresponding to the target interface.
For example, since the interfaces in the recovery mode are all implemented in the C language, in order to avoid changes of more code flows and reduce workload, the old layer framework interface may not be updated to the new layer framework interface after the display driver is updated. For example, when the target interface needs to be displayed, the electronic device may detect whether it is currently in recovery mode. If the current mode is in the recovery mode, the electronic device can draw the target interface by using the old image layer frame interface so as to obtain pixel data corresponding to the target interface.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an interface processing apparatus according to an embodiment of the present disclosure. The interface processing device can be applied to electronic equipment, and the electronic equipment can comprise a display driver. The interface processing device includes: the device comprises an acquisition module 301, a determination module 302, a conversion module 303 and a display module 304.
The obtaining module 301 is configured to obtain pixel data corresponding to a target interface when the target interface needs to be displayed.
A determining module 302 for determining a first format of the pixel data and a second format supported by the display driver.
A converting module 303, configured to convert the pixel data from the first format to the second format to obtain target pixel data when the first format is not matched with the second format.
A display module 304, configured to generate and display the target interface based on the target pixel data and the display driver.
In some embodiments, the pixel data includes a plurality of pixel points, and the determining module 302 may be configured to: determining a first digit occupied by each pixel point and a second digit corresponding to each pixel point supported by the display driver; the conversion module 303 may be configured to: when the first digit is not equal to the second digit, converting the digit occupied by each pixel point from the first digit to the second digit to obtain a plurality of target pixel points; the display module 304 may be configured to: and generating and displaying the target interface based on the target pixel points and the display driver.
In some embodiments, each pixel includes first color information, second color information, and third color information, when the first digit number occupied by each pixel is 16, the first color information of each pixel, the second color information of each pixel, and the digit number occupied by the third color information of each pixel are all less than 8, and when the first digit number occupied by each pixel is 16, and the second digit number corresponding to each pixel supported by the display driver is 32, the conversion module 303 may be configured to: extracting first color information, second color information and third color information from each pixel point; increasing the number of bits occupied by the first color information of each pixel point, the second color information of each pixel point and the third color information of each pixel point to 8 to obtain first target color information, second target color information and third target color information; acquiring transparency information of each pixel point; controlling the number of bits occupied by the transparency information of each pixel point to be 8 to obtain target transparency information; and each first target color information, each second target color information, each third target color information and each target transparency information form each target pixel point to obtain a plurality of target pixel points.
In some embodiments, the number of bits occupied by the first color information of each pixel point and the second color information of each pixel point is 5, and the number of bits occupied by the third color information of each pixel point is 6.
In some embodiments, the obtaining module 301 may be configured to: when the target interface needs to be displayed, detecting whether the target interface is in a recovery mode at present; and if the current mode is the recovery mode, acquiring pixel data corresponding to the target interface.
The embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed on a computer, the computer is caused to execute the flow in the interface processing method provided in the embodiment.
The embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the processor is configured to execute the flow in the interface processing method provided in this embodiment by calling the computer program stored in the memory.
For example, the electronic device may be a mobile terminal such as a tablet computer or a smart phone. Referring to fig. 6, fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
The electronic device 400 may include components such as a memory 401, a processor 402, and the like. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 6 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The memory 401 may be used to store applications and data. The memory 401 stores applications containing executable code. The application programs may constitute various functional modules. The processor 402 executes various functional applications and data processing by running an application program stored in the memory 401.
The processor 402 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing an application program stored in the memory 401 and calling data stored in the memory 401, thereby integrally monitoring the electronic device.
In this embodiment, the processor 402 in the electronic device loads the executable code corresponding to the processes of one or more application programs into the memory 401 according to the following instructions, and the processor 402 runs the application programs stored in the memory 401, so as to implement the following processes:
when a target interface needs to be displayed, acquiring pixel data corresponding to the target interface;
determining a first format of the pixel data, and a second format supported by a display driver;
when the first format is not matched with the second format, converting the pixel data from the first format to the second format to obtain target pixel data;
and generating and displaying the target interface based on the target pixel data and the display drive.
Referring to fig. 7, the electronic device 400 may include a memory 401, a processor 402, an input unit 403, an output unit 404, a display screen 405, and the like.
The memory 401 may be used to store applications and data. The memory 401 stores applications containing executable code. The application programs may constitute various functional modules. The processor 402 executes various functional applications and data processing by running an application program stored in the memory 401.
The processor 402 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing an application program stored in the memory 401 and calling data stored in the memory 401, thereby integrally monitoring the electronic device.
The input unit 403 may be used to receive input numbers, character information, or user characteristic information, such as a fingerprint, and generate a keyboard, mouse, joystick, optical, or trackball signal input related to user setting and function control.
The output unit 404 may be used to display information input by or provided to a user and various graphical user interfaces of the electronic device, which may be made up of graphics, text, icons, video, and any combination thereof. The output unit may include a display panel.
The display screen 405 may be used to display text, pictures, etc.
In this embodiment, the processor 402 in the electronic device loads the executable code corresponding to the processes of one or more application programs into the memory 401 according to the following instructions, and the processor 402 runs the application programs stored in the memory 401, so as to implement the following processes:
when a target interface needs to be displayed, acquiring pixel data corresponding to the target interface;
determining a first format of the pixel data, and a second format supported by a display driver;
when the first format is not matched with the second format, converting the pixel data from the first format to the second format to obtain target pixel data;
and generating and displaying the target interface based on the target pixel data and the display drive.
In some embodiments, the pixel data comprises a plurality of pixel points, and the determining of the first format of the pixel data and the second format supported by the display driver performed by the processor 402 may be performed by: determining a first digit occupied by each pixel point and a second digit corresponding to each pixel point supported by the display driver; the processor 402 may perform the following steps when converting the pixel data from the first format to the second format when the first format does not match the second format, and obtaining target pixel data: when the first digit is not equal to the second digit, converting the digit occupied by each pixel point from the first digit to the second digit to obtain a plurality of target pixel points; processor 402 may perform the steps of generating and displaying the target interface based on the target pixel data and the display driver: and generating and displaying the target interface based on the target pixel points and the display driver.
In some embodiments, each pixel includes first color information, second color information, and third color information, when the first number of bits occupied by each pixel is 16, the first color information of each pixel, the second color information of each pixel, and the number of bits occupied by the third color information of each pixel are all less than 8, when the first number of bits occupied by each pixel is 16, and the second number of bits corresponding to each pixel supported by the display driver is 32, the processor 402 executes the conversion of the number of bits occupied by each pixel from the first number of bits to the second number of bits, and when a plurality of target pixels are obtained, the execution may be performed: extracting first color information, second color information and third color information from each pixel point; increasing the number of bits occupied by the first color information of each pixel point, the second color information of each pixel point and the third color information of each pixel point to 8 to obtain first target color information, second target color information and third target color information; acquiring transparency information of each pixel point; controlling the number of bits occupied by the transparency information of each pixel point to be 8 to obtain target transparency information; and each first target color information, each second target color information, each third target color information and each target transparency information form each target pixel point to obtain a plurality of target pixel points.
In some embodiments, the number of bits occupied by the first color information of each pixel point and the second color information of each pixel point is 5, and the number of bits occupied by the third color information of each pixel point is 6.
In some embodiments, when the processor 402 executes the above-mentioned obtaining of the pixel data corresponding to the target interface when the target interface needs to be displayed, the following steps may be executed: when the target interface needs to be displayed, detecting whether the target interface is in a recovery mode at present; and if the current mode is the recovery mode, acquiring pixel data corresponding to the target interface.
In the above embodiments, the descriptions of the embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed description of the interface processing method, and are not described herein again.
The interface processing apparatus provided in the embodiment of the present application and the interface processing method in the above embodiments belong to the same concept, and any method provided in the embodiment of the interface processing method may be run on the interface processing apparatus, and a specific implementation process thereof is described in the embodiment of the interface processing method in detail, and is not described herein again.
It should be noted that, for the interface processing method described in the embodiment of the present application, it can be understood by those skilled in the art that all or part of the process of implementing the interface processing method described in the embodiment of the present application can be completed by controlling the relevant hardware through a computer program, where the computer program can be stored in a computer-readable storage medium, such as a memory, and executed by at least one processor, and during the execution process, the process of the embodiment of the interface processing method can be included. The storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like.
In the interface processing apparatus according to the embodiment of the present application, each functional module may be integrated into one processing chip, or each module may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium, such as a read-only memory, a magnetic or optical disk, or the like.
The interface processing method, the interface processing device, the storage medium, and the electronic device provided in the embodiments of the present application are described in detail above, and a specific example is applied in the present application to explain the principle and the implementation of the present application, and the description of the above embodiments is only used to help understanding the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. An interface processing method is applied to an electronic device, the electronic device comprises a display driver, and the interface processing method is characterized by comprising the following steps:
when a target interface needs to be displayed, acquiring pixel data corresponding to the target interface;
determining a first format of the pixel data, and a second format supported by a display driver;
when the first format is not matched with the second format, converting the pixel data from the first format to the second format to obtain target pixel data;
and generating and displaying the target interface based on the target pixel data and the display drive.
2. The interface processing method of claim 1, wherein the pixel data comprises a plurality of pixel points, and wherein determining the first format of the pixel data and the second format supported by the display driver comprises:
determining a first digit occupied by each pixel point and a second digit corresponding to each pixel point supported by the display driver;
when the first format is not matched with the second format, converting the pixel data from the first format to the second format to obtain target pixel data, including:
when the first digit is not equal to the second digit, converting the digit occupied by each pixel point from the first digit to the second digit to obtain a plurality of target pixel points;
the generating and displaying the target interface based on the target pixel data and the display driver includes:
and generating and displaying the target interface based on the target pixel points and the display driver.
3. The interface processing method according to claim 2, wherein each pixel includes first color information, second color information, and third color information, and when the first number of bits occupied by each pixel is 16, the number of bits occupied by the first color information of each pixel, the second color information of each pixel, and the third color information of each pixel is less than 8, and when the first number of bits occupied by each pixel is 16, and the second number of bits corresponding to each pixel supported by the display driver is 32, the number of bits occupied by each pixel is converted from the first number of bits to the second number of bits, and a plurality of target pixels are obtained, including:
extracting first color information, second color information and third color information from each pixel point;
increasing the number of bits occupied by the first color information of each pixel point, the second color information of each pixel point and the third color information of each pixel point to 8 to obtain first target color information, second target color information and third target color information;
acquiring transparency information of each pixel point;
controlling the number of bits occupied by the transparency information of each pixel point to be 8 to obtain target transparency information;
and each first target color information, each second target color information, each third target color information and each target transparency information form each target pixel point to obtain a plurality of target pixel points.
4. The interface processing method according to claim 3, wherein the number of bits occupied by the first color information of each pixel and the second color information of each pixel is 5, and the number of bits occupied by the third color information of each pixel is 6.
5. The interface processing method according to claim 1, wherein when the target interface needs to be displayed, acquiring pixel data corresponding to the target interface includes:
when the target interface needs to be displayed, detecting whether the target interface is in a recovery mode at present;
and if the current mode is the recovery mode, acquiring pixel data corresponding to the target interface.
6. An interface processing apparatus applied to an electronic device, the electronic device including a display driver, the interface processing apparatus comprising:
the acquisition module is used for acquiring pixel data corresponding to a target interface when the target interface needs to be displayed;
a determining module for determining a first format of the pixel data and a second format supported by a display driver;
the conversion module is used for converting the pixel data from the first format to the second format to obtain target pixel data when the first format is not matched with the second format;
and the display module is used for generating and displaying the target interface based on the target pixel data and the display drive.
7. The interface processing device according to claim 6, wherein the pixel data includes a plurality of pixel points, and the determining module is specifically configured to: determining a first digit occupied by each pixel point and a second digit corresponding to each pixel point supported by the display driver;
the conversion module is specifically configured to: when the first digit is not equal to the second digit, converting the digit occupied by each pixel point from the first digit to the second digit to obtain a plurality of target pixel points;
the display module is specifically configured to: and generating and displaying the target interface based on the target pixel points and the display driver.
8. The interface processing device according to claim 7, wherein each pixel includes first color information, second color information, and third color information, and when the first number of bits occupied by each pixel is 16, the number of bits occupied by the first color information of each pixel, the second color information of each pixel, and the third color information of each pixel is less than 8, and when the first number of bits occupied by each pixel is 16, and the second number of bits corresponding to each pixel supported by the display driver is 32, the conversion module is specifically configured to:
extracting first color information, second color information and third color information from each pixel point;
increasing the number of bits occupied by the first color information of each pixel point, the second color information of each pixel point and the third color information of each pixel point to 8 to obtain first target color information, second target color information and third target color information;
acquiring transparency information of each pixel point;
controlling the number of bits occupied by the transparency information of each pixel point to be 8 to obtain target transparency information;
and each first target color information, each second target color information, each third target color information and each target transparency information form each target pixel point to obtain a plurality of target pixel points.
9. A storage medium, characterized in that a computer program is stored therein, which when run on a computer, causes the computer to execute the interface processing method according to any one of claims 1 to 5.
10. An electronic device, characterized in that the electronic device comprises a processor and a memory, wherein the memory stores a computer program, and the processor is used for executing the interface processing method according to any one of claims 1 to 5 by calling the computer program stored in the memory.
CN201910824689.2A 2019-09-02 2019-09-02 Interface processing method and device, storage medium and electronic equipment Pending CN110609669A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910824689.2A CN110609669A (en) 2019-09-02 2019-09-02 Interface processing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910824689.2A CN110609669A (en) 2019-09-02 2019-09-02 Interface processing method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN110609669A true CN110609669A (en) 2019-12-24

Family

ID=68892150

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910824689.2A Pending CN110609669A (en) 2019-09-02 2019-09-02 Interface processing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN110609669A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112037291A (en) * 2020-08-31 2020-12-04 维沃移动通信有限公司 Data processing method and device and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101685617A (en) * 2008-09-26 2010-03-31 辉达公司 System and method for selecting a pixel output format
US20120218277A1 (en) * 2011-02-25 2012-08-30 ST-Ericcson SA Display list mechanism and scalable display engine structures
CN103914375A (en) * 2013-01-07 2014-07-09 百度国际科技(深圳)有限公司 Method and device for testing owner-drawing interface software
CN105094289A (en) * 2014-04-18 2015-11-25 浙江大华技术股份有限公司 Method, device, and system for realizing graphical user interface
CN105654541A (en) * 2015-12-31 2016-06-08 网易(杭州)网络有限公司 Window image processing method and device
CN109471689A (en) * 2018-09-30 2019-03-15 广州虎牙信息科技有限公司 Interface display driving method, device, electronic equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101685617A (en) * 2008-09-26 2010-03-31 辉达公司 System and method for selecting a pixel output format
US20120218277A1 (en) * 2011-02-25 2012-08-30 ST-Ericcson SA Display list mechanism and scalable display engine structures
WO2012113923A1 (en) * 2011-02-25 2012-08-30 St-Ericsson Sa Display list mechanism and scalable display engine structures
CN103914375A (en) * 2013-01-07 2014-07-09 百度国际科技(深圳)有限公司 Method and device for testing owner-drawing interface software
CN105094289A (en) * 2014-04-18 2015-11-25 浙江大华技术股份有限公司 Method, device, and system for realizing graphical user interface
CN105654541A (en) * 2015-12-31 2016-06-08 网易(杭州)网络有限公司 Window image processing method and device
CN109471689A (en) * 2018-09-30 2019-03-15 广州虎牙信息科技有限公司 Interface display driving method, device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
问答: "转换16bit颜色为32bit", 《VOIDCC开发小院》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112037291A (en) * 2020-08-31 2020-12-04 维沃移动通信有限公司 Data processing method and device and electronic equipment
CN112037291B (en) * 2020-08-31 2024-03-22 维沃移动通信有限公司 Data processing method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN112115678B (en) Information display method and device, storage medium and electronic equipment
CN107515759B (en) Screen capture method and device, electronic equipment and readable storage medium
US8589817B2 (en) Technique for supporting user data input
CN107977155B (en) Handwriting recognition method, device, equipment and storage medium
WO2017000898A1 (en) Software icon display method and apparatus
CN114218890A (en) Page rendering method and device, electronic equipment and storage medium
US20200249965A1 (en) Display Device with Built-In Web Browser for Graphical User Interface in an Embedded System
CN108989704B (en) Image generation method and device and terminal equipment
CN112052000A (en) Component multiplexing and rendering method and device
CN110609669A (en) Interface processing method and device, storage medium and electronic equipment
CN111724455A (en) Image processing method and electronic device
CN102467490B (en) Font data processing method and device
CN105573705A (en) Display control method and terminal
CN114237795A (en) Terminal interface display method and device, electronic equipment and readable storage medium
CN111402117B (en) Picture processing method and device, storage medium and client device
CN102099806B (en) Information output apparatus, information output method, and recording medium
CN111913711B (en) Video rendering method and device
US20150128029A1 (en) Method and apparatus for rendering data of web application and recording medium thereof
CN112926420A (en) Display device and menu character recognition method
CN112908327A (en) Voice control method, device, equipment and storage medium of application program
CN113038184A (en) Data processing method, device, equipment and storage medium
CN112181868B (en) Display method, display system, electronic device and storage medium for identification picture
CN117234655B (en) Method, device, equipment and medium for running Linux desktop program based on android system
CN113051084B (en) Display control method and device, storage medium and electronic equipment
US10481791B2 (en) Magnified input panels

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination