Java Code Examples for android.view.Choreographer.FrameCallback

The following are top voted examples for showing how to use android.view.Choreographer.FrameCallback. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: 365browser   File:   Source Code and License 6 votes vote down vote up
private VrShellDelegate(ChromeActivity activity, VrClassesWrapper wrapper) {
    mActivity = activity;
    mVrClassesWrapper = wrapper;
    // If an activity isn't resumed at the point, it must have been paused.
    mPaused = ApplicationStatus.getStateForActivity(activity) != ActivityState.RESUMED;
    mNativeVrShellDelegate = nativeInit();
    mFeedbackFrequency = VrFeedbackStatus.getFeedbackFrequency();
    mEnterVrHandler = new Handler();
    Choreographer.getInstance().postFrameCallback(new FrameCallback() {
        public void doFrame(long frameTimeNanos) {
            if (mNativeVrShellDelegate == 0) return;
            Display display =
                    ((WindowManager) mActivity.getSystemService(Context.WINDOW_SERVICE))
                    mNativeVrShellDelegate, frameTimeNanos, 1.0d / display.getRefreshRate());