Image display method, device, electronic device and computer readable medium

By detecting the page scrolling operation in electronic devices and performing a fast first rendering operation, it solves the problems of white screen, flickering screen and stuck when the page is scrolling, improving fluency and user experience.

CN114860141BActive Publication Date: 2024-09-20GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210567686.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-23
Publication Date
2024-09-20
Estimated Expiration
2042-05-23

AI Technical Summary

Technical Problem

When the electronic device scrolls and displays the page, the scrolling speed is too fast or the rendering speed is too slow, resulting in white screen, splash screen and freeze, low fluency and poor user experience.

Method used

When a page scrolling operation is detected, the target image data to be rendered is determined, and two rendering operations are performed. The first rendering operation is faster, ensuring that when the second rendering operation is not completed, the image completed by the first rendering is displayed to avoid Stuck and stopped.

Benefits of technology

It effectively avoids the lag caused by incomplete rendering and improves the smoothness of page scrolling and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114860141B
    Figure CN114860141B
Patent Text Reader

Abstract

The present application discloses an image display method, device, electronic device and computer-readable medium, which relate to the field of image technology. The method comprises: when a preset image is displayed in a display area, when a page scrolling operation for the display area is detected, the target image data to be rendered is determined based on the page scrolling operation; a second rendering operation is performed on the target image data, and the processing speed of the first rendering operation is higher than the processing speed of the second rendering operation; when it is detected that the target page area corresponding to the target image data slides to the display area, if the second image is not completed and the first image is completed, the first image is displayed in the display area. Since the operation speed of the first rendering operation is faster than the processing speed of the second rendering operation, the first rendering operation is completed faster, and the first image obtained by the first rendering operation can be displayed in the display area. Therefore, jamming can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image technology, and more specifically, to an image display method, device, electronic device and computer-readable medium. Background Art

[0002] At present, the screen of an electronic device can scroll to display multiple pages. For example, when the screen displays a page, the content of the subsequent pages of the page can be scrolled into the display area of ​​the screen for display. However, if the scrolling speed is too fast or the rendering speed of the displayed content is too slow, when the displayed content needs to be displayed, if the displayed content is not rendered, it will cause white screen, flashing screen, freeze, etc., which has low fluency and poor user experience. Summary of the invention

[0003] The present application proposes an image display method, device, electronic device and computer-readable medium to improve the above-mentioned defects.

[0004] In a first aspect, an embodiment of the present application provides an image display method, including: when a preset image is displayed in a display area, when a page scrolling operation for the display area is detected, determining target image data to be rendered based on the page scrolling operation; performing a second rendering operation on the target image data; in response to detecting that a target page area corresponding to the target image data slides to the display area, if the second image has not been rendered and the first image has been rendered, displaying the first image in the display area, wherein the first image is an image obtained by pre-processing the target image data based on the first rendering operation, the second rendering operation is used to process the target image data to obtain the second image, the processing speed of the first rendering operation is higher than the processing speed of the second rendering operation, and based on the page loading order, the target page area is located after the preset page area corresponding to the preset image.

[0005] In a second aspect, an embodiment of the present application further provides an image display device, comprising: a determination unit, a rendering unit and a display unit. The determination unit is used to determine the target image data to be rendered based on the page scrolling operation when a page scrolling operation for the display area is detected in the case where a preset image is displayed in the display area. The rendering unit is used to perform a second rendering operation on the target image data. The display unit is used to display the first image in the display area in response to detecting that the target page area corresponding to the target image data slides to the display area, if the second image has not been rendered and the first image has been rendered, wherein the first image is an image obtained by pre-processing the target image data based on the first rendering operation, the second rendering operation is used to process the target image data to obtain the second image, the processing speed of the first rendering operation is higher than the processing speed of the second rendering operation, and based on the page loading order, the target page area is located after the preset page area corresponding to the preset image.

[0006] In a third aspect, an embodiment of the present application also provides an electronic device, comprising: one or more processors; a memory; one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the above method.

[0007] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the readable storage medium stores a program code executable by a processor, and when the program code is executed by the processor, the processor executes the above method.

[0008] In a fifth aspect, an embodiment of the present application further provides a computer program product, including a computer program / instructions, which implement the above method when executed by a processor.

[0009] The image display method, device, electronic device and computer-readable medium provided by the present application, when a preset image is displayed in a display area, when a page scrolling operation for the display area is detected, the target image data to be rendered is determined based on the page scrolling operation, and then a second rendering operation is performed on the target image data, and when it is detected that the target page area corresponding to the target image data slides to the display area, if the second rendering operation is not completed and the first rendering operation is completed, the first image rendered by the first rendering operation is displayed in the display area. Since the operation speed of the first rendering operation is faster than the processing speed of the second rendering operation, the first rendering operation has been completed when the second rendering operation is not completed, and the first image obtained by the first rendering operation can be displayed in the display area. Therefore, it can be avoided that when the target page area corresponding to the target image data to be rendered slides to the display area, the second image cannot be displayed due to the incomplete rendering of the second image, causing a jam.

[0010] Other features and advantages of the embodiments of the present application will be described in the subsequent description, and partly become apparent from the description, or can be understood by practicing the embodiments of the present application. The purposes and other advantages of the embodiments of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0012] FIG. 1( a ) is a schematic diagram showing the layout of the content of a page provided in an embodiment of the present application;

[0013] FIG. 1( b ) is a schematic diagram showing the layout of the content of a page provided in an embodiment of the present application;

[0014] Figure 2 A schematic diagram showing the layout of the content of a page provided by another embodiment of the present application;

[0015] Figure 3 A schematic diagram showing the layout of the content of a page provided by yet another embodiment of the present application;

[0016] Figure 4 A block diagram of an image rendering architecture provided by an embodiment of the present application is shown;

[0017] Figure 5A method flow chart of an image display method provided by an embodiment of the present application is shown;

[0018] Figure 6 A schematic diagram showing display content of a display area provided by an embodiment of the present application is shown;

[0019] Figure 7 A schematic diagram showing display content of a display area provided by another embodiment of the present application is shown;

[0020] Figure 8 A method flow chart of an image display method provided by another embodiment of the present application is shown;

[0021] Fig. 9 A schematic diagram showing multiple sub-areas of a display area provided by an embodiment of the present application;

[0022] Fig.10 A schematic diagram showing a page area provided by an embodiment of the present application;

[0023] Fig.11 A schematic diagram of a canvas, a drawing buffer, a buffer queue, and an infinite canvas provided in an embodiment of the present application is shown;

[0024] Fig.12 The corresponding relationship between the display area, infinite canvas and buffer queue provided by an embodiment of the present application is shown;

[0025] Fig.13 The corresponding relationship between the display area, infinite canvas and buffer queue provided by another embodiment of the present application is shown;

[0026] Fig.14 A schematic diagram of a canvas, a drawing buffer, a buffer queue, a fuzzy buffer, and an infinite canvas provided in an embodiment of the present application is shown;

[0027] Fig.15 A schematic diagram showing display content of a display area provided in yet another embodiment of the present application is shown;

[0028] Fig.16 A schematic diagram showing display content of a display area provided in yet another embodiment of the present application is shown;

[0029] Fig.17 A module block diagram of an image display device provided by another embodiment of the present application is shown;

[0030] Fig.18 A structural block diagram of an electronic device provided in an embodiment of the present application is shown;

[0031] Fig.19A storage unit for storing or carrying a program code for implementing an image display method according to an embodiment of the present application is shown;

[0032] Fig. 20 A module block diagram of a computer product provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0033] In order to make those skilled in the art better understand the present application scheme, the technical scheme in the present application embodiment will be clearly and completely described below in conjunction with the drawings in the present application embodiment. Obviously, the described embodiment is only a part of the present application embodiment, rather than all the embodiments. The components of the present application embodiment usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the present application for protection, but merely represents the selected embodiment of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0034] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0035] At present, the screen of an electronic device can scroll and display multiple pages. For example, when the screen displays a page, the content of the adjacent page of the page can be displayed in the display area of ​​the screen by scrolling. Specifically, when there is a lot of content to be displayed on the screen, the content will be displayed in pages. Specifically, the content can be displayed on the page by dividing the page into multiple rows according to the content to be displayed, and each row is used to display a sub-content. Specifically, the page will calculate and render the layout of the acquired content. The layout process is the corresponding position of each content in the page, and the position is the row number in the page corresponding to the content.

[0036] As shown in Figures 1(a) and (b), the page corresponds to row numbers h1, h2, h3, h4, etc. Each row number corresponds to a sub-content. As shown in Figure 1, the sub-content corresponding to row number h3 is the sub-content corresponding to icon 1. The row number corresponding to each sub-content is used to indicate the display position of the sub-content on the page. As shown in Figures 1(a) and (b), the display position of the sub-content corresponding to row number h1 on the page is the first row of the page, and the display position of the sub-content corresponding to row number h1 on the screen depends on the display area of ​​the page on the screen. As shown in Figure 1(a), if the display area of ​​the page on the screen is the entire display area of ​​the screen, the display position of the sub-content corresponding to row number h1 on the screen is the top of the display area of ​​the screen. As shown in Figure 1(b), if the display area of ​​the page on the screen is the lower half of the entire display area of ​​the screen, the display position of the sub-content corresponding to row number h1 on the screen is the top of the lower half of the screen, that is, it can be located in the middle of the screen.

[0037] Currently, the contents of multiple pages are displayed on the screen in two forms: pagination and waterfall.

[0038] like Figure 2 As shown, Figure 2 A schematic diagram of the paging format is shown. Multiple pages of content are displayed on the screen in pages, and each page enables the content of the page to be fully displayed on the screen. Then, when the user clicks the operation button corresponding to the next page or the previous page, the next page or the previous page of the current page can be displayed on the screen. Therefore, when the user processes the content on the page, after completing the processing of the content of the current page, he can click to enter the next page to process the content of the next page.

[0039] However, there is a drawback that users have to operate frequently when processing paginated content. If the amount of content processed by the user is large and the user processes it quickly, if the amount of content on a single page is too small, the business personnel will frequently turn pages. Especially in the scenario where the user processes content through the keyboard, the business personnel will have to frequently use the mouse to click the next page button to enter the next page of the current page. The user needs to constantly switch between the mouse and the keyboard, which is cumbersome.

[0040] like Figure 3 As shown, Figure 3 The schematic diagram of the waterfall flow is shown. That is, the waterfall flow is a waterfall flow of the scrolling screen, that is, JavaScript determines whether the last few contents of the current page are about to be processed. If the processed content is about to be the content at the bottom of the page, the next page content will be automatically loaded to the bottom of the page, achieving the effect of loading content without manual page switching. Figure 3As shown, the display interface includes a scroll bar, and the scroll bar's up and down scrolling operation can realize the screen scrolling operation, so that the content of different pages can be displayed on the screen. Among them, the screen scrolling operation, that is, the control of the scroll bar can be through an input device such as a mouse, a keyboard or a touch screen. When the screen is a touch screen, the user can directly input a sliding gesture on the screen to realize the screen scrolling operation, for example, sliding up or sliding down. However, in the existing method of controlling the scrolling operation of the screen, the scrolling distance is often fixed. For example, the number of mouse scrolling steps is in a certain relationship with the screen scrolling distance. For example, if the mouse scrolls 10 steps, the screen moves up or down 100 pixels.

[0041] Therefore, when the page is switched or scrolled, based on the current page scrolling operation, the content of the page after the current page is displayed on the screen. Specifically, the content to be displayed will be displayed on the screen after the rendering is completed. Figure 4 As shown, Figure 4 The image rendering process is shown. The CPU obtains the image content to be displayed sent by the client, obtains the decoded image data after decoding, and sends the image data to the GPU. After the GPU rendering is completed, the rendering result is placed in the frame buffer (FrameBuffer). Of course, it can also be CPU video rendering. Among them, the frame buffer is an interface provided by the operating system for the screen, which allows the upper-level application to directly read and write the display buffer in graphics mode. The framebuffer is a HAL (hardware abstraction layer) corresponding to the screen, which provides an abstract and unified operation interface. The operating system can render the image data in the frame buffer, and then the video controller will read the frame buffer data line by line according to the screen refresh signal (i.e., HSync signal), and pass it to the screen display after digital-to-analog conversion.

[0042] However, the inventors found in their research that if the scrolling speed is too fast or the rendering speed of the display content is too slow, when the display content needs to be displayed, if the display content is not rendered, it will cause white screen, flashing screen, freeze and other phenomena, the fluency is very low, and the user experience is poor.

[0043] Therefore, in order to overcome the above-mentioned defects, the embodiments of the present application provide an image display method, device, electronic device and computer-readable medium to improve the white screen, flickering screen, freeze and other phenomena that occur during the page scrolling display process.

[0044] See also Figure 5 , Figure 5 An image display method provided by an embodiment of the present application is shown. The method is applied to an electronic device, and the electronic device includes a screen. Specifically, the method may include: S501 to S503.

[0045] S501: When a preset image is displayed in a display area, when a page scrolling operation on the display area is detected, target image data to be rendered is determined based on the page scrolling operation.

[0046] As an implementation method, Figure 6 As shown, it is assumed that there are multiple pages that can be displayed in the display area 601, and different contents of different pages can be displayed in the display area 601 through a page scrolling operation, such as Figure 6 As shown, the pages from top to bottom can be named page 1, page 2 and page 3 respectively. The content currently displayed in the display area 601 is the entire image of page 3. If the content of page 2 needs to be displayed in the display area, page 2 needs to be scrolled into the display area through a page scrolling operation. It should be noted that a partial area of ​​page 2 can enter the display area first. At the same time, the size of the area of ​​page 2 entering the display area is consistent with the size of the page area of ​​page 3 that is moved out of the display area. For example, through the page scrolling operation, the bottom 1 / 4 area of ​​page 3 is moved out of the display area, and the bottom 1 / 4 area of ​​page 2 is moved into the display area. Therefore, the top 1 / 4 area of ​​the display area displays the image of the bottom 1 / 4 area of ​​page 2, and the rest of the display area displays the image of the top 3 / 4 area of ​​page 3.

[0047] Therefore, in the case where a preset image is displayed in the display area, a page scrolling operation for the display area can be detected, wherein the preset image can be an image of the entire area of ​​any one of the multiple pages supported for display or an image composed of multiple areas of at least two pages. As an implementation method, each sub-area of ​​each page that can be displayed in the display area corresponds to a position identifier, specifically, the area size of each page matches the size of the display area, and the entire area of ​​the page is divided into multiple rows, for example, divided into N rows, then the area of ​​the page is divided into the 1st row, the 2nd row, the 3rd row... the Nth row, each row corresponds to a sub-page area of ​​the page, and the N-row sub-page areas can be combined into the entire area of ​​the page, that is, each sub-page area corresponds to one or more row numbers, specifically, based on the number of rows contained in each sub-page area. In addition, the display area can also be divided into N rows, so a display area can fully display the image content of N rows of a page, or it can be an image corresponding to N rows of sub-page areas composed of multiple rows of multiple pages, so based on the position identifier of each sub-page area in the page, the position of each sub-page area of ​​each page in the multiple page arrangement can be determined.

[0048] Based on the position identifier, the target image data to be rendered can be determined. Specifically, when a page scrolling operation for the display area is detected, the scrolling distance corresponding to the page scrolling operation is determined, and the position identifier of the preset page area corresponding to the preset image is determined. For example, assuming that the page scrolling direction is scrolling downward, that is, the new content enters the display area from the top of the display area. Based on the page scrolling direction, it can be determined that the scrolling direction of multiple pages is scrolling in descending order based on the page number. For example, the currently displayed page is page 10. With the page scrolling operation, page 9, page 8, page 7, and page 1 are scrolled into the display area in sequence. Then, the position of the preset page area corresponding to the preset image currently displayed in the display area in the multiple page arrangement can be used as the starting position. Assuming that the starting position is the x1th row of page 3, which is the topmost sub-page area of ​​page 3, then the scrolling distance corresponding to the page scrolling operation is determined. Assuming that the page scrolling operation is a sliding operation input by the user into the display area, the sliding distance of the sliding operation is determined. For example, the sliding distance is s rows (that is, the number of rows is s), so that it can be determined that the scrolling length of the page area determined based on the page scrolling operation is also s rows. For example, the starting position is the x1th row of page 3, the determined end position is the x2th row of page 2, and the distance between the x1th row of page 3 and the x2th row of page 2 may be equal to s rows. Assuming that the display area currently displays a preset image, and the display position of the preset image in the display area is the first position, then after the scrolling distance of s rows, the image corresponding to the page area of ​​the x2th row of page 2 may be displayed at the first position of the display area.

[0049] Therefore, based on the position identifiers of each sub-area of ​​each page and the scrolling distance of the page triggered by the page scrolling operation, it is possible to determine the content that needs to be displayed in the display area in addition to the currently displayed preset image, that is, the target page area after the preset page area corresponding to the preset image can be determined through the page scrolling operation, and the image data corresponding to the target page area is used as the target image data to be rendered. Figure 7 As shown, assuming that the scroll distance is D, the target image data to be rendered is the image data corresponding to the page area with a height of D' after the preset page area (assuming that it is the entire area of ​​page 3) of the currently displayed preset image, where D and D' are the same, as shown in Figure 7 As shown, the determined target image data to be rendered is the image data corresponding to the page area with a height of D′ in the bottom area of ​​page 2 .

[0050] As another implementation method, in order to obtain better scrolling smoothness, a method of caching certain image data is often adopted. That is, when a preset image is displayed in the display area, the buffer image corresponding to the preset image is also rendered. When determining the target image data to be rendered, after determining the starting position in the above manner, the end position is determined based on the starting position, the scrolling distance and the area position corresponding to the buffer image, such as Figure 7 As shown, assuming that the size of the area corresponding to the buffer image is M lines, then based on the starting position, along the page scrolling direction, the position of M lines and the scrolling distance is determined backward as the end position. Assuming that the scrolling distance is X lines, the image data in the area of ​​X lines before the end position is used as the target image data to be rendered, and the area of ​​X lines before the end position is used as the target page area, as shown in Figure 7 The area in D' shown is the target page area, which will not enter the display area immediately when the preset image moves out of the display area, but will display the target image when the image in the first area of ​​the buffered image is moved out of the display area and the target page area enters the display area. The image below the display area 601 represents the content that is moved out of the display area.

[0051] Specifically, the method of determining the target image data to be rendered may refer to the subsequent embodiments, which describe implementation methods for determining the target image data to be rendered based on the sliding distance or the image that slides out of the display area.

[0052] S502: Perform a second rendering operation on the target image data.

[0053] As an implementation, the electronic device may perform a first rendering operation and a second rendering operation, and the execution timings of the first rendering operation and the second rendering operation may be different or the same. Specifically, after the target image data is determined, the second rendering operation is performed on the target image data, and the timing of performing the first rendering operation on the target image data may be before the page scrolling operation is detected or after the target image data is determined.

[0054] In some embodiments, the first rendering operation may be performed after the target image data is determined. For example, the multiple pages corresponding to the page scrolling operation are pages acquired in real time. For example, the page is a web browsing page, and the content of the page needs to be downloaded from the network before display. In other embodiments, the multiple pages corresponding to the page scrolling operation are acquired in advance, so the first rendering operation may be performed when the image data of the page is acquired. Specifically, the subsequent embodiments will expand on the description of these two methods.

[0055] It should be noted that the first rendering operation is used to process the target image data to obtain a first image, and the second rendering operation is used to process the target image data to obtain a second image. Specifically, both the first rendering operation and the second rendering operation can perform operations such as texture rendering on the target image data to obtain a rendered image, but the processing speeds of the first rendering operation and the second rendering operation are different, and the processing speed of the first rendering operation is higher than the processing speed of the second rendering operation. Specifically, the processing objects of the first rendering operation and the second rendering operation may be the same, that is, the first rendering operation and the second rendering operation both process all the target image data, but the computational complexity of the rendering algorithms of the first rendering operation and the second rendering operation is different. For example, the first rendering operation compresses the target image data before rendering, while the second rendering operation does not compress the target image data. For another example, the second rendering operation optimizes the display effect of the target image data, while the first rendering operation does not perform the optimization operation.

[0056] In addition, the processing objects of the first rendering operation and the second rendering operation may be different, that is, the first rendering operation processes the first part of the target image data, and the second rendering operation processes the second part of the target image data, the first part of the data is smaller than the second part of the data, for example, the second part of the data is the complete target image data, and the first part of the data is the image data corresponding to the target object in the target image, the target object may be an image of a target object of a specified type in the target image, for example, the target object area in the target image may be determined, and then the image data corresponding to the target object area is used as the image data corresponding to the target object in the target image, so that only the image data corresponding to the target object is rendered to obtain the first image, although the first image does not include all the contents of the target image, if the target object is the content that the user is more concerned about, the rendering speed of the image can be accelerated in the case of losing the integrity of the image. Specifically, the target object in the image captured by the image acquisition device is identified and the target object is classified, specifically, the target object may be acquired by using a target detection algorithm or a target extraction algorithm. Specifically, all contour line information in the image captured by the image acquisition device may be extracted through target extraction or clustering algorithm, and then the category of the object corresponding to each contour line is found in the pre-learned model, wherein the learning model uses a matching database, and the matching database stores multiple contour line information and the category corresponding to each contour line information, wherein the category includes human body, animal, mountain, river, lake, building, road, etc.

[0057] S503: In response to detecting that the target page area corresponding to the target image data slides to the display area, if the second image has not been rendered and the first image has been rendered, display the first image in the display area.

[0058] It should be noted that when the display area displays the contents of different pages or different areas of the same page, the corresponding contents in the display area correspond to different area positions. For example, as the page scrolling operation continues, based on the page loading order, the contents of the page areas after the preset page areas corresponding to the preset image enter the display area in sequence. For example, when page 1 is displayed in the display area, the first page area of ​​page 1 is located in the display area. When page 2 is displayed in the display area, the second page area of ​​page 2 is located in the display area. Therefore, when the target page area slides to the display area, the rendered image of the target image data corresponding to the target page area needs to be displayed in the display area.

[0059] Specifically, when it is detected that the target page area corresponding to the target image data slides to the display area, the electronic device determines whether the second image and the first image have been rendered, and if the second image has not been rendered and the first image has been rendered, the first image is displayed in the display area, specifically, the target display position corresponding to the target page area in the display area is determined, and then the first image is displayed at the target display position. If the second image has been completed, the second image is displayed in the display area.

[0060] Therefore, in the case of displaying a preset image in the display area, when a page scrolling operation for the display area is detected, the target image data to be rendered is determined based on the page scrolling operation, and then the first rendering operation and the second rendering operation are respectively performed on the target image data. When it is detected that the target page area corresponding to the target image data slides to the display area, if the second rendering operation has not been rendered and the first rendering operation is completed, the first image rendered by the first rendering operation is displayed in the display area. Since the operation speed of the first rendering operation is faster than the processing speed of the second rendering operation, the first rendering operation has been completed when the second rendering operation has not been rendered, and the first image obtained by the first rendering operation can be displayed in the display area. Therefore, it can be avoided that when the target page area corresponding to the target image data to be rendered slides to the display area, the second image cannot be displayed due to the incomplete rendering of the second image, causing a jam.

[0061] See also Figure 8 , Figure 8 An image display method provided by an embodiment of the present application is shown. The method is applied to an electronic device, and the electronic device includes a screen. Specifically, the method may include: S801 to S804.

[0062] S801: When a preset image is displayed in a display area, when a page scrolling operation on the display area is detected, target image data to be rendered is determined based on the page scrolling operation.

[0063] As an implementation mode, the display area of ​​the screen of the electronic device can be divided into a plurality of sub-areas. When the page is scrolled, the target image data to be rendered is determined based on the plurality of sub-areas. For example, a preset image is displayed in the display area. As described above, each of the plurality of pages is divided into a plurality of sub-page areas, and each sub-page area corresponds to a sub-area of ​​the display area. For example, each page has the same size, such as the display area can be a rectangle including a first side and a second side, the direction of the second side is consistent with the left-right direction of the screen of the electronic device, and the first side is consistent with the direction between the top and the bottom of the screen of the electronic device, that is, the first side can be the height of the display area, and the second side can be the width of the display area. Each page area corresponds to a sub-area, that is, a page area has the same size as a sub-area. For example, the page area includes a first length and a second length, the first length is in the same direction as the first side, and the first length of the page area is consistent with the length in the direction of the first side of the sub-area, that is, the first length of the page area is the height, the height of the page area is the same as the height of the sub-area, and the width of the page area is the same as the width of the sub-area.

[0064] like Fig. 9 As shown, assuming that the overall area of ​​the screen of the electronic device includes a top display area 602, a bottom display area 603 and a display area 601, the display area 601 can be divided into four sub-areas, namely, a first sub-area, a second sub-area, a third sub-area and a fourth sub-area, wherein the top display area 602 and the bottom display area 603 may not be part of the display area 601. Specifically, the top display area 602 may display some fixed content, such as display time, signal strength, signal type and other information, and the bottom display area 603 may display the controls of the APP corresponding to the page. That is to say, the top display area 602 and the bottom display area 603 are basically unchanged relative to the contents of multiple pages. Fig.10As shown, the page is divided into four sub-page areas, namely the first sub-page area, the second sub-page area, the third sub-page area and the fourth sub-page area. When the page is fully displayed in the display area, the first sub-page area is displayed in the first sub-page area, the second sub-page area is displayed in the second sub-page area, the third sub-page area is displayed in the third sub-page area, and the fourth sub-page area is displayed in the fourth sub-page area. When the page is slowly scrolled to the display area until it is fully displayed in the display area, the fourth sub-page area of ​​the page first enters the first sub-area of ​​the display area, and then the fourth sub-page area slowly moves to the fourth sub-area, and the other sub-page areas also gradually move into the display area.

[0065] Therefore, the target image to be displayed can be determined by setting the scrolling distance of the page scrolling operation and the scrolling distance of each sub-page area of ​​the page in the display area. For example, if the scrolling distance is two sub-page areas, the target image data to be rendered is the image data in the two sub-page areas after the sub-page area corresponding to the preset image currently displayed in the display area.

[0066] As an implementation method, a buffer can be set to store the rendered images of each page. In one embodiment, a drawing buffer can be defined, and the drawing buffer can be the aforementioned Figure 4 The frame buffer in, specifically, the aforementioned Figure 4 The buffer in the drawing buffer can be defined as a native buffer. The images that each client needs to display need to be input into the native buffer after rendering. When the images need to be displayed, the electronic device takes them out from the native buffer and displays them based on screen refresh. As an implementation, the drawing buffer can be a buffer outside the native buffer, and the rendering of the image data in the drawing buffer is equivalent to off-screen rendering.

[0067] As an implementation method, when an electronic device needs to display an image, the image data is sent to a buffer queue. After the rendering is completed in the buffer queue, the buffer queue sends the rendered image to the drawing buffer for storage. Then, the drawing buffer sends the rendered image to the native buffer to wait for display. In order to avoid that when the page is scrolled, the rendering operation is not timely enough, resulting in the image in at least one sub-page area of ​​a page not being rendered when the image in the sub-page area needs to be displayed, a part of the image data can be cached in the page.

[0068] Specifically, the area size of the drawing buffer is set to be larger than the area size of the display area. For example, taking a graffiti or drawing scene as an example, it is assumed that the width of a canvas is defined as w and the height is defined as h. The size of the canvas is consistent with the size of the display area. The size of each sub-area is w*h', where h' is h / 4. The area size of the drawing buffer is w*H, where H is n times h. For example, n is a rational number greater than 1. In the embodiment of the present application, n is 2, that is, the width of the drawing buffer is consistent with the width of the canvas, and the height is twice the height of the canvas. Then, an infinite canvas is defined, so that the image content of multiple pages to be displayed can be mapped to the infinite canvas. It should be noted that the infinite canvas can be a logical concept, not a canvas of infinite height, but the height of the infinite canvas can be much larger than the height of a canvas. For example, the height of the infinite canvas can be a specified multiple of the height of a canvas. For example, the specified multiple can be 10. Specifically, the infinite canvas can be regarded as a larger canvas formed by splicing multiple canvases in the height direction, and the position coordinates can be set for the infinite canvas, that is, each canvas in the infinite canvas can be divided into multiple sub-page areas, each sub-page area corresponds to a position mark, and each canvas corresponds to a page. Therefore, different sub-page areas of different pages can correspond to a position mark on the infinite canvas. When the display area of ​​the screen displays different page contents, the position mark on the infinite canvas corresponding to the display area is also different. Fig.11 As shown, the drawing buffer is used to save the content currently browsed by the user, that is, the aforementioned preset image. For example, the user is currently inputting content in the operation display area, for example, when inputting graffiti strokes, the content input by the user is saved in the drawing buffer. Alternatively, when the user is currently browsing a page, for example, when the user is browsing a web page, the content of the page opened by the user is saved in the drawing buffer.

[0069] As an implementation method, the buffer queue sends the image to be rendered to the drawing buffer for storage after rendering. The drawing buffer first inputs the rendered image into the aforementioned native buffer, and then the native buffer displays it on the screen. The method of not directly rendering on the screen can improve the performance of the electronic device and save memory consumption. Specifically, assuming that the user draws 1000 strokes, each stroke drawn will respond to a drawcall instruction when it is displayed on the screen, where the draw call is the CPU calling the image programming interface (such as the glDraw Elements command of OpenGL) to command the GPU to perform rendering. Therefore, when drawing the 1001th stroke, if it is rendered directly to the screen, it is necessary to render the 1001 strokes to the screen, and there are 1001 draw calls. If it is rendered to the drawing buffer first, and then the content of the drawing buffer is rendered to the screen, then there are only 2 draw calls, namely the draw calls corresponding to the first 1000 strokes and the latest draw call corresponding to the 1001st stroke.

[0070] As an implementation method, in order to balance performance and memory, the size of the drawing buffer is L times the canvas. When the preset image is displayed in the display area, the preset image is stored in the drawing buffer. The drawing buffer also stores a buffer image, and the size of the buffer image is (L-1) times the canvas size. For example, L is 2. Assuming that the preset image is the entire content of page 10 and the buffer image is the entire content of page 9, the page scrolling can be made smoother by pre-storing the content of two pages. It should be noted that when the preset image is displayed in the display area, the buffer image corresponding to the preset image is rendered in the drawing buffer, so that when the page scrolling operation is detected, the preset image and the buffer image have been rendered. For example, the preset image is the content of page 10, the buffer image is the content of page 9, and the scrolling direction of the page scrolling operation is based on the decreasing direction of the page number, that is, page 10 slowly slides out of the display area, and the content of page 9 slowly slides into the display area. When the sub-page area of ​​page 9 slides into the display area, the image of page 9 has been rendered and will not cause jamming.

[0071] It should be noted that the buffered image can be pre-acquired user input content (e.g., strokes), or a web page browsed by a user, and the buffered page can be content pre-downloaded through the network. In addition, the buffered image can be determined based on the currently displayed preset image, for example, determining whether the preset sub-page area corresponding to the preset image is the last sub-page area, and if so, determining the buffered image from the page after the preset sub-page area based on the page loading order, and if the preset sub-page area is not the last sub-page area, determining the scrolling direction of the previous page scrolling operation, recorded as the historical scrolling direction, and determining the buffered image from the page after the preset sub-page area based on the historical scrolling direction.

[0072] The buffer queue corresponds to the drawing buffer, that is, the image rendered by the buffer queue is sent to the drawing buffer for storage. Specifically, the buffer queue includes multiple sub-buffers. It can be understood that the buffer queue is used to perform rendering operations on the image data in the drawing buffer, and the rendered image is returned to the drawing buffer. As an implementation method, the width of each sub-buffer is w, the height is h / x, and the number of sub-buffers is 2x, for example, x is 4. The buffer queue corresponds to the drawing buffer, and contains 8 sub-buffers. The width of each sub-buffer is the same as the width of the canvas, and the height is one quarter of the height of the canvas. When the canvas scrolls, the contents of the 8 sub-buffers are updated in a cyclic scrolling. Therefore, local updates have better performance. Specifically, the correspondence between the sub-buffers, infinite canvas, and display area is as follows: Fig.12 As shown, assuming that the preset image displayed in the display area is the content of the 10th page, the positions of multiple pages on the infinite canvas are represented by regional coordinates. For example, {(0, Y1), (w, Y2)} is the regional coordinate corresponding to the first sub-page area of ​​the 10th page on the infinite canvas. The regional coordinate includes a first coordinate and a second coordinate. The first coordinate is the coordinate of the first vertex of the sub-page area, and the second coordinate is the coordinate of the second vertex of the diagonal of the first vertex. Specifically, the page corresponds to a width direction and a height direction. For example, the x-axis direction of the infinite canvas is the width direction, and the y-axis direction is the height direction. The width direction and the height direction are as shown in FIG. Fig.12 In the x and y directions shown, the first vertex of each sub-page area is the point with the smallest width and height in the sub-page area, and the second vertex of each sub-page area is the point with the largest width and height. For a page, the difference between the minimum value in the y direction and the maximum value in the y direction of the page is equal to h. For example, for page 10, the difference between Y1 and Y5 is h, that is, the difference between the height value of the first vertex of the first sub-page area of ​​each page and the height value of the second vertex of the fourth sub-page area of ​​the page is h.

[0073] Therefore, the first sub-area of ​​the display area corresponds to the first sub-page area of ​​the 10th page of the infinite canvas (its corresponding position coordinates are {(0,Y1),(w,Y2)}), the second sub-area of ​​the display area corresponds to the second sub-page area of ​​the 10th page of the infinite canvas (its corresponding position coordinates are {(0,Y2),(w,Y3)}), the third sub-area of ​​the display area corresponds to the third sub-page area of ​​the 10th page of the infinite canvas (its corresponding position coordinates are {(0,Y3),(w,Y4)}), and the fourth sub-area of ​​the display area corresponds to the fourth sub-page area of ​​the 10th page of the infinite canvas (its corresponding position coordinates are {(0,Y4),(w,Y5)}). Based on this correspondence, the electronic device can clearly display the content of each sub-area of ​​the display area. The buffer queue includes multiple sub-buffers. For example, 8 sub-buffers are labeled Buffer0, Buffer1, Buffer2, Buffer3, Buffer4, Buffer5, Buffer6, and Buffer7. The sub-page areas corresponding to the 8 sub-buffers are Buffer0 corresponding to the first sub-page area of ​​page 10, Buffer1 corresponding to the second sub-page area of ​​page 10, Buffer2 corresponding to the third sub-page area of ​​page 10, Buffer3 corresponding to the fourth sub-page area of ​​page 10, and Buffer4 corresponding to the first sub-page area of ​​page 9. Area (its corresponding position coordinates are {(0,Y5),(w,Y6)}), Buffer5 corresponds to the second sub-page area of ​​page 9 (its corresponding position coordinates are {(0,Y6),(w,Y7)}), Buffer6 corresponds to the third sub-page area of ​​page 9 (its corresponding position coordinates are {(0,Y7),(w,Y8)}), Buffer7 corresponds to the fourth sub-page area of ​​page 9 (its corresponding position coordinates are {(0,Y8),(w,Y9)}), each sub-buffer is responsible for performing rendering operations on the image data in the corresponding sub-page area, and then sending the rendered image to the drawing buffer for storage. For example, the electronic device determines that the first sub-area of ​​the display area needs to display the image of the first sub-page area of ​​page 10. According to the corresponding relationship between the various sub-page areas and sub-buffers of the aforementioned infinite canvas, the rendered image can be clearly obtained from Buffer0.

[0074] Specifically, when a page scrolling operation occurs, the above-mentioned corresponding relationship will change. Specifically, assuming that the page scrolling operation is a sliding gesture, the sliding distance corresponding to the page scrolling operation is determined, and the sliding distance is recorded as offset. Assuming that the position corresponding to the specified sub-area of ​​the display area on the infinite canvas is the starting position, the area coordinates corresponding to the starting position are {(0,y1),(w,y2)}, and the values ​​of y1 and y2 in {(0,y1),(w,y2)} can refer to the aforementioned sub-page area, wherein the specified sub-area can be the rearmost sub-area in the display area along the page scrolling direction. For example, the page scrolling direction is from top to bottom, and the specified sub-area is the topmost sub-area of ​​the display area, that is, the fourth sub-area, and the determined end position is {(0,y1-A),(w,y2-A)}, wherein A is set based on the offset. For example, A can be ±offset, which depends on the change law of the area coordinates of each sub-page area of ​​the infinite canvas and is also based on the page scrolling direction. It should be noted that, in the case of the existence of the buffered image, based on the page loading order, the image data in the first designated area after the buffered sub-page area is used as the target image data to be rendered, and the first length of the first designated area is the same as the sliding distance, and the first length is the length along the first side. The first length can be a height, specifically, A is ±(BH+offset), where BH is the height of the sub-page area corresponding to the buffered image. In this way, the target image data to be rendered can be determined.

[0075] It should be noted that the image data of the preset image currently displayed in the display area and the image data of the buffered image corresponding to the preset image are stored in the buffer queue and the rendering operation is performed. After the rendering is completed, the preset image and the buffered image will be stored in the drawing buffer.

[0076] In addition, if the preset image currently displayed in the display area does not correspond to the home page or the last page, the four middle sub-buffers of the buffer queue can be used to store the preset image data, the top two sub-buffers can be used to store the image data corresponding to the last two sub-page areas (based on the page number) of the preset page area of ​​the preset image, and the bottom two sub-buffers can be used to store the image data corresponding to the first two sub-page areas (based on the page number) of the preset page area of ​​the preset image. For example, if the preset image currently displayed in the display area is the content of page 9, then Buffer2, Buffer3, Buffer4 and Buffer5 of the buffer queue store the image data of the first sub-page area of ​​page 9, the image data of the second page area of ​​page 9, the image data of the third page area of ​​page 9, and the image data of the fourth page area of ​​page 9 in sequence, Buffer6 and Buffer7 store the image data of the first page area of ​​page 8 (the corresponding position coordinates are {(0,Y9), (w,Y10)}) and the image data of the second page area of ​​page 8 (the corresponding position coordinates are {(0,Y10), (w,Y11)}) in sequence, and Buffer1 and Buffer0 store the image data of the fourth page area of ​​page 10 and the image data of the second page area of ​​page 10 in sequence. Thus, the content currently displayed in the display area is in the buffers in the middle of the buffers opposite to each other, and at least half of the content of the pages before and after the content currently displayed is stored in the buffer queue. Thus, the value of BH is determined by: based on the page scrolling direction, the height of the buffer image after the page corresponding to the image currently displayed in the display area is determined as the BH. For example, the page corresponding to the image currently displayed in the display area is page 9, and the page scrolling direction is in the descending direction of the page number. Then the buffered image after the page corresponding to the image currently displayed in the display area is the first page area and the second page area of ​​page 8, so the value of BH is h / 2.

[0077] See also Fig.13 , assuming that the sliding distance of the page scrolling operation is h / 2, the height of the buffered image is h, and the height of the buffer queue is 2h. Fig.12Based on , the first sub-page area and the second sub-page area of ​​the 10th page both slide out of the display area, so the images corresponding to the first sub-page area and the second sub-page area are not displayed in the display area. Since the sliding distance is h / 2, the first sub-page area and the second sub-page area of ​​the 9th page enter the display area. Therefore, the content displayed in the display area is that the first sub-page area displays the image corresponding to the third sub-page area of ​​the 10th page, the second sub-page area displays the image corresponding to the fourth sub-page area of ​​the 10th page, the third sub-page area displays the image corresponding to the first sub-page area of ​​the 9th page, and the fourth sub-page area displays the image corresponding to the second sub-page area of ​​the 9th page. Since the first sub-page area and the second sub-page area of ​​the 10th page both slide out of the display area, and based on Fig.12 It can be determined that the sub-buffer queues corresponding to the first sub-page area and the second sub-page area of ​​page 10 are Buffer0 and Buffer1 respectively, so the image data of Buffer0 and Buffer1 can be cleared. The sliding distance is h / 2, and the buffer image is the image corresponding to all sub-page areas of page 9. Then the area after page 9 with a height of h / 2 and a width of w can be used as the target page area (i.e., the target page area after page 9 determined based on the page scrolling direction). For example, the page scrolling direction is scrolling in the direction of decreasing page numbers, and the image data corresponding to the target page area is the target image data to be rendered. That is to say, the first sub-page area and the second sub-page area of ​​page 8 are used as the target page area, and Buffer0 is re-corresponded to {(0,Y9),(w,Y10)}, and Buffer1 is re-corresponded to {(0,Y10),(w,Y11)}. It should be noted that after the page sliding operation is detected, it can be determined that the page sliding operation meets the specified conditions, and the target image data to be rendered corresponding to the page sliding operation is sent to the target sub-buffer of the buffer queue, and the data previously stored in the target sub-buffer is cleared. Specifically, when it is determined that the page sliding operation satisfies the specified conditions, the target image data to be rendered is determined based on the page sliding operation, and the target sub-buffer corresponding to the target image data is determined based on the aforementioned method, that is, the sub-page area moved out of the display area is determined, and the sub-buffer corresponding to the sub-page area is used as the target sub-buffer. Among them, the page sliding operation satisfies the specified conditions may be that the sliding distance is greater than or equal to the specified distance, or the sliding time of the page sliding operation is greater than the specified duration. In an embodiment of the present application, the sliding distance corresponding to the page sliding operation is determined. If the sliding distance is greater than or equal to the specified distance, it is determined that the page sliding operation satisfies the specified conditions. Among them, the specified distance can be the height of a specified number of sub-page areas, for example, the specified number can be 2.

[0078] S802: Send the target image data to the buffer queue, and perform a second rendering operation on the target image data in the buffer queue.

[0079] As an implementation mode, the rendering operation performed on the image data in the buffer queue is defined as a second rendering operation. The picture quality of the image obtained after the second rendering operation is rendered is better, that is, it can meet the user's preset standards. Considering that the picture quality is negatively correlated with the processing speed of the second rendering operation, that is, the higher the picture quality, the slower the processing speed of the second rendering operation, so, in order to avoid the situation where the second rendering operation is not rendered and the rendered image is not displayed, resulting in a jam, a fuzzy buffer can be set so that the first rendering operation can be performed on the image data in the fuzzy buffer. It can be seen from the aforementioned embodiment that the processing speed of the first rendering operation is higher than that of the second rendering operation. Therefore, it can be better to avoid the phenomenon of jamming caused by the second rendering operation not being rendered.

[0080] As an implementation mode, assuming that the pages operated by the page scrolling operation are multiple pages that the electronic device has already acquired, for example, the multiple pages are pages that the electronic device has downloaded from the network in advance, or pages that the user has drawn by graffiti or drawing based on the preset APP of the electronic device, then before determining the target image data to be rendered based on the page scrolling operation, the electronic device can acquire the image data of the multiple pages, and then send the image data of the multiple pages to the fuzzy buffer, and perform the first rendering operation on the image data of each page in the fuzzy buffer. That is, when the electronic device acquires the page, it performs the first rendering operation, and the image rendered by the first rendering operation is stored in the fuzzy buffer.

[0081] As another implementation, the first rendering operation may be performed after the target image data is determined. Specifically, after the target image data to be rendered is determined based on the page scrolling operation, and in response to detecting that the target page area corresponding to the target image data slides to the display area, if the second image has not been rendered and the first image has been rendered, before the first image is displayed in the display area, the target image data is sent to a fuzzy buffer, and the first rendering operation is performed on the target image data in the fuzzy buffer.

[0082] In some embodiments, the image quality of the first image obtained by the first rendering operation is lower than the image quality of the second image obtained by the second rendering operation. Specifically, the processing objects of the first rendering operation and the second rendering operation are the same, that is, all the data of the target image data to be rendered. The difference is that the second rendering operation performs display enhancement processing and renders the second image, and the first rendering operation does not perform display enhancement processing but directly renders the target image data to obtain the second image. Among them, the display enhancement processing can be a parameter optimization of the image to be displayed, wherein the parameters include clarity, sharpness, lens distortion, color, resolution, color gamut range and purity, etc., which determine the image quality. In the implementation of this application, the parameter optimization of the image includes at least one of exposure enhancement, denoising, edge sharpening, contrast increase or saturation increase. Among them, exposure enhancement is used to increase the brightness of the image, and the brightness value of the area where the brightness value is overlapped can be increased through the histogram of the image. In addition, the brightness of the image can also be increased through nonlinear superposition. Image data denoising is used to remove image noise. Specifically, images are often degraded due to interference and influence of various noises during generation and transmission, which will have an adverse effect on subsequent image processing and image visual effects. There are many types of noise, such as electrical noise, mechanical noise, channel noise and other noises. Therefore, in order to suppress noise, improve image quality and facilitate higher-level processing, images must be pre-processed for denoising. Specifically, images can be denoised by using a Gaussian filter, where the Gaussian filter is a linear filter that can effectively suppress noise and smooth images. Its working principle is similar to that of the mean filter, and both take the mean of the pixels in the filter window as the output. The coefficient of its window template is different from that of the mean filter. The template coefficient of the mean filter is the same as 1; while the template coefficient of the Gaussian filter decreases as the distance from the center of the template increases. Therefore, the Gaussian filter has a smaller degree of image blur than the mean filter. In addition, edge sharpening is used to make blurred images clearer.

[0083] In some other embodiments, the image quality of the first image obtained by the first rendering operation is lower than the image quality of the second image obtained by the second rendering operation. Specifically, the resolution of the first image obtained by the first rendering operation is lower than the resolution of the second image obtained by the second rendering operation. That is, the first rendering operation includes: reducing the resolution of the target image data and rendering the target image data with the reduced resolution to obtain the first image, and the second rendering operation includes keeping the resolution of the target image data unchanged and rendering the target image data to obtain the second image.

[0084] like Fig.14As shown, the fuzzy buffer includes multiple sub-fuzzy areas, each of which corresponds to a canvas of the infinite canvas, that is, each sub-fuzzy area is used to compress and save the image of the page corresponding to a canvas. Specifically, each sub-fuzzy area is the size of the canvas after proportional compression, and the compression ratio can be 1:10. That is to say, assuming that the page content input by the user (for example, the image input under graffiti or drawing) is obtained, the image of the page is sent to the fuzzy buffer, and the images of each page are compressed according to the aforementioned compression ratio to obtain compressed image data, and then the compressed image data is rendered. For example, the size of the canvas is 1080*1920, and the resolution of the compressed image is 108*192. The second rendering operation keeps the resolution of the target image data unchanged, so the resolution of the obtained second image is 1080*1920.

[0085] It should be noted that the buffer queue includes multiple sub-buffers, and the electronic device can perform the second rendering operation on each sub-buffer without having to perform the second rendering operation on all images in the buffer queue, which can improve the execution efficiency of the second rendering operation.

[0086] S803: In response to detecting that the target page area corresponding to the target image data slides to the display area, if the second image has not been rendered and the first image has been rendered, display the first image in the display area.

[0087] Since the image quality of the first image after the target image data is rendered by the first rendering operation is lower than the image quality of the second image after the target image data is rendered by the second rendering operation, the rendering speed of the first image is higher than that of the second image. Therefore, the target page area can be slid to the display area, and the first image can be displayed in the display area when the second image is not rendered.

[0088] Assume that the first sub-page area {(0,Y9),(w,Y10)} of page 8 is used as the target page area, that is, the image data of the first sub-page area of ​​page 8 is used as the target image data, and Buffer0 of the buffer queue stores the target image data. The processor of the electronic device performs a second rendering operation on the target image data in Buffer0. If the rendering is completed, the rendered second image will be sent to the drawing buffer. The drawing buffer waits for a display instruction (draw call) to display the second image at the display position corresponding to the first sub-page area in the display area. Therefore, when the first sub-page area of ​​page 8 is moved to the display area, that is, when the first sub-area of ​​the display area corresponds to {(0,Y9),(w,Y10)} of the infinite canvas, that is, when the first sub-area is used to display the image of the first sub-page area of ​​page 8, the electronic device will determine whether the second image exists in the drawing buffer. If not, the first image will be displayed in the first sub-area.

[0089] It should be noted that, in some embodiments, if the contents of multiple pages are input by the user, all image data from the first page to the last page are sent to the fuzzy buffer to perform the first rendering operation when the image data is generated. For example, when the user is scribbling, he starts inputting strokes from the first page until he inputs to the tenth page, then the image data of all pages will be sent to the fuzzy buffer to perform the first rendering operation. Therefore, the aforementioned implementation method of "sending the target image data to the fuzzy buffer, and performing the first rendering operation on the target image data in the fuzzy buffer" can also be to determine whether the target image data has been successfully rendered and the first image has been generated. If so, "sending the target image data to the fuzzy buffer, and performing the first rendering operation on the target image data in the fuzzy buffer" is not performed. Otherwise, "sending the target image data to the fuzzy buffer, and performing the first rendering operation on the target image data in the fuzzy buffer" is performed.

[0090] S804: When rendering of the second image is completed, if the first image is still in the display area, the first image is replaced by the second image.

[0091] As an implementation mode, a second rendering operation is specified for target image data in a buffer queue. After the second rendering operation is completed to obtain a second image, the buffer queue sends the second image to a drawing buffer for storage. Therefore, when determining whether the second image is rendered, it is determined whether the second image exists in the drawing buffer. If the second image does not exist, the first image that has been rendered in advance is displayed in the display area. If the second image exists, the second image is sent to a frame buffer. The second image in the frame buffer is displayed in the display area based on a screen refresh signal.

[0092] When the rendering of the second image is completed, the electronic device determines whether the first image is still displayed in the display area. If not, the second image may be discarded. Of course, the second image may be kept within a preset time period. Specifically, a buffer area may be set up and named as an image temporary storage area. The second image is stored in the image temporary storage area. It is detected whether the scrolling direction of the page scrolling operation changes within the preset time period. If a change in the scrolling direction of the page scrolling operation is detected, the second image is displayed at the display position in the display area corresponding to the target page area when it is continuously detected that the target page area slides to the display area.

[0093] If the first image is still displayed in the display area, the first image is replaced by the second image. Fig.15 As shown, the target image data is the image data corresponding to the first sub-page area {(0,Y9), (w,Y10)} and the second sub-page area {(0,Y10), (w,Y11)} of the 8th page. When the first sub-page area of ​​the 8th page slides to the display area, the reference Fig.12 and 13 As can be seen from FIG. 15 , the image of the first sub-page area of ​​the 8th page is displayed in the first sub-area of ​​the display area. If the second image is not rendered, the first image is displayed. Fig.15 As shown, the first image is displayed in the first sub-area. It should be noted that the first image displayed in the first sub-area corresponds to Fig.12 and 13 The image data of the first page sub-region of page 8 shown in the figure is an image after the first rendering operation, but, Fig.15 Indicated by thinner lines Fig.12 and 13 The first image obtained after the image of the first page sub-area of ​​page 8 is processed by the first rendering operation, and the resolution of the representation image is compressed. It should be noted that: Fig.15The thinner strips shown are only a way of expressing that the image is compressed, and do not necessarily mean that the image contour will become thinner after being compressed, and no limitation is made here.

[0094] As the page continues to scroll, when the first sub-page area of ​​the 8th page slides to the second sub-page area of ​​the display area, that is, when the second sub-page area of ​​the 8th page slides to the display area, that is, the first sub-area of ​​the display area corresponds to the image of the first sub-page area of ​​the 8th page, and the second sub-area corresponds to the image of the second sub-page area of ​​the 8th page. The image data of the first sub-page area and the second sub-page area of ​​the 8th page have completed the second rendering operation, such as Fig.16 As shown, the second image can be displayed in the display area, specifically, with Fig.15 In contrast, the image of the first sub-page area of ​​page 8 changes from a thinner outline to a Fig.12 and 13 That is, when the image of the first sub-page area of ​​page 8 is displayed in the display area, it has changed from the first image with poor image quality to the second image with better image quality, that is, the image of the first sub-page area of ​​page 8 in the display area has changed from the first image to the second image.

[0095] Therefore, since the preset image and the buffered image have been successfully rendered in the buffer queue after the target image data to be rendered is determined, the second rendering operation may be completed in the process of the preset image and the buffered image sliding in or out of the display area. Even if the rendering is not completed, since the processing speed of the first rendering operation is higher than that of the second rendering operation, the first image selected by the first rendering operation can replace the second image and be displayed in the display area, thereby reducing the jamming phenomenon when the page is scrolled.

[0096] In addition, a rendering buffer twice the size of the drawing area is used to make the canvas slide up and down more smoothly. Multiple sub-rendering buffers are used to partially update the content as the user slides the canvas, taking into account performance and power consumption. In addition, a fuzzy texture is used to save all the graffiti content of the infinite canvas. In the fast scrolling scene, it can greatly reduce the user's waiting for loading delay, avoid white screen, flashing screen, freeze and other phenomena, greatly improve the smoothness of canvas scrolling, and enhance the user experience.

[0097] See also Fig.17 , which shows a structural block diagram of an image display device 1700 provided in an embodiment of the present application. The device may include: a determining unit 1701, a rendering unit 1702 and a display unit 1703.

[0098] The determining unit 1701 is configured to determine target image data to be rendered based on a page scrolling operation for a display area when a preset image is displayed in the display area and the page scrolling operation is detected for the display area.

[0099] The rendering unit 1702 is configured to perform a second rendering operation on the target image data.

[0100] Furthermore, the rendering unit 1702 is also used to obtain image data of multiple pages before determining the target image data to be rendered based on the page scrolling operation, and the multiple pages are the pages used for the page scrolling operation; send the image data of the multiple pages to the fuzzy buffer, and perform a first rendering operation on the image data of each page in the fuzzy buffer.

[0101] Furthermore, the rendering unit 1702 is further configured to send the target image data to a fuzzy buffer, and perform a first rendering operation on the target image data in the fuzzy buffer.

[0102] Display unit 1703 is used for displaying the first image in the display area in response to detecting that the target page area corresponding to the target image data slides to the display area, if the second image has not been rendered and the first image has been rendered, wherein the first image is an image pre-processed based on the target image data by a first rendering operation, the second rendering operation is used to process the target image data to obtain the second image, the processing speed of the first rendering operation is higher than the processing speed of the second rendering operation, and based on the page loading order, the target page area is located after the preset page area corresponding to the preset image.

[0103] Furthermore, the display unit 1703 is also used to determine whether there is a second image in the drawing buffer in response to detecting that the target page area corresponding to the target image data slides to the display area; if the second image does not exist, the pre-rendered first image is displayed in the display area.

[0104] Furthermore, the display unit 1703 is further configured to send the second image to a frame buffer if the second image exists; and display the second image in the frame buffer in the display area based on a screen refresh signal.

[0105] Furthermore, the display unit 1703 is further configured to, when the rendering of the second image is completed, replace the first image with the second image if the first image is still within the display area.

[0106] Further, the image quality of the first image obtained by the first rendering operation is lower than the image quality of the second image obtained by the second rendering operation. The resolution of the first image obtained by the first rendering operation is lower than the resolution of the second image obtained by the second rendering operation. The first rendering operation includes: reducing the resolution of the target image data and rendering the target image data with the reduced resolution to obtain the first image, and the second rendering operation includes keeping the resolution of the target image data unchanged and rendering the target image data to obtain the second image.

[0107] Furthermore, the rendering unit 1702 is further configured to send the target image data to the fuzzy buffer, and perform a first rendering operation on the target image data in the fuzzy buffer; and send the target image data to the buffer queue, and perform a second rendering operation on the target image data in the buffer queue. When a preset image is displayed in the display area, the buffer queue stores a preset image and a buffer image, wherein the buffer image is an image in a buffer page area adjacent to the preset page area.

[0108] The page scrolling operation is a sliding gesture, the display area includes a first side and a second side, and the determination unit 1701 is also used to determine the sliding distance corresponding to the page scrolling operation; based on the page loading order, the image data in the first designated area after the buffer page area is used as the target image data to be rendered, the first length of the first designated area is the same as the sliding distance, and the first length is the length along the first side.

[0109] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0110] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.

[0111] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.

[0112] Please refer to Fig.18, which shows a structural block diagram of an electronic device provided in an embodiment of the present application. The electronic device 100 may be an electronic device capable of running applications, such as a smart phone, a tablet computer, an e-book, etc. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by one or more processors 110, and the one or more programs are configured to execute the method described in the aforementioned method embodiment.

[0113] The processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Optionally, the processor 110 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 110 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but may be implemented separately through a communication chip.

[0114] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). The memory 120 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the electronic device 100 during use.

[0115] Please refer to Fig.19, which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 1900 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.

[0116] The computer readable storage medium 1900 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 1900 includes a non-transitory computer-readable storage medium. The computer readable storage medium 1900 has storage space for program code 1910 that performs any method steps in the above method. These program codes can be read from or written to one or more computer program products. The program code 1910 can be compressed, for example, in an appropriate form.

[0117] Please refer to Fig. 20 , which shows a structural block diagram 2000 of a computer program product provided in an embodiment of the present application. The computer program product 2000 includes a computer program / instruction 2010, and the steps of the above method are implemented when the computer program / instruction 2010 is executed by a processor.

[0118] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. An image display method, characterized in that: include: In a case where a preset image is displayed in a display area, when a page scrolling operation for the display area is detected, determining target image data to be rendered based on the page scrolling operation; Performing a second rendering operation on the target image data, wherein the second rendering operation includes: maintaining a resolution of the target image data unchanged, and rendering the target image data to obtain a second image; In response to detecting that a target page area corresponding to the target image data slides to the display area, if the second image has not been rendered and the first image has been rendered, displaying the first image in the display area, wherein based on a page loading order, the target page area is located after a preset page area corresponding to the preset image; Wherein, before determining the target image data to be rendered based on the page scrolling operation, the method further includes: Acquire image data of a plurality of pages, where the plurality of pages are pages for which the page scrolling operation is used to operate; A first rendering operation is performed on the image data of each page, wherein the first rendering operation includes: reducing the resolution of the target image data, and rendering the target image data with the reduced resolution to obtain a first image.

2. The method according to claim 1, characterized in that After displaying the first image in the display area, the method further includes: In response to the second image being rendered, if the first image is still within the display area, the first image is replaced by the second image.

3. The method according to claim 1 or 2, characterized in that: Performing a second rendering operation on the target image data includes: The target image data is sent to a buffer queue, and a second rendering operation is performed on the target image data in the buffer queue.

4. The method according to claim 3, characterized in that The performing a first rendering operation on the image data of each page includes: The image data of the plurality of pages are sent to a fuzzy buffer, and a first rendering operation is performed on the image data of each page in the fuzzy buffer.

5. The method according to claim 3, characterized in that: The rendered image in the buffer queue is stored in the drawing buffer, and in response to detecting that the target page area corresponding to the target image data slides to the display area, if the second image has not been rendered and the first image has been rendered, the first image is displayed in the display area, including: In response to detecting that a target page area corresponding to the target image data slides to the display area, determining whether a second image exists in the drawing buffer; If the second image does not exist, the pre-rendered first image is displayed in the display area.

6. The method according to claim 5, characterized in that Also includes: If the second image exists, sending the second image to the frame buffer; The second image in the frame buffer is displayed in the display area based on a screen refresh signal.

7. The method according to claim 3, characterized in that When a preset image is displayed in the display area, the buffer queue stores the preset image and the buffer image, wherein the buffer image is an image in a buffer page area adjacent to the preset page area.

8. An image display device, characterized in that: include: a determining unit, configured to determine target image data to be rendered based on a page scrolling operation for the display area when a page scrolling operation for the display area is detected in a case where a preset image is displayed in the display area; A rendering unit, configured to perform a second rendering operation on the target image data, wherein the second rendering operation includes: maintaining a resolution of the target image data unchanged, and rendering the target image data to obtain a second image; A display unit, in response to detecting that a target page area corresponding to the target image data slides to the display area, if the second image has not been rendered and the first image has been rendered, displaying the first image in the display area, wherein based on a page loading order, the target page area is located after a preset page area corresponding to the preset image; The rendering unit is also used to: based on the page scrolling operation, before determining the target image data to be rendered, obtain image data of multiple pages, and the multiple pages are pages used for the page scrolling operation; perform a first rendering operation on the image data of each page, wherein the first rendering operation includes: reducing the resolution of the target image data, and rendering the target image data with the reduced resolution to obtain a first image.

9. An electronic device, characterized in that: include: one or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the method according to any one of claims 1-7.

10. A computer-readable medium, characterized in that The computer-readable medium stores a program code executable by a processor, and when the program code is executed by the processor, the processor executes the method according to any one of claims 1 to 7.

11. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.