Skip to content

Commit cb82b94

Browse files
committed
Fix attachFunctor path to ignore delay
Don't defer functor invocation when calling attach functor directly. bug:6653638 Change-Id: Ifffc027df16612f380f39b82b7d0a4411d53b4ea
1 parent 1b159f6 commit cb82b94

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

core/java/android/view/HardwareRenderer.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,15 +1211,16 @@ private void handleFunctorStatus(View.AttachInfo attachInfo, int status) {
12111211
}
12121212

12131213
if ((status & DisplayList.STATUS_INVOKE) != 0) {
1214-
scheduleFunctors(attachInfo);
1214+
scheduleFunctors(attachInfo, true);
12151215
}
12161216
}
12171217

1218-
private void scheduleFunctors(View.AttachInfo attachInfo) {
1218+
private void scheduleFunctors(View.AttachInfo attachInfo, boolean delayed) {
12191219
mFunctorsRunnable.attachInfo = attachInfo;
12201220
if (!attachInfo.mHandler.hasCallbacks(mFunctorsRunnable)) {
12211221
// delay the functor callback by a few ms so it isn't polled constantly
1222-
attachInfo.mHandler.postDelayed(mFunctorsRunnable, FUNCTOR_PROCESS_DELAY);
1222+
attachInfo.mHandler.postDelayed(mFunctorsRunnable,
1223+
delayed ? FUNCTOR_PROCESS_DELAY : 0);
12231224
}
12241225
}
12251226

@@ -1234,7 +1235,7 @@ void detachFunctor(int functor) {
12341235
boolean attachFunctor(View.AttachInfo attachInfo, int functor) {
12351236
if (mCanvas != null) {
12361237
mCanvas.attachFunctor(functor);
1237-
scheduleFunctors(attachInfo);
1238+
scheduleFunctors(attachInfo, false);
12381239
return true;
12391240
}
12401241
return false;

0 commit comments

Comments
 (0)