Skip to content

Commit 97d5c41

Browse files
author
Jeff Brown
committed
Remove unused pipelining optimization.
Bug: 6375101 Change-Id: I5fcbbabfafae9e1661adac7b2becc748e42c4b66
1 parent 80b2760 commit 97d5c41

File tree

2 files changed

+0
-75
lines changed

2 files changed

+0
-75
lines changed

core/java/android/view/Choreographer.java

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,9 @@ protected Choreographer initialValue() {
6969
private static final boolean USE_VSYNC = SystemProperties.getBoolean(
7070
"debug.choreographer.vsync", true);
7171

72-
// Enable/disable allowing traversals to proceed immediately if no drawing occurred
73-
// during the previous frame. When true, the Choreographer can degrade more gracefully
74-
// if drawing takes longer than a frame, but it may potentially block in eglSwapBuffers()
75-
// if there are two dirty buffers enqueued.
76-
// When false, we always schedule traversals on strict vsync boundaries.
77-
private static final boolean USE_PIPELINING = SystemProperties.getBoolean(
78-
"debug.choreographer.pipeline", false);
79-
8072
private static final int MSG_DO_FRAME = 0;
8173
private static final int MSG_DO_SCHEDULE_VSYNC = 1;
8274
private static final int MSG_DO_SCHEDULE_CALLBACK = 2;
83-
private static final int MSG_DO_TRAVERSAL = 3;
8475

8576
private final Object mLock = new Object();
8677

@@ -94,8 +85,6 @@ protected Choreographer initialValue() {
9485

9586
private boolean mFrameScheduled;
9687
private long mLastFrameTime;
97-
private boolean mDrewLastFrame;
98-
private boolean mTraversalScheduled;
9988

10089
/**
10190
* Callback type: Input callback. Runs first.
@@ -236,35 +225,11 @@ public void postCallbackDelayed(int callbackType,
236225
}
237226

238227
synchronized (mLock) {
239-
if (USE_PIPELINING && callbackType == CALLBACK_INPUT) {
240-
Message msg = Message.obtain(mHandler, action);
241-
msg.setAsynchronous(true);
242-
mHandler.sendMessage(msg);
243-
return;
244-
}
245-
246228
final long now = SystemClock.uptimeMillis();
247229
final long dueTime = now + delayMillis;
248230
mCallbackQueues[callbackType].addCallbackLocked(dueTime, action, token);
249231

250232
if (dueTime <= now) {
251-
if (USE_PIPELINING && callbackType == CALLBACK_TRAVERSAL) {
252-
if (!mDrewLastFrame) {
253-
if (DEBUG) {
254-
Log.d(TAG, "Scheduling traversal immediately.");
255-
}
256-
if (!mTraversalScheduled) {
257-
mTraversalScheduled = true;
258-
Message msg = mHandler.obtainMessage(MSG_DO_TRAVERSAL);
259-
msg.setAsynchronous(true);
260-
mHandler.sendMessageAtTime(msg, dueTime);
261-
}
262-
return;
263-
}
264-
if (DEBUG) {
265-
Log.d(TAG, "Scheduling traversal on next frame.");
266-
}
267-
}
268233
scheduleFrameLocked(now);
269234
} else {
270235
Message msg = mHandler.obtainMessage(MSG_DO_SCHEDULE_CALLBACK, action);
@@ -305,27 +270,6 @@ public void removeCallbacks(int callbackType, Runnable action, Object token) {
305270
}
306271
}
307272

308-
/**
309-
* Tells the choreographer that the application has actually drawn to a surface.
310-
*
311-
* It uses this information to determine whether to draw immediately or to
312-
* post a draw to the next vsync because it might otherwise block.
313-
*/
314-
public void notifyDrawOccurred() {
315-
if (DEBUG) {
316-
Log.d(TAG, "Draw occurred.");
317-
}
318-
319-
if (USE_PIPELINING) {
320-
synchronized (mLock) {
321-
if (!mDrewLastFrame) {
322-
mDrewLastFrame = true;
323-
scheduleFrameLocked(SystemClock.uptimeMillis());
324-
}
325-
}
326-
}
327-
}
328-
329273
private void scheduleFrameLocked(long now) {
330274
if (!mFrameScheduled) {
331275
mFrameScheduled = true;
@@ -363,7 +307,6 @@ void doFrame(int frame) {
363307
}
364308
mFrameScheduled = false;
365309
mLastFrameTime = SystemClock.uptimeMillis();
366-
mDrewLastFrame = false;
367310
}
368311

369312
doCallbacks(Choreographer.CALLBACK_INPUT);
@@ -382,11 +325,6 @@ void doCallbacks(int callbackType) {
382325
synchronized (mLock) {
383326
start = SystemClock.uptimeMillis();
384327
callbacks = mCallbackQueues[callbackType].extractDueCallbacksLocked(start);
385-
386-
if (USE_PIPELINING && callbackType == CALLBACK_TRAVERSAL && mTraversalScheduled) {
387-
mTraversalScheduled = false;
388-
mHandler.removeMessages(MSG_DO_TRAVERSAL);
389-
}
390328
}
391329

392330
if (callbacks != null) {
@@ -428,15 +366,6 @@ void doScheduleCallback(int callbackType) {
428366
}
429367
}
430368

431-
void doTraversal() {
432-
synchronized (mLock) {
433-
if (mTraversalScheduled) {
434-
mTraversalScheduled = false;
435-
doCallbacks(CALLBACK_TRAVERSAL);
436-
}
437-
}
438-
}
439-
440369
private void scheduleVsyncLocked() {
441370
mDisplayEventReceiver.scheduleVsync();
442371
}
@@ -483,9 +412,6 @@ public void handleMessage(Message msg) {
483412
case MSG_DO_SCHEDULE_CALLBACK:
484413
doScheduleCallback(msg.arg1);
485414
break;
486-
case MSG_DO_TRAVERSAL:
487-
doTraversal();
488-
break;
489415
}
490416
}
491417
}

core/java/android/view/ViewRootImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1994,7 +1994,6 @@ private void performDraw() {
19941994

19951995
final boolean fullRedrawNeeded = mFullRedrawNeeded;
19961996
mFullRedrawNeeded = false;
1997-
mChoreographer.notifyDrawOccurred();
19981997

19991998
Trace.traceBegin(Trace.TRACE_TAG_VIEW, "draw");
20001999
try {

0 commit comments

Comments
 (0)