TreeInfo.h revision e45b1fd03b524d2b57cc6c222d89076a31a08bea
1e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck/*
2e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck * Copyright (C) 2014 The Android Open Source Project
3e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck *
4e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck * Licensed under the Apache License, Version 2.0 (the "License");
5e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck * you may not use this file except in compliance with the License.
6e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck * You may obtain a copy of the License at
7e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck *
8e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck *      http://www.apache.org/licenses/LICENSE-2.0
9e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck *
10e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck * Unless required by applicable law or agreed to in writing, software
11e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck * distributed under the License is distributed on an "AS IS" BASIS,
12e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck * See the License for the specific language governing permissions and
14e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck * limitations under the License.
15e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck */
16e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck#ifndef TREEINFO_H
17e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck#define TREEINFO_H
18e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck
19e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck#include <cutils/compiler.h>
20e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck#include <utils/Timers.h>
21e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck#include <utils/StrongPointer.h>
22e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck
23e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Recknamespace android {
24e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Recknamespace uirenderer {
25e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck
26e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reckclass RenderPropertyAnimator;
27e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck
28e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reckclass AnimationListener {
29e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reckpublic:
30e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck    ANDROID_API virtual void onAnimationFinished(const sp<RenderPropertyAnimator>&) = 0;
31e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reckprotected:
32e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck    ANDROID_API virtual ~AnimationListener() {}
33e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck};
34e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck
35e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reckstruct TreeInfo {
36e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck    // The defaults here should be safe for everyone but DrawFrameTask to use as-is.
37e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck    TreeInfo()
38e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck            : hasFunctors(false)
39e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck            , prepareTextures(false)
40e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck            , performStagingPush(true)
41e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck            , frameTimeMs(0)
42e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck            , evaluateAnimations(false)
43e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck            , hasAnimations(false)
44e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck            , animationListener(0)
45e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck    {}
46e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck
47e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck    bool hasFunctors;
48e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck    bool prepareTextures;
49e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck    bool performStagingPush;
50e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck
51e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck    // Animations
52e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck    nsecs_t frameTimeMs;
53e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck    bool evaluateAnimations;
54e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck    // This is only updated if evaluateAnimations is true
55e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck    bool hasAnimations;
56e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck    AnimationListener* animationListener;
57e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck
58e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck    // TODO: Damage calculations
59e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck};
60e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck
61e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck} /* namespace uirenderer */
62e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck} /* namespace android */
63e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck
64e45b1fd03b524d2b57cc6c222d89076a31a08beaJohn Reck#endif /* TREEINFO_H */
65