blob: a383fbff3c56aceeb3a70ab917210a0ec84a6769 [file] [log] [blame]
John Recke45b1fd2014-04-15 09:50:16 -07001/*
2 * Copyright (C) 2014 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#ifndef TREEINFO_H
17#define TREEINFO_H
18
John Recke45b1fd2014-04-15 09:50:16 -070019#include <utils/Timers.h>
John Recke45b1fd2014-04-15 09:50:16 -070020
21namespace android {
22namespace uirenderer {
23
John Reck52244ff2014-05-01 21:27:37 -070024class BaseAnimator;
25class AnimationListener;
John Recke45b1fd2014-04-15 09:50:16 -070026
John Reck52244ff2014-05-01 21:27:37 -070027class AnimationHook {
John Recke45b1fd2014-04-15 09:50:16 -070028public:
John Reck52244ff2014-05-01 21:27:37 -070029 virtual void callOnFinished(BaseAnimator* animator, AnimationListener* listener) = 0;
John Recke45b1fd2014-04-15 09:50:16 -070030protected:
John Reck52244ff2014-05-01 21:27:37 -070031 ~AnimationHook() {}
John Recke45b1fd2014-04-15 09:50:16 -070032};
33
34struct TreeInfo {
35 // The defaults here should be safe for everyone but DrawFrameTask to use as-is.
36 TreeInfo()
37 : hasFunctors(false)
38 , prepareTextures(false)
39 , performStagingPush(true)
40 , frameTimeMs(0)
41 , evaluateAnimations(false)
42 , hasAnimations(false)
John Reck52244ff2014-05-01 21:27:37 -070043 , animationHook(0)
John Recke45b1fd2014-04-15 09:50:16 -070044 {}
45
46 bool hasFunctors;
47 bool prepareTextures;
48 bool performStagingPush;
49
50 // Animations
51 nsecs_t frameTimeMs;
52 bool evaluateAnimations;
53 // This is only updated if evaluateAnimations is true
54 bool hasAnimations;
John Reck52244ff2014-05-01 21:27:37 -070055 AnimationHook* animationHook;
John Recke45b1fd2014-04-15 09:50:16 -070056
57 // TODO: Damage calculations
58};
59
60} /* namespace uirenderer */
61} /* namespace android */
62
63#endif /* TREEINFO_H */