Rendering for electronic devices
Aspects of the subject technology relate to providing frame rate arbitration for electronic devices. Frame rate arbitration can include determining a global frame rate based on frame rate parameters from one or more animation sources, and providing the global frame rate to the animation sources. The frame rate parameters for various animations sources can have differing preferred, minimum, and/or maximum frame rates, and the global frame rate may be determined for concurrent display of multiple animations from the multiple animation sources. In one or more implementations, frame rate arbitration can also be performed based on frame rate parameters from an input source.
1 . A method comprising:
providing, from a first animation source and to a system process, first frame rate parameters corresponding to a first animated content generated by the first animation source, the first frame rate parameters including at least one frame rate parameter different from a first global frame rate previously received by the first animation source;
receiving, from the system process, a second global frame rate based on the first frame rate parameters and second frame rate parameters corresponding to a second animated content provided by a second animation source, wherein the second global frame rate is different from the first global frame rate; and
switching a first frame rate for the first animation content to a second frame rate compatible with the second global frame rate at a scheduled transition timing.
2 . The method of claim 1 , further comprising:
receiving, with the second global frame rate, a time stamp indicating the scheduled transition timing when the switching is to occur.
3 . The method of claim 1 , wherein the scheduled transition timing of switching corresponds to a VSYNC signal.
4 . The method of claim 1 , wherein, after receiving the second global frame rate and prior to switching the first frame rate for the first animation content, the second animation source provides updated second frame rate parameters to the system process, the method further comprising:
receiving a third global frame rate different from the second global frame rate, the third global frame rate based on the first frame rate parameters and the updated second frame rate parameters, the third global frame rate replacing the second global frame rate.
5 . The method of claim 1 , wherein the first frame rate parameters include two or more of a minimum frame rate, a maximum frame rate, or a preferred frame rate.
6 . The method of claim 1 , further comprising:
after switching the first frame rate for the first animation content, providing the first animated content at an even-quanta of the second global frame rate to a rendering service.
7 . The method of claim 1 , wherein the first frame rate parameters include a minimum frame rate and a maximum frame rate, wherein the second frame rate comprises a frame rate which is interposed between the minimum frame rate and the maximum frame rate, and which is closest to the second global frame rate.
8 . The method of claim 1 , wherein the first animated content corresponds to a scrolling animation, and wherein the first animation source is configured to determine the first frame rate parameters by:
receiving a user scrolling input; and
applying the user scrolling input to a model to obtain the first frame rate parameters.
9 . An electronic device comprising:
a memory; and
one or more processors configured to:
provide, from a first animation source and to a system process, first frame rate parameters corresponding to a first animated content generated by the first animation source, the first frame rate parameters including at least one frame rate parameter different from a first global frame rate previously received by the first animation source;
receive, from the system process, a second global frame rate based on the first frame rate parameters and second frame rate parameters corresponding to a second animated content provided by a second animation source, wherein the second global frame rate is different from the first global frame rate; and
switch a first frame rate for the first animation content to a second frame rate compatible with the second global frame rate at a scheduled transition timing.
10 . The electronic device of claim 9 , wherein the one or more processors are further configured to:
receive, with the second global frame rate, a time stamp indicating the scheduled transition timing when the switching is to occur.
11 . The electronic device of claim 9 , wherein the scheduled transition timing of switching corresponds to a VSYNC signal.
12 . The electronic device of claim 9 , wherein, after receiving the second global frame rate and prior to switching the first frame rate for the first animation content, the second animation source provides updated second frame rate parameters to the system process, and wherein the one or more processors are further configured to:
receive a third global frame rate different from the second global frame rate, the third global frame rate based on the first frame rate parameters and the updated second frame rate parameters, the third global frame rate replacing the second global frame rate.
13 . The electronic device of claim 9 , wherein the first frame rate parameters include two or more of a minimum frame rate, a maximum frame rate, or a preferred frame rate.
14 . The electronic device of claim 9 , further comprising:
after switching the first frame rate for the first animation content to the second frame rate, providing the first animated content at an even-quanta of the second global frame rate to a rendering service.
15 . The electronic device of claim 9 , wherein the first frame rate parameters include a minimum frame rate and a maximum frame rate, wherein the second frame rate comprises a frame rate which is interposed between the minimum frame rate and the maximum frame rate, and which is closest to the second global frame rate.
16 . The electronic device of claim 9 , wherein the first animated content corresponds to a scrolling animation, and wherein the one or more processors are further configured to determine the first frame rate parameters by:
receiving a user scrolling input; and
applying the user scrolling input to a model to obtain the first frame rate parameters.
17 . The method of claim 1 , wherein the switching is performed in response to control signals from the system process that include timing information indicating when the scheduled transition timing is to occur.
18 . The method of claim 17 , wherein the control signals further include learned information based on prior animation behavior or input-derived frame-rate parameters.
19 . A non-transitory machine-readable medium storing instructions which, when executed by one or more processors, cause the one or more processors to perform operations including:
providing, from a first animation source and to a system process, first frame rate parameters corresponding to a first animated content generated by the first animation source, the first frame rate parameters including at least one frame rate parameter different from a first global frame rate previously received by the first animation source;
receiving, from the system process, a second global frame rate based on the first frame rate parameters and second frame rate parameters corresponding to a second animated content provided by a second animation source, wherein the second global frame rate is different from the first global frame rate; and
switching a first frame rate for the first animation content to a second frame rate compatible with the second global frame rate at a scheduled transition timing.
20 . The non-transitory machine-readable medium of claim 19 , the operations further including:
after switching the first frame rate for the first animation content to the second frame rate, providing the first animated content at an even-quanta of the second global frame rate to a rendering service, wherein the scheduled transition timing of switching corresponds to a VSYNC signal or a time stamp provided by the system process.