diff options
author | sievers@chromium.org <sievers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-13 22:40:59 +0000 |
---|---|---|
committer | sievers@chromium.org <sievers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-13 22:40:59 +0000 |
commit | 5aba5bc9fe839dce4e580e042cd6f53cdc963deb (patch) | |
tree | 8ff503fa2034e64ab18b9833c4cea568ec168bb5 /ui/android | |
parent | d1e0c221a522f1e9a4691faf4bee7fb6a3de99de (diff) | |
download | chromium_src-5aba5bc9fe839dce4e580e042cd6f53cdc963deb.zip chromium_src-5aba5bc9fe839dce4e580e042cd6f53cdc963deb.tar.gz chromium_src-5aba5bc9fe839dce4e580e042cd6f53cdc963deb.tar.bz2 |
Android: Move scheduling logic to CompositorImpl
This adds two ways of scheduling:
- implicitly from LTHClient::ScheduleComposite():
This will post a task to composite immediately.
- explicitly (for Chrome) through SetNeedsComposite() where
there are no layer tree changes, but instead a Composite()
will be scheduled for vsync with the Layout() callback giving
the app a chance to update the tree.
TBR=skyostil@chromium.org
NOTRY=True
BUG=234173
Review URL: https://codereview.chromium.org/239963002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270231 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/android')
-rw-r--r-- | ui/android/java/src/org/chromium/ui/base/WindowAndroid.java | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java b/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java index 8be2dd0..4a68dea 100644 --- a/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java +++ b/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java @@ -32,7 +32,6 @@ public class WindowAndroid { // Native pointer to the c++ WindowAndroid object. private long mNativeWindowAndroid = 0; private final VSyncMonitor mVSyncMonitor; - private VSyncClient mVSyncClient = null; // A string used as a key to store intent errors in a bundle static final String WINDOW_CALLBACK_ERRORS = "window_callback_errors"; @@ -51,9 +50,6 @@ public class WindowAndroid { private final VSyncMonitor.Listener mVSyncListener = new VSyncMonitor.Listener() { @Override public void onVSync(VSyncMonitor monitor, long vsyncTimeMicros) { - if (mVSyncClient != null) { - mVSyncClient.onVSync(vsyncTimeMicros); - } if (mNativeWindowAndroid != 0) { nativeOnVSync(mNativeWindowAndroid, vsyncTimeMicros); } @@ -231,34 +227,9 @@ public class WindowAndroid { return false; } - /** - * An interface to receive VSync notifications from the window. - * The one and only client is set with setVSyncClient(client). - */ - public interface VSyncClient { - /** - * Called very soon after the start of the display's vertical sync period. - * @param vsyncTimeMicros Absolute frame time in microseconds. - */ - void onVSync(long vsyncTimeMicros); - } - - /** - * Sets the VSyncClient. - * @param client The client receiving VSync notifications. - */ - public void setVSyncClient(VSyncClient client) { - assert mVSyncClient == null || client == null; - mVSyncClient = client; - } - - /** - * Request a VSync callback. - * VSyncClient.onVSync() will be called at least once. - */ @CalledByNative - public void requestVSyncUpdate() { - mVSyncMonitor.requestUpdate(); + private void requestVSyncUpdate() { + mVSyncMonitor.requestUpdate(); } /** |