diff options
| author | 2017-12-06 11:51:59 -0800 | |
|---|---|---|
| committer | 2017-12-06 14:24:49 -0800 | |
| commit | 5364be50cd0431c3b323fd8a3725df5146d01e99 (patch) | |
| tree | 379823ce960e903a2ba0313591c947ee2d595cf7 /cmds/bootanimation/BootAnimation.cpp | |
| parent | 8ab47567b2140da30257bc4e3b70495c8f17281e (diff) | |
| parent | 592f539419226f5d8652c434b34885b93fda0f8d (diff) | |
DO NOT MERGE: Merge Oreo MR1 into master
Exempt-From-Owner-Approval: Changes already landed internally
Change-Id: I727a014df2fb05a4b13cb67b1fcb760a8b387523
Diffstat (limited to 'cmds/bootanimation/BootAnimation.cpp')
| -rw-r--r-- | cmds/bootanimation/BootAnimation.cpp | 17 | 
1 files changed, 7 insertions, 10 deletions
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp index 6b2de4b7f1ff..6526123aba13 100644 --- a/cmds/bootanimation/BootAnimation.cpp +++ b/cmds/bootanimation/BootAnimation.cpp @@ -96,11 +96,9 @@ static constexpr size_t TEXT_POS_LEN_MAX = 16;  // --------------------------------------------------------------------------- -BootAnimation::BootAnimation(InitCallback initCallback, -                             PlayPartCallback partCallback) +BootAnimation::BootAnimation(sp<Callbacks> callbacks)          : Thread(false), mClockEnabled(true), mTimeIsAccurate(false), -        mTimeFormat12Hour(false), mTimeCheckThread(NULL), -        mInitCallback(initCallback), mPlayPartCallback(partCallback) { +        mTimeFormat12Hour(false), mTimeCheckThread(NULL), mCallbacks(callbacks) {      mSession = new SurfaceComposerClient();      std::string powerCtl = android::base::GetProperty("sys.powerctl", ""); @@ -357,6 +355,8 @@ bool BootAnimation::android()      initTexture(&mAndroid[0], mAssets, "images/android-logo-mask.png");      initTexture(&mAndroid[1], mAssets, "images/android-logo-shine.png"); +    mCallbacks->init({}); +      // clear screen      glShadeModel(GL_FLAT);      glDisable(GL_DITHER); @@ -424,6 +424,7 @@ void BootAnimation::checkExit() {      int exitnow = atoi(value);      if (exitnow) {          requestExit(); +        mCallbacks->shutdown();      }  } @@ -777,9 +778,7 @@ bool BootAnimation::preloadZip(Animation& animation)          }      } -    if (mInitCallback != nullptr) { -        mInitCallback(animation.parts); -    } +    mCallbacks->init(animation.parts);      zip->endIteration(cookie); @@ -887,9 +886,7 @@ bool BootAnimation::playAnimation(const Animation& animation)              if(exitPending() && !part.playUntilComplete)                  break; -            if (mPlayPartCallback != nullptr) { -                mPlayPartCallback(i, part, r); -            } +            mCallbacks->playPart(i, part, r);              glClearColor(                      part.backgroundColor[0],  |