Home | History | Annotate | Download | only in common
      1 /*
      2  * Copyright 2018 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 #pragma once
     18 
     19 #include <android/choreographer.h>
     20 
     21 // Declare the types, even if we can't access the functions.
     22 #if __ANDROID_API__ < 24
     23 
     24 struct AChoreographer;
     25 typedef struct AChoreographer AChoreographer;
     26 
     27 /**
     28  * Prototype of the function that is called when a new frame is being rendered.
     29  * It's passed the time that the frame is being rendered as nanoseconds in the
     30  * CLOCK_MONOTONIC time base, as well as the data pointer provided by the
     31  * application that registered a callback. All callbacks that run as part of
     32  * rendering a frame will observe the same frame time, so it should be used
     33  * whenever events need to be synchronized (e.g. animations).
     34  */
     35 typedef void (*AChoreographer_frameCallback)(long frameTimeNanos, void* data);
     36 
     37 #endif
     38