Replace PixelColor ints with Color ints

Bug: 262892179
Test: atest ASurfaceControlTest ASurfaceControlBackPressureTest SurfaceControlTest
Change-Id: I426d38f74fdbfa5678ee3f03137428cbebb89eda
This commit is contained in:
Patrick Williams
2023-01-03 11:34:23 -06:00
parent 3ad4f200c2
commit f1968da159
2 changed files with 3 additions and 5 deletions

View File

@@ -48,7 +48,6 @@ import android.view.IWindowManager;
import android.view.PointerIcon;
import android.view.SurfaceControl;
import android.view.cts.surfacevalidator.BitmapPixelChecker;
import android.view.cts.surfacevalidator.PixelColor;
import android.view.cts.surfacevalidator.SaveBitmapHelper;
import android.window.ScreenCapture;
import android.window.ScreenCapture.ScreenCaptureListener;
@@ -132,7 +131,7 @@ public class ScreenshotTests {
Bitmap swBitmap = screenshot.copy(Bitmap.Config.ARGB_8888, false);
screenshot.recycle();
BitmapPixelChecker bitmapPixelChecker = new BitmapPixelChecker(PixelColor.RED);
BitmapPixelChecker bitmapPixelChecker = new BitmapPixelChecker(Color.RED);
Rect bounds = new Rect(0, 0, swBitmap.getWidth(), swBitmap.getHeight());
int numMatchingPixels = bitmapPixelChecker.getNumMatchingPixels(swBitmap, bounds);
int sizeOfBitmap = bounds.width() * bounds.height();
@@ -182,7 +181,7 @@ public class ScreenshotTests {
Bitmap swBitmap = screenshot.copy(Bitmap.Config.ARGB_8888, false);
screenshot.recycle();
BitmapPixelChecker bitmapPixelChecker = new BitmapPixelChecker(PixelColor.RED);
BitmapPixelChecker bitmapPixelChecker = new BitmapPixelChecker(Color.RED);
Rect bounds = new Rect(point.x, point.y, BUFFER_WIDTH + point.x, BUFFER_HEIGHT + point.y);
int numMatchingPixels = bitmapPixelChecker.getNumMatchingPixels(swBitmap, bounds);
int pixelMatchSize = bounds.width() * bounds.height();

View File

@@ -18,7 +18,6 @@ package com.android.test
import android.graphics.Color
import android.graphics.Rect
import android.os.SystemClock
import android.view.cts.surfacevalidator.PixelColor
import junit.framework.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Test
@@ -53,7 +52,7 @@ class SharedBufferModeScreenRecordTests(useBlastAdapter: Boolean) :
SystemClock.sleep(4000)
}
val result = withScreenRecording(svBounds, PixelColor.RED) {
val result = withScreenRecording(svBounds, Color.RED) {
it.mSurfaceProxy.drawBuffer(0, Color.RED)
}
val failRatio = 1.0f * result.failFrames / (result.failFrames + result.passFrames)