Add BlastBufferQueue tests to SurfaceFlingerPerfTests

Bug: 287081404
Test: atest SurfaceFlingerPerfTests:SurfaceFlingerPerfTest
Change-Id: I8a2e1552956368e721a5b0be69911a569522d90f
This commit is contained in:
Azwa Bajwah
2023-07-28 16:46:32 +00:00
parent ff27ed4869
commit 958499616c

View File

@@ -17,10 +17,14 @@
package android.surfaceflinger;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.SurfaceControl;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import androidx.test.ext.junit.rules.ActivityScenarioRule;
import androidx.test.filters.LargeTest;
@@ -194,4 +198,16 @@ public class SurfaceFlingerPerfTest {
mTransaction.apply(true);
}
}
@Test
public void bufferQueue() throws Exception {
SurfaceView testSV = mActivity.mTestSurfaceView;
SurfaceHolder holder = testSV.getHolder();
holder.getSurface();
for (int i = 0; i < sProfilingIterations; i++) {
Canvas canvas = holder.lockCanvas();
holder.unlockCanvasAndPost(canvas);
mTransaction.apply(true);
}
}
}