Dynamic CPU GPU Frame Rendering Selection
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current 2D graphic libraries face performance issues due to inefficient selection between CPU and GPU drawing methods, leading to suboptimal UI response times, as developers lack the ability to dynamically determine the most efficient rendering approach for each frame based on specific drawing commands and parameters.
Innovation Solution
A method that determines CPU and GPU drawing times for each frame by traversing drawing commands and parameters, querying a performance table, and calculating times as needed, then dynamically selects the CPU or GPU for drawing based on which method requires less time, thereby optimizing frame rendering.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If the GPU drawing manner is adopted for drawing of a small scene, then the device complexity increases, but the productivity decreases
Solution Approach 1:
The patent implements dynamic selection between CPU and GPU drawing manners based on real-time scene characteristics. The system evaluates drawing command sets and dynamically determines whether to use CPU or GPU for each frame, rather than using a fixed drawing manner. This dynamic adaptation resolves the contradiction by matching the drawing processor to the specific requirements of each scene, improving productivity while maintaining adaptability.
Solution Approach 2:
The patent changes the parameter of drawing processor selection based on scene parameters. By analyzing drawing command sets and scene characteristics, the system adjusts which processor (CPU or GPU) is used for drawing. This parameter-based selection optimizes drawing performance for different scene types, resolving the contradiction between adaptability and productivity.
2Device complexity
If the CPU drawing manner is adopted for drawing of a large scene, then the device complexity decreases, but the productivity decreases
Solution Approach 1:
The system dynamically selects between CPU and GPU drawing based on scene complexity and size. For large scenes, the system automatically determines when GPU acceleration is beneficial and switches to GPU drawing, rather than always using CPU. This dynamic approach maintains simplicity for CPU-only cases while unlocking GPU performance when needed, resolving the productivity issue without unnecessarily increasing complexity.
Solution Approach 2:
The patent performs preliminary analysis of the drawing command set before actual drawing execution. By evaluating the drawing commands in advance, the system determines the optimal drawing manner (CPU or GPU) before rendering begins. This preliminary action allows the system to prepare the appropriate drawing pipeline, ensuring optimal performance for both small and large scenes without requiring complex runtime switching mechanisms.
3Device complexity
If a fixed drawing manner is configured in the application program, then the device complexity decreases, but the productivity decreases due to suboptimal frame rendering
Solution Approach 1:
The patent implements self-service by having the system automatically select the optimal drawing manner without requiring developer configuration or intervention. The system analyzes drawing command sets and autonomously determines whether to use CPU or GPU for each frame. This self-service capability eliminates the need for fixed configurations while achieving optimal performance, resolving the contradiction by making the system both simple to use (no configuration needed) and highly productive.
Solution Approach 2:
The system incorporates feedback mechanisms by evaluating drawing command sets and scene characteristics to determine the optimal drawing approach. The system continuously assesses drawing requirements and adjusts processor selection accordingly. This feedback-driven approach enables automatic optimization of UI response time without requiring complex configuration systems, resolving the contradiction between simplicity and performance.
Data Source
Figure 1
Figure 2a
Figure 2b
AI summary
Embodiments of the present invention relate to computer technologies. The embodiments of the present invention provide a drawing method, apparatus, and terminal, where: a drawing command set of a current frame is received; a CPU drawing time and a GPU drawing time of the current frame are determined according to the drawing command set of the current frame; and if the CPU drawing time is less than the GPU drawing time, the CPU is used to draw the current frame, and if the CPU drawing time is longer than the GPU drawing time, the GPU is used to draw the current frame. In this way, which drawing manner is adopted is dynamically determined according to the drawing time corresponding to the CPU/GPU, so as to shorten a drawing time of each frame to some extent, thereby increasing a display speed of a system and improving display performance.