A method, apparatus, device, and storage medium for controlling the frame rate of an animation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-06
- Publication Date
- 2026-08-11
AI Technical Summary
[0003]由于目前没有对各种类型动画的绘制流程进行统一控制的方法,因此,可能会出现同一界面上同时绘制多个动画时导致全局绘制帧率过大的情况发生
[0036] The technical solution provided in this disclosure has at least the following advantages compared with the prior art:
Smart Images

Figure CN115761057B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data processing, and in particular to a method, apparatus, device, and storage medium for controlling the frame rate of an animation. Background Technology
[0002] Currently, native animations in the Android system are mainly divided into animator-type animations, animation-type animations, and open-source lottie-type animations. The drawing process and drawing cycle of these animations are controlled by their own cycles, and there is no common scheduling strategy among them.
[0003] Currently, there is no unified method to control the rendering process of various types of animations. Therefore, it is possible for multiple animations to be rendered simultaneously on the same screen, resulting in an excessively high global rendering frame rate. For example, if a 20-frame animation and a 30-frame animation are rendered simultaneously on the same screen, and these two animations are rendered alternately, the global rendering frame rate will reach 50 frames per second. This not only increases the power consumption of the terminal device, but also causes a heavy load on the terminal device's CPU (Central Processing Unit) and GPU, which can easily lead to abnormal situations such as lag on the terminal device.
[0004] Therefore, how to control the animation frame rate to reduce the probability of the above-mentioned abnormal situations is a technical problem that urgently needs to be solved. Summary of the Invention
[0005] In order to solve the above-mentioned technical problems, or at least partially solve the above-mentioned technical problems, the present disclosure provides an animation frame rate control method, which can realize the control of animation frame rate.
[0006] In a first aspect, this disclosure provides a method for controlling the frame rate of an animation, the method comprising:
[0007] Intercept the drawing signal of the current frame of the target animation; wherein, the target animation belongs to the currently drawing animation;
[0008] Based on the preset animation frame rate drawing strategy and the drawing signal of the current frame of the target animation, it is determined whether the current frame of the target animation is a drawing frame;
[0009] If the current frame of the target animation is determined to be a drawing frame, then a drawing task for the current frame of the target animation is submitted;
[0010] Register the drawing signal for the next frame of the target animation.
[0011] In one optional implementation, the method further includes:
[0012] If it is determined that the current frame of the target animation is not a drawing frame, then the step of registering the drawing signal for the next frame of the target animation is triggered.
[0013] In one optional implementation, the method further includes:
[0014] Monitor whether the target animation is in a playback state;
[0015] If it is determined that the target animation is not playing, then the target animation is turned off.
[0016] In one optional implementation, the interception of the drawing signal of the current frame of the target animation includes:
[0017] When a drawing event of the target animation is detected, the drawing signal of the current frame of the target animation is intercepted.
[0018] In one optional implementation, the target animation is a Lottie type animation, and before intercepting the drawing signal of the current frame of the target animation when a drawing event of the target animation is detected, the method further includes:
[0019] The drawing events of the target animation are monitored using bytecode instrumentation.
[0020] In one optional implementation, the target animation is an animation of type animator or animation, and before intercepting the drawing signal of the current frame of the currently drawing animation, the method further includes:
[0021] The drawing events of the target animation are monitored using dynamic proxies.
[0022] In one optional implementation, the method further includes:
[0023] Record the drawing signals of each frame of the target animation;
[0024] Accordingly, determining whether the current frame of the target animation is a drawing frame based on the preset animation frame rate drawing strategy and the drawing signal of the current frame of the target animation includes:
[0025] Based on the preset animation frame rate drawing strategy and the drawing signals of each frame of the target animation, the drawing signal of the current frame of the target animation is processed to obtain the processing result of the current frame of the target animation.
[0026] Based on the processing result of the current frame of the target animation, it is determined whether the current frame of the target animation is a drawing frame.
[0027] In one optional implementation, the preset animation frame rate rendering strategy includes a preset frame rate reduction rendering strategy.
[0028] Secondly, this disclosure provides an animation frame rate control device, the device comprising:
[0029] An interception module is used to intercept the drawing signal of the current frame of the target animation; wherein, the target animation belongs to the currently drawing animation;
[0030] The determination module is used to determine whether the current frame of the target animation is a drawing frame based on a preset animation frame rate drawing strategy and the drawing signal of the current frame of the target animation.
[0031] The submission module is used to submit a drawing task for the current frame of the target animation when it is determined that the current frame of the target animation is a drawing frame;
[0032] The registration module is used to register the drawing signal for the next frame of the target animation.
[0033] Thirdly, this disclosure provides a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to implement the above-described method.
[0034] Fourthly, this disclosure provides an apparatus comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method described above.
[0035] Fifthly, this disclosure provides a computer program product comprising a computer program / instruction that, when executed by a processor, implements the method described above.
[0036] The technical solution provided in this disclosure has at least the following advantages compared with the prior art:
[0037] This disclosure provides a method for controlling the animation frame rate. First, the drawing signal of the current frame of the target animation is intercepted. Based on a preset animation drawing frame rate strategy and the drawing signal of the current frame of the target animation, it is determined whether the current frame of the target animation is a drawing frame. If it is determined that the current frame of the target animation is a drawing frame, a drawing task for the current frame of the target animation is submitted. Then, the drawing signal of the next frame of the target animation is registered to achieve control of the animation frame rate of the target animation. Therefore, this disclosure can achieve control of the animation frame rate of the currently drawing animation. Attached Figure Description
[0038] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0039] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 A flowchart of an animation frame rate control method provided in this disclosure embodiment;
[0041] Figure 2 This is a schematic diagram of an animation frame rate control process provided in an embodiment of the present disclosure;
[0042] Figure 3 A schematic diagram of the structure of an animation frame rate control device provided in an embodiment of this disclosure;
[0043] Figure 4 This is a schematic diagram of the structure of an animation frame rate control device provided in an embodiment of the present disclosure. Detailed Implementation
[0044] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0045] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.
[0046] Currently, the drawing processes of multiple currently drawing animations on the same interface are independent of each other, and there is no unified control method to control the animation frame rate.
[0047] To control the frame rate of an animation being rendered, this disclosure provides a method for controlling the animation frame rate. First, the rendering signal of the current frame of the target animation is intercepted. Based on a preset animation rendering frame rate strategy and the rendering signal of the current frame of the target animation, it is determined whether the current frame of the target animation is a rendering frame. If it is determined that the current frame of the target animation is a rendering frame, a rendering task for the current frame of the target animation is submitted. Then, the rendering signal of the next frame of the target animation is registered to achieve control over the animation frame rate of the target animation. Therefore, the embodiments of this disclosure can achieve control over the animation frame rate of the currently rendering animation.
[0048] Based on this, the present disclosure provides a method for controlling the animation frame rate, referring to... Figure 1 The flowchart below illustrates a method for controlling the frame rate of an animation according to an embodiment of this disclosure. The method includes:
[0049] S101: Intercept the drawing signal of the current frame of the target animation.
[0050] The target animation is part of the currently drawn animation.
[0051] The animation frame rate control method provided in this disclosure can be applied to a controller, which can be deployed on a terminal device, such as a smartphone, tablet, or laptop, to control the animation frame rate.
[0052] In this embodiment of the disclosure, the target animation can be any animation in the currently drawn animation, and the type of the target animation can be any type of animation, such as an animation of type animator, animation of type animation, or animation of type lottie, etc. This embodiment of the disclosure does not limit the type of the target animation.
[0053] In one alternative implementation, when the controller listens for a draw event of the target animation, it intercepts the draw signal of the current frame of the target animation.
[0054] Since different types of animations listen for drawing events in different ways, before controlling the animation frame rate of the target animation, the controller first needs to have the ability to listen for the drawing events of the target animation and intercept the drawing signals of the target animation so that it can intercept the drawing signal of the current frame of the target animation and then control the animation frame rate of the target animation.
[0055] In one alternative implementation, when the target animation is a Lottie type animation, the controller can use bytecode instrumentation to listen for the drawing events of the target animation.
[0056] Specifically, the drawing operation of Lottie-type animations is performed by the LottieValueAnimator component. The LottieValueAnimator component uses its own drawing signal registration method for drawing, and the drawing operation is performed in the doFrame function. Therefore, this embodiment can instrument the doFrame function to add controller logic before the doFrame function, thereby enabling the controller to listen for the drawing events of the target animation.
[0057] In another alternative implementation, when the target animation is an animation of type animator or animation, the drawing events of the target animation can be listened to using dynamic proxies.
[0058] Specifically, the drawing of animator-type animations or animation-type animations is controlled by AnimationHandler, which controls mAnimate and frameCallbackProvider. In this embodiment, dynamic proxy is used to add control logic to the controller, thereby enabling the controller to listen to the drawing events of the target animation.
[0059] For animations of the animator type, this embodiment of the disclosure can replace the mAnimate object in the AnimationHandler internal object of android.animation.ValueAnimator through dynamic proxy, thereby adding controller logic before the ValueAnimator drawing operation.
[0060] In addition, for animations of type animation, this embodiment of the disclosure can replace the AnimationFrameCallbackProvider in android.animation.AnimationHandler with a dynamic proxy, thereby realizing the logic control of PostFrameCallback and adding the control logic of the controller when executing postFrame.
[0061] In this embodiment of the disclosure, when a drawing event of the target animation is detected based on the above method, the drawing signal of the current frame of the target animation is intercepted. The drawing signal of the current frame can be a drawing frame or a non-drawing frame.
[0062] S102: Based on the preset animation frame rate drawing strategy and the drawing signal of the current frame of the target animation, determine whether the current frame of the target animation is a drawing frame.
[0063] In this embodiment of the disclosure, after intercepting the drawing signal of the current frame of the target animation, the animation frame rate of the target animation is controlled in combination with a preset animation frame rate drawing strategy to determine whether the current frame of the target animation is a drawing frame.
[0064] The preset animation frame rate rendering strategy in this embodiment can be various types of animation frame rate rendering strategies, such as preset animation frame rate alignment strategy, preset frame rate reduction rendering strategy, etc.
[0065] In one optional implementation, the preset animation frame rate drawing strategy may include a preset animation frame rate alignment strategy, wherein the preset animation frame rate alignment strategy is used to align the frame rates of multiple animations before drawing, thereby avoiding an excessively high global drawing frame rate.
[0066] Specifically, after the controller intercepts the drawing signal of the current frame of the target animation, it can align the drawing signal of the current frame of the target animation with the animation frame rate alignment strategy, thereby determining whether the current frame of the aligned target animation is a drawing frame.
[0067] In another optional implementation, the preset animation frame rate rendering strategy may include a preset frame reduction rendering strategy, wherein the preset frame reduction rendering strategy is used to reduce the current rendering frame rate so as to reduce the number of frames rendered per second.
[0068] In practical applications, the controller has the ability to record the animation rendering frame rate. Specifically, the controller can record the rendering signals of each frame of the target animation. When it intercepts the rendering signal of the current frame of the target animation, it can process the rendering signal of the current frame of the target animation based on the preset animation frame rate rendering strategy and the rendering signals of each frame of the target animation to obtain the processing result of the current frame of the target animation. Then, based on the processing result of the current frame of the target animation, it determines whether the current frame of the target animation is a rendering frame.
[0069] For example, the recorded rendering signals of each frame of the target animation can indicate the animation frame rate, say 60fps. A preset animation frame rate rendering strategy is used to reduce the frame rate from 60fps to 30fps. Therefore, when the controller intercepts the rendering signal of the current frame of the target animation, it can process the rendering signal based on the strategy of reducing the frame rate from 60fps to 30fps to determine whether the current frame of the target animation is a rendering frame. For instance, if the rendering signal of the current frame of the target animation is processed from 1 to 0, it can be determined that the current frame of the target animation is not a rendering frame.
[0070] S103: If it is determined that the current frame of the target animation is a drawing frame, then submit a drawing task for the current frame of the target animation.
[0071] In this embodiment of the disclosure, when the controller determines that the current frame of the target animation is a drawing frame, it can submit the drawing task of the current frame of the target animation to the GPU so that the GPU can draw the current frame.
[0072] S104: Register the drawing signal for the next frame of the target animation.
[0073] In this embodiment of the disclosure, in order to ensure that the drawing signal is not interrupted, after the controller submits the drawing task for the current frame to the GPU, it can also register the drawing signal for the next frame of the target animation so as to draw the next frame.
[0074] In one alternative implementation, if the controller determines that the current frame of the target animation is not a drawing frame, the controller does not need to submit a drawing task for the current frame to the GPU. Instead, it directly registers the drawing signal for the next frame of the target animation to ensure that the drawing signal is not interrupted.
[0075] This disclosure provides a method for controlling the animation frame rate. First, the drawing signal of the current frame of the target animation is intercepted. Based on a preset animation drawing frame rate strategy and the drawing signal of the current frame of the target animation, it is determined whether the current frame of the target animation is a drawing frame. If it is determined that the current frame of the target animation is a drawing frame, a drawing task for the current frame of the target animation is submitted. Then, the drawing signal of the next frame of the target animation is registered to achieve control of the animation frame rate of the target animation. Therefore, this disclosure can achieve control of the animation frame rate of the currently drawing animation.
[0076] Additionally, when an animation enters background playback or the animation drawing area exceeds the displayable area of the interface, the animation can be stopped by controlling it to reduce the consumption of system resources.
[0077] Therefore, the animation frame rate control method provided in this embodiment can also monitor whether the target animation is in a playback state. If it is determined that the target animation is not in a playback state, the target animation is turned off. Here, "target animation is not in a playback state" means that the target animation is not in a playback state within the displayable area of the current interface.
[0078] If it is determined that the target animation is in the aforementioned playback state, the animation frame rate of the target animation can be controlled based on the animation frame rate control method provided in this embodiment.
[0079] As can be seen, the animation frame rate control method provided in this embodiment can not only control the animation frame rate of the currently drawn animation, but also control the animation to stop playing, so as to reduce the consumption of system resources.
[0080] To further understand the animation frame rate control method provided in this disclosure, based on the content of the above embodiments, this disclosure provides a schematic diagram of the animation frame rate control process, as follows: Figure 2 As shown, the control flow of the animation frame rate is executed by the controller.
[0081] Specifically, for Lottie-type animations, the controller can intercept the drawing signal of the current frame of the target animation when executing the doFrame function in the LottieValueAnimator component.
[0082] For animations of the animator type, the controller can intercept the drawing signal of the current frame of the target animation when executing the doAnimationFrame function in the Animator component.
[0083] For animations of type animation, the controller can intercept the drawing signal of the current frame of the target animation when executing the AnimationFrameCallback function in the Animator(N) component.
[0084] After intercepting the drawing signals of the current frame of each currently drawing animation, the controller can determine whether the current frame of each animation is a drawing frame based on a preset animation frame rate drawing strategy. If it is determined that the current frame of a certain currently drawing animation is a drawing frame, the controller submits a drawing task for that animation's current frame to the GPU. To ensure that the drawing signals are not interrupted, the controller also needs to register the drawing signals for the next frame of the animation.
[0085] like Figure 2 As shown, for Lottie-type animations, the controller registers the drawing signal for the next frame of the target animation by triggering the execution of the postFrameCallback function in the LottieValueAnimator component, so as to ensure that the drawing signal of the target animation is not interrupted.
[0086] For animator-type animations, the controller registers the drawing signal for the next frame of the target animation by triggering the execution of the scheduleAnimation function in the Animator component, so as to ensure that the drawing signal of the target animation is not interrupted.
[0087] For animations of type animation, the controller registers the drawing signal for the next frame of the target animation by triggering the addAnimationFrameCallback function in the Animator(N) component, so as to ensure that the drawing signal of the target animation is not interrupted.
[0088] In addition, the controller can also listen to the playback status of the target animation. Specifically, the controller determines the playback status of the target animation by listening to the Activity status of the target animation. If it is determined that the Activity status is no longer active, it means that the target animation may have entered the background. In order to avoid consuming system resources, the controller can control the closing of the target animation.
[0089] In addition, the controller can record the drawing signals of each frame of the target animation, so as to determine the animation frame rate of the target animation based on the recorded drawing signals, and then use it to perform frame reduction and other processing on the target animation.
[0090] Specifically, the controller listens to the drawing signal, records the number of times the drawing signal is drawn, and selects to reduce the frame rate by different percentages based on the number of drawing times.
[0091] The animation frame rate control method provided in this embodiment is applied to a controller. The controller can intercept the drawing process of each currently drawing animation and control the animation frame rate by uniformly managing the drawing process.
[0092] Based on the above method embodiments, this disclosure also provides an animation frame rate control device, with reference to... Figure 3 This is a schematic diagram of an animation frame rate control device provided in an embodiment of the present disclosure. The device includes:
[0093] The interception module 301 is used to intercept the drawing signal of the current frame of the target animation; wherein, the target animation belongs to the currently drawing animation;
[0094] The determining module 302 is used to determine whether the current frame of the target animation is a drawing frame based on a preset animation frame rate drawing strategy and the drawing signal of the current frame of the target animation.
[0095] The submission module 303 is used to submit a drawing task for the current frame of the target animation when it is determined that the current frame of the target animation is a drawing frame.
[0096] The registration module 304 is used to register the drawing signal for the next frame of the target animation.
[0097] In one optional embodiment, the apparatus further includes:
[0098] The triggering module is used to trigger the execution of the registration module when it is determined that the current frame of the target animation is not a drawing frame.
[0099] In one optional embodiment, the apparatus further includes:
[0100] The first monitoring module is used to monitor whether the target animation is in a playback state;
[0101] The closing module is used to close the target animation when it is determined that the target animation is not in a playback state.
[0102] In one optional implementation, the interception module is specifically used for:
[0103] When a drawing event of the target animation is detected, the drawing signal of the current frame of the target animation is intercepted.
[0104] In one optional implementation, the target animation is a Lottie-type animation, and the apparatus further includes:
[0105] The second listening module is used to listen for the drawing events of the target animation by bytecode instrumentation.
[0106] In one optional implementation, the target animation is an animation of type animator or animation, and the apparatus further includes:
[0107] The third listening module is used to listen for the drawing events of the target animation through dynamic proxies.
[0108] In one optional embodiment, the apparatus further includes:
[0109] A recording module is used to record the drawing signals of each frame of the target animation;
[0110] Accordingly, the determining module includes:
[0111] The processing submodule is used to process the drawing signal of the current frame of the target animation based on the preset animation frame rate drawing strategy and the drawing signals of each frame of the target animation, so as to obtain the processing result of the current frame of the target animation.
[0112] The determination submodule is used to determine whether the current frame of the target animation is a drawing frame based on the processing result of the current frame of the target animation.
[0113] In one optional implementation, the preset animation frame rate rendering strategy includes a preset frame rate reduction rendering strategy.
[0114] The animation frame rate control device provided in this embodiment first intercepts the drawing signal of the current frame of the target animation, and determines whether the current frame of the target animation is a drawing frame based on a preset animation drawing frame rate strategy and the drawing signal of the current frame of the target animation. If it is determined that the current frame of the target animation is a drawing frame, a drawing task for the current frame of the target animation is submitted. Then, the drawing signal of the next frame of the target animation is registered to achieve control of the animation frame rate of the target animation. Therefore, this embodiment can achieve control of the animation frame rate of the currently drawing animation.
[0115] In addition to the methods and apparatus described above, this disclosure also provides a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to implement the animation frame rate control method described in this disclosure.
[0116] This disclosure also provides a computer program product, which includes a computer program / instruction. When the computer program / instruction is executed by a processor, it implements the animation frame rate control method described in this disclosure.
[0117] In addition, this disclosure also provides an animation frame rate control device, see [link to relevant documentation]. Figure 4 As shown, it may include:
[0118] The device includes a processor 401, a memory 402, an input device 403, and an output device 404. The number of processors 401 in the animation frame rate control device can be one or more. Figure 4 Taking a processor as an example. In some embodiments of this disclosure, the processor 401, memory 402, input device 403, and output device 404 can be connected via a bus or other means, wherein, Figure 4 Taking the example of a connection between China and Israel via a bus.
[0119] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing of the animation frame rate control device by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function, etc. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. The input device 403 can be used to receive input digital or character information, and generate signal inputs related to user settings and function control of the animation frame rate control device.
[0120] Specifically in this embodiment, the processor 401 will load the executable files corresponding to the processes of one or more applications into the memory 402 according to the following instructions, and the processor 401 will run the applications stored in the memory 402 to realize the various functions of the animation frame rate control device.
[0121] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0122] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for controlling the frame rate of an animation, characterized in that, The method includes: Intercept the drawing signal of the current frame of the target animation; wherein, the target animation belongs to the currently drawing animation; Based on a preset animation frame rate rendering strategy and the rendering signal of the current frame of the target animation, it is determined whether the current frame of the target animation is a rendering frame; wherein, the preset animation frame rate rendering strategy includes a preset animation frame rate alignment strategy, which is used to align the frame rates of multiple animations, including the target animation. If the current frame of the target animation is determined to be a drawing frame, then a drawing task for the current frame of the target animation is submitted; Register the drawing signal for the next frame of the target animation.
2. The method according to claim 1, characterized in that, The method further includes: If it is determined that the current frame of the target animation is not a drawing frame, then the step of registering the drawing signal for the next frame of the target animation is triggered.
3. The method according to claim 1, characterized in that, The method further includes: Monitor whether the target animation is in a playback state; If it is determined that the target animation is not playing, then the target animation is turned off.
4. The method according to claim 1, characterized in that, The drawing signal of the current frame of the intercepted target animation includes: When a drawing event of the target animation is detected, the drawing signal of the current frame of the target animation is intercepted.
5. The method according to claim 4, characterized in that, The target animation is a Lottie type animation. Before intercepting the drawing signal of the current frame of the target animation when the drawing event of the target animation is detected, the method further includes: The drawing events of the target animation are monitored using bytecode instrumentation.
6. The method according to claim 4, characterized in that, The target animation is an animation of type animator or animation. Before intercepting the drawing signal of the current frame of the target animation, the method further includes: The drawing events of the target animation are monitored using dynamic proxies.
7. The method according to claim 1, characterized in that, The method further includes: Record the drawing signals of each frame of the target animation; Accordingly, determining whether the current frame of the target animation is a drawing frame based on the preset animation frame rate drawing strategy and the drawing signal of the current frame of the target animation includes: Based on the preset animation frame rate drawing strategy and the drawing signals of each frame of the target animation, the drawing signal of the current frame of the target animation is processed to obtain the processing result of the current frame of the target animation. Based on the processing result of the current frame of the target animation, it is determined whether the current frame of the target animation is a drawing frame.
8. The method according to claim 7, characterized in that, The preset animation frame rate rendering strategy includes a preset frame rate reduction rendering strategy.
9. A device for controlling the frame rate of an animation, characterized in that, The device includes: An interception module is used to intercept the drawing signal of the current frame of the target animation; wherein, the target animation belongs to the currently drawing animation; A determining module is used to determine whether the current frame of the target animation is a drawing frame based on a preset animation frame rate drawing strategy and the drawing signal of the current frame of the target animation; wherein, the preset animation frame rate drawing strategy includes a preset animation frame rate alignment strategy, which is used to align the frame rates of multiple animations, including the target animation; The submission module is used to submit a drawing task for the current frame of the target animation when it is determined that the current frame of the target animation is a drawing frame; The registration module is used to register the drawing signal for the next frame of the target animation.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a terminal device, cause the terminal device to perform the method as described in any one of claims 1-8.
11. A device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method as claimed in any one of claims 1-8.
12. A computer program product, characterized in that, The computer program product includes a computer program / instruction that, when executed by a processor, implements the method as described in any one of claims 1-8.
Citation Information
Patent Citations
Method and device for rendering animation
CN102831630A
Frame display processing method and device, terminal device and storage medium
CN109753262A