Editor rendering acceleration method based on hierarchical texture cache and dynamic priority

By dividing the text view in the code editor and using a layered texture cache and dynamic priority approach, the problems of low scrolling smoothness and low resource utilization efficiency are solved, achieving an efficient text scrolling experience and resource management.

CN121236256BActive Publication Date: 2026-02-17北京麟卓信息科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511797734.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-02
Publication Date
2026-02-17
Estimated Expiration
2045-12-02

AI Technical Summary

Technical Problem

Existing technologies suffer from frame stuttering, resource waste, lack of differentiation in rendering priorities, and insufficient prediction mechanisms when scrolling in code editors, resulting in low scrolling smoothness and low resource utilization efficiency.

Method used

The text view is divided into a core visible area, an edge visible area, and a preloaded area, and high, medium, and low precision rendering are used respectively. A mapping table between texture objects and texture coordinates is established. Resource allocation is optimized through scrolling status monitoring and predictive rendering. Rendering tasks are scheduled according to a multi-factor priority model, and texture resources are dynamically recycled.

Benefits of technology

It achieves a smooth rendering experience in fast-scrolling scenes, optimizes resource utilization efficiency, reduces frame stuttering and computational load, and improves scrolling performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121236256B_ABST
    Figure CN121236256B_ABST
Patent Text Reader

Abstract

The application discloses an editor rendering acceleration method based on layered texture caching and dynamic priority, divides a text view into a core visible area for high-precision rendering, an edge visible area for medium-precision rendering and a preloading area for low-precision rendering, configures corresponding texture parameters, creates GPU texture objects of three types of precision and a first mapping table of text lines and texture coordinates during initialization, and pre-renders textures of corresponding areas; during actual rendering, corresponding textures are called according to areas where text lines are located, predictive rendering is performed when a scrolling state meets a condition, a pre-rendering task is dispatched according to a multi-factor priority model, corresponding precision rendering is triggered when a text line moves across areas, texture and the mapping table are updated, a last access timestamp of the texture is maintained, texture resources are recycled regularly according to a recycling priority formula and a triggering condition, and GPU memory is released, so that the performance bottleneck problem of a current GPU texture translation method in a fast scrolling scene is solved, and a smooth pixel-level text scrolling experience is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer software development technology, specifically relating to an editor rendering acceleration method based on layered texture caching and dynamic priority. Background Technology

[0002] In text-based interfaces such as code editors, when users scroll using the mouse wheel or keyboard shortcuts, traditional CPU rendering methods require recalculating and redrawing all text content in the newly visible area, resulting in limited scrolling smoothness. Existing optimization techniques based on GPU texture translation significantly improve scrolling performance by using the current view as a texture for translation, re-rendering only a small number of newly entered text lines.

[0003] However, existing technologies still have the following problems: when rendering requests for newly entered text lines burst in a concentrated manner, momentary frame stuttering is likely to occur, especially in fast-scrolling scenes; texture resource allocation is fixed and cannot be dynamically adjusted according to the complexity of text content and device performance; rendering priority lacks a differentiated strategy, treating complex text content and simple text content equally, resulting in wasted resources; text rendering precision is consistent across different regions, without considering differences in visual importance, increasing unnecessary computational load; and there is a lack of an effective prediction mechanism, making it impossible to prepare for text content that may enter the field of view in advance, resulting in rendering delays in boundary areas.

[0004] In conclusion, improving the smoothness of text scrolling and the efficiency of resource utilization within the editor remains a pressing technical issue that needs to be addressed. Summary of the Invention

[0005] In view of this, the present invention provides an editor rendering acceleration method based on layered texture caching and dynamic priority, which realizes smooth text rendering in fast scrolling scenarios with GPU texture translation.

[0006] The editor rendering acceleration method based on hierarchical texture caching and dynamic priority provided by this invention specifically includes the following steps:

[0007] The text view within the editor is divided into a core visible area, an edge visible area, and a preloaded area. The core visible area is the central area of ​​the visible view. The edge visible area includes the upper and lower edge areas adjacent to the core visible area. The preloaded area includes the upper and lower preloaded areas, which are both preloaded at a distance of preload height from the top and bottom of the core visible area.

[0008] During initialization, the text content in the core visible area, edge visible area and preloaded area is pre-rendered as the corresponding texture objects, and the first mapping table between the text line index and the texture coordinates in the texture object is established.

[0009] When actually rendering the visible view, the corresponding pre-rendered texture is generated according to the area where the text line is located; when the text line starts to move, the texture object and the first mapping table are updated by predictive rendering according to the obtained scrolling state and text line position; when the area where the text line is located changes, the texture object is searched according to the first mapping table. If it exists, the texture object is used. Otherwise, the texture object and the first mapping table are updated by high-precision rendering, medium-precision rendering, or low-precision rendering according to whether the new area is the core visible area, the edge visible area, or the preloaded area.

[0010] The recycling priority of the corresponding texture object is calculated based on the current time, the last access time, and the corresponding texture area. When the recycling trigger condition is met, the corresponding texture object is recycled according to the recycling priority to release GPU memory.

[0011] Furthermore, in the core visible area, the top Y-coordinate is the sum of the top Y-coordinate of the visible view and the visible view height proportional to the top, and the bottom Y-coordinate is the sum of the visible view height proportional to the top and bottom of the visible view; in the edge visible area, the Y-coordinate range of the upper edge area is a left-closed, right-open interval from the top Y-coordinate of the visible view to the top Y-coordinate of the core visible area, and the Y-coordinate range of the lower edge area is a left-open, right-closed interval from the bottom Y-coordinate of the core to the bottom Y-coordinate of the visible view; in the preloading area, the Y-coordinate range of the upper preloading area is a left-closed, right-open interval from the difference between the top Y-coordinate of the core visible area and the preloading height to the top Y-coordinate of the core visible area, and the Y-coordinate range of the lower preloading area is a left-open, right-closed interval from the bottom Y-coordinate of the core visible area to the sum of the bottom Y-coordinate of the core visible area and the preloading height.

[0012] Furthermore, the method for obtaining the rolling state is as follows: sampling the rolling position and rolling direction at a set frequency, recording the timestamp and displacement of each sampling, smoothing the sampled data using a sliding window, calculating the rolling speed, acceleration and directional stability using the sampled data, and forming the rolling state from the rolling speed, acceleration and directional stability, where the directional stability is the number of consecutive rolls in the same direction.

[0013] Furthermore, the predictive rendering process is as follows: when the scrolling speed and direction stability are both greater than the corresponding thresholds in the scrolling state, and the distance between the position of the text line and the boundary of the preload area is less than the threshold, a scrolling trajectory prediction model is selected based on the scrolling speed and acceleration, the range of text lines that will enter the visible view in the future prediction window is calculated, the line number of the text line is determined, and a predictive rendering task containing the text line to be rendered, the corresponding texture area, and the priority is constructed; a rendering task queue is established according to the priority, and the predictive rendering tasks in the rendering task queue are executed sequentially using GPU idle time. When the scrolling direction changes, the execution of the predictive rendering task opposite to that direction is terminated.

[0014] Furthermore, the rolling trajectory prediction model includes: a linear prediction model suitable for uniform rolling, a quadratic prediction model suitable for uniformly variable rolling, and an automatic switching model based on the acceleration value. The linear prediction model uses the uniform motion calculation formula, the quadratic prediction model uses the uniformly variable motion calculation formula, and the automatic switching model selects either the linear prediction model or the quadratic prediction model based on the relationship between acceleration and a threshold.

[0015] Furthermore, the priority is calculated as follows: Priority = (S × Ws) + (T × Wt) + (C × Wc), where Priority is the priority, S is the spatial factor, T is the time factor, C is the content factor, and Ws, Wt, and Wc are all weights with a sum of 1.0.

[0016] Furthermore, when a text line moves across regions, the transition blending factor is the ratio of the portion of the text line in the new region to the portion remaining in the original region, with a value range of [0, 1.0]. When the transition blending factor is greater than 0, the rendering results of the corresponding precision levels of the new and original regions are preserved. When transitioning from low precision to high precision, a power function with a smaller exponent is used to accelerate the display of high-precision components, and when transitioning from high precision to low precision, a power function with a larger exponent is used to delay the display of low-precision components. The transition duration is dynamically adjusted according to the scrolling speed. When the blending factor is equal to 1.0, low-precision rendering and caching are stopped, and the texture resources of the corresponding precision level of the original region are released.

[0017] Furthermore, the high-precision rendering renders the core visible area as the first core texture, specifically by: obtaining complete information of all text lines in the current region, including character encoding, font attributes, syntax highlighting rules, preset markers, and embedded elements; initializing the first core texture; setting the high-precision texture resolution; configuring the GPU high-precision rendering state; and setting the sampling quality parameter to the highest level. High-precision glyph rasterization is performed on each text line, syntax highlighting and preset styles are rendered, and the text layer, background layer, and decoration layer are synthesized in Z-axis order using a precise alpha blending formula. The rendering result is used to update the first core texture, timestamps are recorded, and the first mapping table is updated.

[0018] Furthermore, the medium-precision rendering renders the visible edge area as a first edge texture, specifically by: obtaining basic information of all text lines in the current region, omitting secondary decorative details, initializing the first edge texture, setting the medium-precision texture resolution, configuring the GPU medium-precision rendering state, and setting the sampling quality parameter to medium level; performing medium-precision glyph rasterization on each text line, rendering simplified syntax highlighting and preset styles, using a simplified alpha blending formula to synthesize a base layer, updating the first edge texture with the rendering result, recording the timestamp, and updating the first mapping table.

[0019] Furthermore, the low-precision rendering renders the preloaded area as a first preloaded texture, specifically by: obtaining minimal information of all text lines in the current region, containing only character sequences and basic styles; initializing the first preloaded texture, setting the low-precision texture resolution, and configuring the low-precision GPU rendering state; performing low-precision glyph rasterization on each text line, performing minimal layer compositing to preserve a simple overlay of the text layer and the background layer, updating the first preloaded texture with the rendering result, recording the timestamp, and updating the first mapping table. Beneficial effects

[0020] This invention divides the text view into a core visible area for high-precision rendering, an edge visible area for medium-precision rendering, and a pre-loading area for low-precision rendering, and configures corresponding texture parameters. During initialization, it creates GPU texture objects of three precision levels and a first mapping table between text lines and texture coordinates, and pre-renders the textures of the corresponding areas. During actual rendering, it calls the corresponding texture according to the area where the text line is located. When scrolling is detected, it starts scrolling state monitoring. When the conditions are met, it performs predictive rendering through a linear or quadratic prediction model and schedules pre-rendering tasks according to a multi-factor priority model. When the text line moves across areas, it triggers the corresponding precision rendering to update the texture and mapping table. At the same time, it maintains the last access timestamp of the texture and periodically reclaims texture resources to release GPU memory according to the recycling priority formula and trigger conditions. This solves the performance bottleneck problem of existing GPU texture translation methods in fast scrolling scenarios and achieves a smooth pixel-level text scrolling experience. Attached Figure Description

[0021] Figure 1 This is a flowchart illustrating the editor rendering acceleration method based on layered texture caching and dynamic priority provided by the present invention. Detailed Implementation

[0022] The present invention will be described in detail below with reference to the accompanying drawings and embodiments.

[0023] The core idea of ​​the editor rendering acceleration method based on hierarchical texture caching and dynamic priority provided by this invention is as follows: the text view is divided into a core visible area for high-precision rendering, an edge visible area for medium-precision rendering, and a preloading area for low-precision rendering, and corresponding texture parameters are configured. During initialization, GPU texture objects of three precisions and a first mapping table between text lines and texture coordinates are created, and the textures of the corresponding areas are pre-rendered. During actual rendering, the corresponding texture is called according to the area where the text line is located. When the visible view is scrolled, scrolling status monitoring is started. When the conditions are met, predictive rendering is performed through a linear or quadratic prediction model, and predictive rendering tasks are scheduled according to a multi-factor priority model. When the text line moves across areas, the corresponding precision rendering is triggered to update the texture and mapping table. At the same time, the last access timestamp of the texture is maintained, and texture resources are periodically reclaimed and GPU memory is released according to the reclamation priority and triggering conditions.

[0024] The editor rendering acceleration method based on hierarchical texture caching and dynamic priority provided by this invention has the following process: Figure 1 As shown, the specific steps include:

[0025] Step 1: Divide the text view within the editor into a core visible area, an edge visible area, and a preloaded area. The core visible area is the central region of the visible view, rendered with high precision to preserve complete text details, including syntax highlighting, font anti-aliasing, icons, and special markers. The edge visible area includes the upper and lower edge areas, rendered with medium precision to preserve basic text and simplified syntax highlighting, omitting some secondary decorative elements. The preloaded area includes the upper and lower preloaded areas, rendered with low precision to preserve only the text outline and the most basic color distinctions, without anti-aliasing processing.

[0026] Specifically, in the core visible area, the top Y-coordinate is the sum of the top Y-coordinate of the visible view and the visible view height of the top scale, and the bottom Y-coordinate is the sum of the visible view height of the top and bottom scales. The top scale can be set to 20%, and the bottom scale can be set to 80%.

[0027] The Y-coordinate range of the upper edge area in the visible edge area is a left-closed and right-open interval from the top Y-coordinate of the visible view to the top Y-coordinate of the core visible area, and the Y-coordinate range of the lower edge area is a left-open and right-closed interval from the bottom Y-coordinate of the core to the bottom Y-coordinate of the visible view.

[0028] The preload height of the upper and lower preload areas in the preload area can be one to two times that of the visible view. Specifically, the Y-coordinate range of the upper preload area is the left-closed and right-open interval from the difference between the Y-coordinate of the top of the core visible area and the preload height to the Y-coordinate of the top of the core visible area. The Y-coordinate range of the lower preload area is the left-open and right-closed interval from the Y-coordinate of the bottom of the core visible area to the sum of the Y-coordinate of the bottom of the core visible area and the preload height.

[0029] This invention sets different parameters for textures obtained from high-precision rendering, medium-precision rendering, and low-precision rendering, including texture resolution, color depth, anti-aliasing, font details, special elements, update frequency, etc.

[0030] Step 2: During initialization, create three independent GPU texture objects with different precision parameters. Establish a mapping table between text line indices and texture coordinates within the GPU texture objects, denoted as the first mapping table. Pre-render the text content corresponding to the current visible view and the preloaded area as the first core texture, the first edge texture, and the first preloaded texture using high-precision rendering, medium-precision rendering, and low-precision rendering methods, respectively.

[0031] Step 3: When actually rendering the currently visible view, the corresponding layer of pre-rendered texture is used according to the area where the text line is located. That is, if the text line is in the core visible area, the first core texture is used; if the text line is in the edge visible area, the first edge texture is used; if the text line is in the preloaded area, the first preloaded texture is used.

[0032] When the text line is detected to start moving due to mouse scrolling, scroll detection is initiated to form a scrolling state. Predictive rendering is performed based on the scrolling state and the position of the text line. The texture obtained from the predictive rendering is used to update the corresponding first core texture, first edge texture, and first preloaded texture, and the first mapping table is updated.

[0033] When a change is detected in the area where the text line is located, the system searches for a texture object corresponding to the text line in the first core texture, the first edge texture, and the first preloaded texture according to the first mapping table. If the texture object exists, it is used directly. If the texture object does not exist, the corresponding precision rendering update is triggered. That is, when the text line enters the edge visible area from the preloaded area, step 4 is executed; when the text line enters the core visible area from the edge visible area, step 5 is executed; and when the text line enters the preloaded area from the visible area, step 6 is executed.

[0034] The execution process of rolling monitoring includes: sampling the rolling position and rolling direction at a set frequency, recording the timestamp and displacement of each sampling, smoothing the sampled data using a sliding window, calculating the rolling speed, acceleration and directional stability using the sampled data, forming the rolling state from the rolling speed, acceleration and directional stability, and the directional stability being the number of consecutive rolls in the same direction.

[0035] The process of predictive rendering based on scrolling state includes: when the scrolling speed and direction stability are both greater than the corresponding thresholds, and the distance between the position of the text line and the boundary of the preload area is less than the threshold, a scrolling trajectory prediction model is selected based on the scrolling speed and acceleration, the range of text lines that will enter the visible view in the future prediction window is calculated, the line number of the text lines is determined, and a predictive rendering task containing the text lines to be rendered, the corresponding texture area, and the priority is constructed; a rendering task queue is established according to the priority, and the tasks in the rendering task queue are executed sequentially using GPU idle time. When the scrolling direction changes, the execution of the predictive rendering task opposite to that direction is terminated.

[0036] The rolling trajectory prediction model includes: a linear prediction model suitable for uniform rolling, a quadratic prediction model suitable for uniformly variable rolling, and an automatic switching model based on the acceleration value. Specifically, the linear prediction model uses the uniform motion calculation formula, the quadratic prediction model uses the uniformly variable motion calculation formula, and the automatic switching model selects either the linear prediction model or the quadratic prediction model based on the relationship between acceleration and a threshold.

[0037] In this invention, a multi-factor priority model is used to calculate the priority in the pre-rendering task. The multi-factor priority model is: Priority=(S×Ws)+(T×Wt)+(C×Wc), where Priority is the priority, S is the spatial factor, T is the temporal factor, C is the content factor, and Ws, Wt and Wc are all weights and their sum is 1.0.

[0038] The spatial factor is calculated by normalizing the weighted Euclidean distance between the text line and the center of the visible view; the spatial factor for the current editing line is forcibly set to 1.0. The temporal factor is calculated by the scrolling speed and the predicted arrival time; it is set to 0.5 when stationary. The content factor is calculated by normalizing the text line rendering complexity, including the number of syntax highlights and icons. Furthermore, the weights Ws, Wt, and Wc are dynamically adjusted according to the scrolling status.

[0039] Furthermore, based on triggering conditions such as system resources, editing operations, scrolling status, and content changes, priorities are adjusted to ensure that resource allocation matches actual needs.

[0040] Furthermore, to improve the accuracy of predictive rendering, this invention selects the results of multiple predictive renderings as the test set, calculates the error between the predicted text line position and the actual text line position, maintains the current prediction window and scroll trajectory prediction model when the error is less than a smaller threshold, increases the prediction window when the error is not less than a smaller threshold and less than a larger threshold, and changes the scroll trajectory prediction model when the error is not less than a larger threshold. Multiple scrolling modes, including average scrolling speed, acceleration mode, and scrolling duration, are recorded, and prediction parameters, including the prediction window and scroll trajectory prediction model, are set for each scrolling mode.

[0041] Furthermore, to reduce visual jumps caused by different precision parameters, this invention employs a progressive transition mechanism when text lines move across regions. This mechanism reduces visual jumps between different precision parameters through non-linear mixing of fragment shaders and dynamically adjusts the transition duration based on scrolling speed, including:

[0042] The transition blending factor is the ratio of the portion of the text line in the new area to the portion remaining in the original area, with a value range of [0, 1.0]. When the transition blending factor is greater than 0, the rendering results of the corresponding precision levels of the new and original areas are preserved. When transitioning from low precision to high precision, a power function with a smaller exponent is used to accelerate the display of high precision components, and when transitioning from high precision to low precision, a power function with a larger exponent is used to delay the display of low precision components. The transition duration is dynamically adjusted according to the scrolling speed. When the blending factor is equal to 1.0, low precision rendering and caching are stopped, and the texture resources of the corresponding precision level of the original area are released.

[0043] Step 4: Obtain basic information of all text lines in the current region from the text layout engine, omit minor decorative details, initialize a GPU texture object with medium precision corresponding format, set medium precision texture resolution, configure GPU medium precision rendering state, and set sampling quality parameters to medium level; perform medium precision glyph rasterization on each text line, render simplified syntax highlighting and special elements, use simplified alpha blending formula to synthesize the base layer, save the rendering result as the first edge texture, record the timestamp, and update the first mapping table; proceed to step 7.

[0044] Furthermore, for updating and maintaining the first edge texture, this invention detects changes in text content or style within the visible edge area at intervals of set frames. When a change occurs, medium-precision rendering is triggered, and the transition blending with the core visible area is maintained to ensure visual continuity during scrolling. The first edge texture and the first mapping table are then updated. The set frames can be set to 3 frames.

[0045] Step 5: Obtain complete information of all text lines in the current region from the text layout engine, including: character encoding, font attributes, syntax highlighting rules, special tags, and embedded elements; initialize a high-precision GPU texture object corresponding to the format, set the high-precision texture resolution, configure the GPU high-precision rendering state, and set the sampling quality parameter to the highest level; perform high-precision glyph rasterization on each text line, render syntax highlighting and special elements, use a precise alpha blending formula to synthesize the text layer, background layer, and decoration layer in Z-axis order, save the rendering result as the first core texture, record the timestamp, and update the first mapping table; execute step 7.

[0046] Furthermore, for the updating and maintenance of the first core texture, this invention detects changes in the text content or style within the core visible area for each frame. When a change occurs, only the affected text lines are re-rendered, and the first core texture and the first mapping table are updated.

[0047] Step 6: Obtain the minimized information of all text lines in the current region from the text layout engine, including only character sequences and basic styles; initialize the low-precision corresponding format GPU texture object, set the low-precision texture resolution, and configure the low-precision GPU rendering state; perform low-precision glyph rasterization on each text line, retain only the basic contrast between the text and the background for rendering, perform minimized layer compositing to retain only the simple overlay of the text layer and the background layer, save the rendering result as the first preloaded texture, record the timestamp, and update the first mapping table; proceed to step 7.

[0048] Furthermore, for the updating and maintenance of the first preloaded texture, this invention only updates the preloaded area content as needed when the scroll monitoring result determines that it is about to enter the visible view. When the text line enters the preloaded area from the edge area, low-precision rendering is triggered to update the first preloaded texture and the first mapping table.

[0049] Step 7: Maintain the last access timestamps of the first core texture, the first edge texture, and the first preloaded texture. Periodically check the access times of the three types of textures. Calculate the recycling priority of the first core texture, the first edge texture, and the first preloaded texture based on the current time, the last access time, and the corresponding texture area. When the recycling trigger condition is met, reclaim the texture resources of the first core texture, the first edge texture, or the first preloaded texture according to the recycling priority to release GPU memory.

[0050] In this invention, the recycling priority (recyclePriority) is calculated as follows:

[0051] recyclePriority = (currentTime - lastAccessTime) × layerFactor

[0052] Where currentTime is the current time, lastAccessTime is the last access time; layerFactor is the layer factor corresponding to the texture, for example, 1.0 for the preload area, 0.5 for the edge visible area, and 0.1 for the core visible area.

[0053] The conditions for recycling include: GPU memory usage exceeding a threshold, the existence of textures that have not been accessed for a set time, or the number of textures in the preload area exceeding a set multiple of the view height. Example

[0054] This embodiment takes a high-performance code editor as an example. It uses the editor rendering acceleration method based on hierarchical texture caching and dynamic priority provided by this invention to implement text rendering using GPU texture translation in fast scrolling scenes. The specific process includes:

[0055] S1. Construct a multi-level texture cache structure.

[0056] S1.1 Divide the text view into three levels of texture buffer areas, as follows:

[0057] S1.1.1 Core Visible Area: Defined as a rectangular area covering 60% of the center of the current visible view. This area is rendered with the highest precision, preserving complete text details, including all syntax highlighting, font anti-aliasing, icons, and special markers. The calculation formula is:

[0058] Top of core area = Top of view + View height × 20%

[0059] Bottom of core area = Top of view + View height × 80%

[0060] Core area height = View height × 60%

[0061] S1.1.2, Visible Edge Area: Divided into upper and lower edge areas, each occupying 20% ​​of the view height. This area uses medium-precision rendering, retaining basic text and simplified syntax highlighting, while omitting some secondary decorative elements. Specifically:

[0062] Top edge area = [Top of view, Top of core area)

[0063] Bottom edge area = (bottom of core area, bottom of view)

[0064] S1.1.3, Preload Area: Divided into upper and lower preload areas, each area's height is 1 to 2 times the height of the currently visible view (this can also be dynamically adjusted according to device performance). This area uses low-precision rendering, retaining only text outlines and basic color distinctions, and does not perform anti-aliasing processing. Specifically:

[0065] Upper preload area = [top of core area - preload height, top of core area)

[0066] Lower preload area = (bottom of core area, bottom of core area + preload height)

[0067] S1.2 Differences in technical parameters of textures at different levels.

[0068] The specific impact of each parameter on the rendering effect is as follows:

[0069] Resolution scaling factor: 1:1 mapping of the core area ensures clear text edges, 0.8x scaling of the edge area reduces memory usage to 64%, and 0.5x scaling of the preload area reduces memory usage to only 25%, making the visual difference acceptable during fast scrolling;

[0070] Color depth: The core area's 32-bit ARGB supports 16.7 million colors and transparency, meeting the needs of fine syntax highlighting; the edge area's 16-bit RGB565 retains 65,536 colors, basically meeting the needs of differentiation; the preloaded area's 8-bit indexed color retains only 256 preset colors, used only for basic recognition.

[0071] Anti-aliasing settings: 4x MSAA in the core area ensures no jagged edges during static reading; 2x MSAA in the edge area balances performance and quality; the preloaded area uses FXAA post-processing to reduce significant jagged edges with a 10% performance overhead.

[0072] Font rendering parameters: The core area supports precise kerning and ligature processing, suitable for detailed reading; these processes are omitted in the preload area to improve performance.

[0073] S1.3 Construction of hierarchical textures.

[0074] S1.3.1 Initialization process.

[0075] Create three independent GPU texture objects and set corresponding precision parameters; establish a mapping table (LineTextureMap) between text line indices and texture coordinates, and pre-render the contents of the current view and preload area to the corresponding textures during initialization.

[0076] S1.3.2 Texture data structure.

[0077] struct TextureLayer {

[0078] GPUTexture* texture; / / GPU texture object

[0079] float resolutionScale; / / Resolution scaling factor

[0080] int colorDepth; / / Color depth

[0081] AntiAliasingMode aaMode; / / Anti-aliasing mode

[0082] Rect viewport; / / Viewport area corresponding to this layer

[0083] LineRange lineRange; / / The range of text lines it contains

[0084] unordered_map<int, Rect> lineMap; / / Mapping of text line numbers to texture areas

[0085] timestamp_t lastUpdateTime; / / Last update timestamp

[0086] };

[0087] / / Texture Hierarchy Manager

[0088] class LayeredTextureManager {

[0089] private:

[0090] TextureLayer coreLayer; / / Core visible area texture

[0091] TextureLayer edgeLayer; / / Texture of the visible edge area

[0092] TextureLayer preloadLayer; / / Preload area texture

[0093] / / Other management methods...

[0094] };

[0095] S1.3.3 Dynamic usage strategy of hierarchical textures.

[0096] Texture access strategy: When rendering the current view, sample from the texture of the corresponding layer according to the area where the text line is located; core area text directly uses core texture, edge area uses edge texture, and preload area uses preload texture.

[0097] Layer transformation processing: When a text line moves between different areas due to scrolling, it triggers medium-precision rendering when entering the edge area from the preload area and updates the edge texture; it triggers high-precision rendering when entering the core area from the edge area and updates the core texture; it degrades to low-precision rendering when leaving the visible area and entering the preload area and updates the preload texture.

[0098] Cross-level transition effect processing: In order to reduce visual jumps caused by different precision parameters, a gradual transition mechanism is adopted. The transition duration is dynamically adjusted according to the scrolling speed and is set to 1 to 3 frames to balance performance and visual continuity.

[0099] S1.3.4, Multi-precision rendering.

[0100] S1.3.4.1 High-precision rendering, including:

[0101] Detect the area where the current text line is located and determine it as the core visible area (60% of the view center); obtain complete information of all text lines in this area from the text layout engine, including: character encoding, font attributes (type, size, style), syntax highlighting rules, special markers (breakpoints, bookmarks, etc.), and embedded elements (icons, fold markers); initialize a 32-bit ARGB format GPU texture object and set the texture resolution to a 1:1 pixel mapping (i.e., 1 screen pixel corresponds to 1 texture pixel); configure the GPU rendering state, enable 4x MSAA (multi-sample anti-aliasing) mode, and set the sampling quality parameter to the highest level.

[0102] Perform high-precision glyph rasterization on each line of text: load the complete kerning table and ligature rules, apply subpixel positioning (accuracy up to 1 / 8 pixel), and enable font hinting to enhance screen display clarity;

[0103] Render syntax highlighting: Apply 32-bit ARGB color values ​​(including alpha channels) according to syntax rules, and apply independent colors and styles (such as italics and bold) to elements such as keywords, comments, and strings.

[0104] Render special elements: Draw icons at full resolution (such as breakpoint icons, collapse indicators), render text decorations (underline, strikethrough, highlighted background), accurate to pixel boundaries;

[0105] Perform layer compositing: Combine the text layer, background layer, and decoration layer in Z-axis order, and apply precise alpha blending.

[0106] Perform high-precision color correction on the rendering results to match the system color profile; apply an edge sharpening filter to enhance the clarity of text edges (sharpening intensity 15%); write the final rendering results to the core area texture cache and record the timestamp.

[0107] Each frame detects whether the text content or style in the core area has changed (including changes in the area caused by scrolling). If a change is found, only the affected text lines are re-rendered (incremental update), maintaining the real-time mapping between the text lines and texture coordinates to ensure sampling accuracy during scrolling.

[0108] S1.3.4.2, Medium-precision rendering, including:

[0109] Detect the area where the current text line is located and determine it to be the visible edge area (20% of the view's top and bottom); obtain the basic information of the text line in this area from the text layout engine, omitting secondary decorative details; initialize a 16-bit RGB565 format GPU texture object and set the texture resolution to a 0.8:1 pixel mapping (i.e., 1 screen pixel corresponds to 0.8 texture pixels); configure the GPU rendering state, enable 2x MSAA mode, and set the sampling quality parameter to medium level.

[0110] Perform medium-precision glyph rasterization on each line of text: load the basic kerning table, enable only common ligature rules (such as fi, fl); apply pixel-level positioning (precision 1 pixel), simplify font hinting, and preserve vertical alignment precision;

[0111] Rendering simplified syntax highlighting: Apply 16-bit RGB565 color values ​​according to the simplification rules (merge similar colors), retain only the color distinction of key syntax elements (keywords, comments), and omit the style differences of secondary elements (such as variables);

[0112] Rendering simplifies special elements: draw icons scaled by 0.8 times, omitting detailed textures; retain only necessary decorations (such as underlines), simplifying the drawing logic;

[0113] Perform base layer compositing using a simplified alpha blending formula (reducing computational complexity).

[0114] Perform basic color correction, omitting advanced color gamut matching; write the rendering results to the edge area texture cache and record the timestamp.

[0115] Every 2-3 frames, the system detects changes in text content or style in the edge area. When a text line moves from the preloaded area into the edge area, it triggers medium-precision rendering (replacing the low-precision version) to maintain a transition blending mechanism with the core area and ensure visual continuity during scrolling.

[0116] S1.3.4.3 Low-precision rendering, including:

[0117] Detect the area where the current text line is located and determine it to be the preload area (1-2 times the height outside the view); obtain the minimized information of the text line in this area from the text layout engine, which only includes the character sequence and basic style; initialize the GPU texture object in 8-bit indexed color format and set the texture resolution to 0.5:1 pixel mapping (i.e., 1 screen pixel corresponds to 0.5 texture pixels); configure the GPU rendering state, disable MSAA, and enable FXAA post-processing (post-processing anti-aliasing).

[0118] Perform low-precision glyph rasterization on each line of text: disable kerning and ligature rules, use simplified glyph outlines (omit detail curves), apply integer pixel positioning, and ignore subpixel precision;

[0119] Rendering basic color differentiation: Apply 8-bit indexed colors (256 preset colors), retain only the basic contrast between text and background; merge all syntax highlighting into 3-5 basic colors (such as text, comments, and keywords).

[0120] Skip special element rendering: Do not draw icons and decorative elements, omit secondary information such as fold markers and breakpoints; perform minimized layer composition, retaining only a simple overlay of the text layer and the background layer.

[0121] Apply the FXAA post-processing filter to reduce the jagged edges caused by low precision; write the rendering results to the preload area texture cache and record the timestamp.

[0122] Update the preload area content as needed (only when the prediction system determines that it may enter the view). When a text line enters the preload area from the edge area, it is downgraded to low-precision rendering. Prioritize the reclamation of low-precision texture resources that have not been accessed for more than 5 seconds to free up GPU memory.

[0123] S1.3.4.4, Cross-precision transition processing, including:

[0124] Real-time monitoring of text line area changes caused by scrolling; when a text line crosses an area boundary, a transition blending factor (0-1.0) is calculated.

[0125] For text lines in transition, the rendering results of both the preceding and following precision levels are preserved; non-linear blending is performed in the fragment shader: when transitioning from low precision to high precision, pow(blendFactor, 0.7) is used to accelerate the appearance of high precision components; when transitioning from high precision to low precision, pow(blendFactor, 1.5) is used to delay the appearance of low precision components; the transition duration is dynamically adjusted according to the scrolling speed: 1 frame for fast scrolling and 3 frames for slow scrolling.

[0126] When the blending factor reaches 1.0, rendering and caching of the low-precision version are stopped; texture resources of the replaced precision level are released, specifically: low-precision cache is released when the preload area reaches the edge area, and medium-precision cache is released when the edge area reaches the core area.

[0127] S2, Predictive Rendering.

[0128] S2.1 Rolling status monitoring mechanism.

[0129] Sampling frequency and data processing: The scroll position is sampled at a frequency of 60Hz, and the timestamp and displacement of each sample are recorded; the scroll speed is calculated as v = Δy / Δt (pixels / millisecond), and the acceleration is calculated as a = Δv / Δt (pixels / millisecond²). A sliding window (window size of 5-8 sampling points) is used for data smoothing.

[0130] Scrolling state data structure:

[0131] struct ScrollState {

[0132] float position; / / Current scroll position (pixels)

[0133] float velocity; / / Current scroll speed (pixels / milliseconds)

[0134] float acceleration; / / Current acceleration

[0135] int direction; / / Scrolling direction (1 = down, -1 = up, 0 = stationary)

[0136] int stableCount; / / Number of frames continuously scrolling in the same direction

[0137] float avgVelocity; / / Average velocity within the sliding window

[0138] };

[0139] S2.2 The rolling trajectory prediction model adopts a three-level prediction model, which is dynamically selected based on the rolling state:

[0140] Linear prediction model (suitable for uniform rolling):

[0141] predictedPosition(t) = currentPosition + velocity × t

[0142] Where predictedPosition(t) is the predicted position, currentPosition is the current position, and t is the prediction time window (usually 100-200 milliseconds).

[0143] Quadratic prediction model (suitable for accelerated / decelerated rolling):

[0144] predictedPosition(t) = currentPosition + velocity × t + 0.5 ×acceleration × t²

[0145] Intelligent switching mechanism:

[0146] When |acceleration| < 0.05 pixels / millisecond², use a linear model; when |acceleration| ≥ 0.05 pixels / millisecond², use a quadratic model; re-evaluate the model's applicability every 3 frames.

[0147] S2.3 Triggering and Execution of Predictive Rendering.

[0148] The triggering conditions include: the basic condition is a scroll speed v > 15 pixels / millisecond (approximately 900 pixels per second), the directional stability is continuous scrolling in the same direction for ≥3 frames, and the boundary condition is that the distance from the preload area boundary is less than 30% of the view height.

[0149] Pre-rendered content calculation:

[0150] vector <int>calculatePredictedLines(ScrollState state) {

[0151] / / Text lines that are predicted to enter the view within the next 150ms

[0152] const float PREDICTION_WINDOW = 150; / / Prediction window (milliseconds)

[0153] float predictedDelta = predictPositionDelta(state, PREDICTION_WINDOW);

[0154] / / The range of text lines that will be included in the view based on the predicted displacement.

[0155] int lineHeight = getLineHeight();

[0156] int predictedLineCount = abs(predictedDelta) / lineHeight + 2; / / Add 2 extra lines of redundancy

[0157] / / Determine the specific line number

[0158] vector <int>result

[0159] if (state.direction > 0) { / / Scroll down

[0160] int startLine = getLastVisibleLine() + 1;

[0161] for (int i = 0; i < predictedLineCount; i++) {

[0162] result.push_back(startLine + i);

[0163] }

[0164] } else { / / Scroll up

[0165] int startLine = getFirstVisibleLine() - 1;

[0166] for (int i = 0; i < predictedLineCount; i++) {

[0167] result.push_back(startLine - i);

[0168] }

[0169] }

[0170] return result;

[0171] }

[0172] Pre-rendering task scheduling:

[0173] A priority queue is used to manage pre-rendering tasks. Each task contains the target text line, the target texture level, and the priority. Pre-rendering is performed using GPU idle time without blocking the main thread. When the prediction direction changes, the pre-rendering task in the opposite direction is immediately canceled.

[0174] S2.4, Forecast accuracy feedback and adjustment.

[0175] When the error is less than 10%, maintain the current prediction window and model. When the error is less than 30%, increase the prediction window by 10% to enhance redundancy. When the error is greater than or equal to 30%, switch to a more conservative prediction model and increase pre-rendering redundancy by 20%.

[0176] Self-learning optimization: Records user scrolling habits, including average speed, acceleration mode, and scrolling duration, and adjusts prediction parameters based on historical data to adapt to user scrolling behavior patterns.

[0177] S3, Dynamic Priority Calculation and Adjustment Mechanism.

[0178] S3.1, a multi-factor model for priority calculation, wherein the specific calculation methods for each factor include:

[0179] S3.1.1 Calculation of the space factor S:

[0180] Based on the three-dimensional coordinate position of the text line in the view (considering vertical position and horizontal offset):

[0181] Text line center coordinates = (lineX, lineY), view center coordinates = (viewCenterX, viewCenterY);

[0182] Spatial distance is calculated using the weighted Euclidean distance formula:

[0183] distance = [ (lineX - viewCenterX)² × Wx + (lineY - viewCenterY)² × Wy ]

[0184] Among them, the weight coefficient Wx is the horizontal weight with a value of 0.3, and Wy is the vertical weight with a value of 0.7;

[0185] Normalization process:

[0186] maxVerticalDistance = viewHeight / 2

[0187] maxHorizontalDistance = viewWidth / 4

[0188] normalizedVertical = min( |lineY - viewCenterY| / maxVerticalDistance, 1.0 )

[0189] normalizedHorizontal = min( |lineX - viewCenterX| / maxHorizontalDistance, 1.0 )

[0190] normalizedDistance = (normalizedVertical × Wy +normalizedHorizontal × Wx) / (Wx + Wy)

[0191] S = 1.0 - normalizedDistance

[0192] Special scene handling:

[0193] Partially visible text lines: S = S × visibleRatio + 0.1 (visibleRatio is the visibility ratio); Current editing line: Force S = 1.0 (highest priority); Collapsed text lines: S = S × 0.2 (lower priority).

[0194] S3.1.2 Calculation of the time factor T:

[0195] Based on rolling speed and predicted arrival time:

[0196] if (velocity == 0) {

[0197] T = 0.5 / / Give medium time priority when stationary

[0198] } else {

[0199] timeToEnter = distanceToView / velocity

[0200] normalizedTime = min(timeToEnter / 200, 1.0) / / 200ms as the baseline

[0201] T = 1.0 - normalizedTime

[0202] }

[0203] S3.1.3 Calculation of Content Factor C:

[0204] Rendering complexity based on text lines:

[0205] complexity = baseComplexity +

[0206] syntaxHighlightCount × 0.1 +

[0207] iconCount × 0.2 +

[0208] foldMarker × 0.15 +

[0209] commentBlock × 0.3

[0210] normalizedComplexity = min(complexity / 5.0, 1.0)

[0211] C = 1.0 - normalizedComplexity

[0212] S3.2 Dynamic weight adjustment mechanism.

[0213] The weights Ws, Wt, and Wc are dynamically adjusted according to the scrolling status:

[0214] Still state (velocity < 5 pixels / millisecond):

[0215] Ws = 0.6, Wt = 0.1, Wc = 0.3 (Focusing more on the central area of ​​space and the complexity of content)

[0216] Slow scrolling (5 ≤ velocity < 30 pixels / millisecond):

[0217] Ws = 0.4, Wt = 0.3, Wc = 0.3 (balancing space, time, and content factors)

[0218] Fast scrolling (velocity ≥ 30 pixels / millisecond):

[0219] Ws = 0.2, Wt = 0.6, Wc = 0.2 (focusing more on the content about to enter the view).

[0220] S3.3 Triggering conditions and execution mechanism for dynamic priority adjustment.

[0221] S3.3.1 Triggering conditions based on scrolling state:

[0222] Scroll start trigger: Speed ​​increases from 0 to >5 pixels / millisecond and lasts for 2 frames;

[0223] Adjustments: Wt increased from 0.1 to 0.4, preload area increased by 50%.

[0224] Fast scrolling trigger: speed ≥ 30 pixels / millisecond or acceleration > 0.1 pixels / millisecond² for 5 consecutive frames;

[0225] Adjustments: Wt increased to 0.6, Ws decreased to 0.2, and priority of complex text lines reduced by 50%.

[0226] Scroll deceleration trigger: Speed ​​decreases from ≥20 pixels / ms to <10 pixels / ms and acceleration <0;

[0227] Adjustments: Wt is gradually decreased, Ws is gradually increased, and high-precision rendering completion of the core area is initiated.

[0228] Scroll stop trigger: speed < 2 pixels / millisecond and lasts for 3 frames;

[0229] Adjustment: Restore default weights and trigger the highest precision rendering completion for all visible areas.

[0230] S3.3.2, Triggering conditions based on content changes:

[0231] Text complexity mutation trigger: The average text complexity in the current view changes by more than 30%;

[0232] Adjustment: Recalculate the content factor of all text lines, increasing Wc to 0.4 when complexity increases.

[0233] Editing action trigger: user input, deletion, or text formatting (500ms debouncing);

[0234] Adjustment: Force the current editing line and the three lines above and below it to have the highest priority.

[0235] S3.3.3 Triggering conditions based on system resources:

[0236] GPU overload trigger: GPU frame time > 16ms for 3 consecutive frames, or GPU memory usage > 80%;

[0237] Adjustment: Temporarily reduce the texture precision of all layers (except the core area) to reduce the amount of processing work per frame.

[0238] CPU overload trigger: Main thread frame time > 10ms and lasts for 5 frames;

[0239] Adjustment: Pause non-critical pre-rendering tasks and simplify text complexity calculations.

[0240] S3.3.4, Priority of triggering conditions and conflict handling:

[0241] Condition priority from high to low: system resource trigger > editing operation trigger > scrolling state trigger > content change trigger.

[0242] S4. Dynamic resource recycling mechanism.

[0243] S4.1 Timestamp Management:

[0244] Maintain a last access timestamp for each texture block and periodically (every 300ms) check the access time of all texture blocks.

[0245] S4.2, Calculation of recycling priority:

[0246] recyclePriority = (currentTime - lastAccessTime) × layerFactor

[0247] Where layerFactor is the layer factor (preloaded area = 1.0, edge area = 0.5, core area = 0.1).

[0248] S4.3, Recycling Trigger Conditions:

[0249] GPU memory usage exceeds a threshold (e.g., 70% of total capacity), there are texture blocks that have not been accessed for more than 5 seconds, and the number of textures in the preload area exceeds 3 times the view height.

[0250] Based on relevant experimental verification, this application has the following advantages:

[0251] Significantly improved scrolling smoothness: Through layered rendering and priority scheduling, frame rate stability is improved by 40-60% in fast scrolling scenarios, and a smooth experience of more than 60fps can still be maintained in extreme cases, achieving pixel-level smooth scrolling;

[0252] GPU resource utilization optimization: Dynamic texture management reduces GPU memory usage by 30-50% and reduces GPU computing load by more than 50%, which is particularly effective on memory-constrained mobile devices.

[0253] Enhanced visual consistency: Through multi-precision hierarchical design and progressive transition effects, the change of text from low precision to high precision is made more natural, reducing the visual jitter and discontinuity when scrolling quickly.

[0254] Strong adaptability: It can dynamically adjust the rendering strategy according to device performance, text content complexity and user scrolling habits, and provide the best balanced rendering effect on both high-end workstations and low-end mobile devices.

[0255] Improved rendering efficiency: By classifying content complexity and prioritizing scheduling, computing resources are concentrated in key visual areas, enabling more complex text rendering effects (such as multi-type syntax highlighting, embedded icons, etc.) to be supported under the same hardware conditions.

[0256] In summary, the above are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.< / int> < / int>

Claims

1. A method for accelerating editor rendering based on hierarchical texture caching and dynamic priority, characterized in that, Specifically, the following steps are included: The text view within the editor is divided into a core visible area, an edge visible area, and a preloaded area. The core visible area is the central area of ​​the visible view. The edge visible area includes the upper and lower edge areas adjacent to the core visible area. The preloaded area includes the upper and lower preloaded areas, which are both preloaded at a distance of preload height from the top and bottom of the core visible area. During initialization, the text content in the core visible area, edge visible area and preloaded area is pre-rendered as the corresponding texture objects, and the first mapping table between the text line index and the texture coordinates in the texture object is established. When actually rendering the visible view, the corresponding pre-rendered texture is generated based on the area where the text line is located. When the text line starts to move, predictive rendering is performed to update the texture object and the first mapping table based on the obtained scrolling state and text line position. When the area where the text line is located changes, the texture object is searched according to the first mapping table. If it exists, the texture object is used. Otherwise, high-precision rendering, medium-precision rendering, or low-precision rendering is used to update the texture object and the first mapping table according to whether the new area is the core visible area, the edge visible area, or the preloaded area. Calculate the recycling priority of the corresponding texture object based on the current time, last access time and the corresponding texture area. When the recycling trigger condition is met, recycle the corresponding texture object according to the recycling priority to release GPU memory. The predictive rendering process is as follows: when the scrolling speed and direction stability are both greater than the corresponding thresholds in the scrolling state, and the distance between the position of the text line and the boundary of the preload area is less than the threshold, a scrolling trajectory prediction model is selected based on the scrolling speed and acceleration, the range of text lines that will enter the visible view in the future prediction window is calculated, the line number of the text lines is determined, and a predictive rendering task containing the text lines to be rendered, the corresponding texture area, and the priority is constructed; a rendering task queue is established according to the priority, and the predictive rendering tasks in the rendering task queue are executed sequentially using GPU idle time; the calculation weight of the priority is dynamically adjusted according to the scrolling state.

2. The editor rendering acceleration method according to claim 1, characterized in that, The core visible area has the following Y-coordinates: the top Y-coordinate is the sum of the top Y-coordinate of the visible view and the visible view height proportional to the top; the bottom Y-coordinate is the sum of the visible view height proportional to the top and bottom of the visible view. In the edge visible area, the Y-coordinate range of the upper edge is a left-closed, right-open interval from the top Y-coordinate of the visible view to the top Y-coordinate of the core visible area; the Y-coordinate range of the lower edge is a left-open, right-closed interval from the bottom Y-coordinate of the core to the bottom Y-coordinate of the visible view. In the preloading area, the Y-coordinate range of the upper preloading area is a left-closed, right-open interval from the difference between the top Y-coordinate of the core visible area and the preloading height to the top Y-coordinate of the core visible area; the Y-coordinate range of the lower preloading area is a left-open, right-closed interval from the bottom Y-coordinate of the core visible area to the sum of the bottom Y-coordinate of the core visible area and the preloading height.

3. The editor rendering acceleration method according to claim 1, characterized in that, The method for obtaining the rolling state is as follows: the rolling position and rolling direction are sampled at a set frequency, the timestamp and displacement of each sample are recorded, the sampled data are smoothed using a sliding window, the rolling speed, acceleration and directional stability are calculated using the sampled data, and the rolling state is formed by the rolling speed, acceleration and directional stability, where the directional stability is the number of consecutive rolls in the same direction.

4. The editor rendering acceleration method according to claim 1, characterized in that, The rolling trajectory prediction model includes: a linear prediction model suitable for uniform rolling, a quadratic prediction model suitable for uniformly variable rolling, and an automatic switching model based on the acceleration value. The linear prediction model uses the uniform motion calculation formula, the quadratic prediction model uses the uniformly variable motion calculation formula, and the automatic switching model selects either the linear prediction model or the quadratic prediction model based on the relationship between acceleration and a threshold.

5. The editor rendering acceleration method according to claim 1, characterized in that, The priority is calculated as follows: Priority = (S × Ws) + (T × Wt) + (C × Wc), where Priority is the priority, S is the spatial factor, T is the time factor, C is the content factor, and Ws, Wt, and Wc are all weights with a sum of 1.

0.

6. The editor rendering acceleration method according to claim 1, characterized in that, When a text line moves across regions, the transition blending factor is the ratio of the portion of the text line in the new region to the portion remaining in the original region, with a value range of [0, 1.0]. When the transition blending factor is greater than 0, the rendering results of the corresponding precision levels of the new and original regions are preserved. When transitioning from low precision to high precision, a power function with a smaller exponent is used to accelerate the display of high-precision components, and when transitioning from high precision to low precision, a power function with a larger exponent is used to delay the display of low-precision components. The transition duration is dynamically adjusted according to the scrolling speed. When the blending factor is equal to 1.0, low-precision rendering and caching are stopped, and the texture resources of the corresponding precision level of the original region are released.

7. The editor rendering acceleration method according to claim 1, characterized in that, The high-precision rendering renders the core visible area as the first core texture. Specifically, it involves: obtaining complete information about all text lines in the current region, including character encoding, font attributes, syntax highlighting rules, preset markers, and embedded elements; initializing the first core texture; setting the high-precision texture resolution; configuring the GPU high-precision rendering state; and setting the sampling quality parameter to the highest level. High-precision glyph rasterization is then performed on each text line, syntax highlighting and preset styles are rendered, and the text layer, background layer, and decoration layer are synthesized in Z-axis order using a precise alpha blending formula. The rendering result is then used to update the first core texture, record the timestamp, and update the first mapping table.

8. The editor rendering acceleration method according to claim 1, characterized in that, The medium-precision rendering renders the visible edge area as the first edge texture. Specifically, it involves: obtaining the basic information of all text lines in the current region, omitting secondary decorative details, initializing the first edge texture, setting the medium-precision texture resolution, configuring the GPU medium-precision rendering state, and setting the sampling quality parameter to medium level; performing medium-precision glyph rasterization on each text line, rendering simplified syntax highlighting and preset styles, using a simplified alpha blending formula to synthesize the base layer, updating the first edge texture with the rendering result, recording the timestamp, and updating the first mapping table.

9. The editor rendering acceleration method according to claim 1, characterized in that, The low-precision rendering renders the preloaded area as the first preloaded texture, specifically: obtaining the minimized information of all text lines in the current region, containing only character sequences and basic styles; initializing the first preloaded texture, setting the low-precision texture resolution, and configuring the low-precision GPU rendering state; performing low-precision glyph rasterization on each text line, performing minimized layer compositing to preserve a simple overlay of the text layer and the background layer, updating the first preloaded texture with the rendering result, recording the timestamp, and updating the first mapping table.

Citation Information

Patent Citations

  • Interface rendering method, system and device and readable storage medium

    CN118332212A

  • Ultra-long list rendering method based on embedded platform

    CN119336426A