diff options
author | John Reck <jreck@google.com> | 2014-02-05 16:38:25 -0800 |
---|---|---|
committer | John Reck <jreck@google.com> | 2014-02-10 20:55:39 -0800 |
commit | 04fc583c3dd3144bc6b718fcac4b3e1afdfdb067 (patch) | |
tree | 4682660942c57456293a88bd3e78a28569ae9c71 /tests/CanvasCompare | |
parent | 740dfefcfcba7a254e65bda3ac0d965ca161458b (diff) | |
download | frameworks_base-04fc583c3dd3144bc6b718fcac4b3e1afdfdb067.zip frameworks_base-04fc583c3dd3144bc6b718fcac4b3e1afdfdb067.tar.gz frameworks_base-04fc583c3dd3144bc6b718fcac4b3e1afdfdb067.tar.bz2 |
Refactor HardwareLayer
Defer all the things!
Groundwork to allow hardware layers to work in a renderthread world
Change-Id: Ib3aa47525f393083621254a743dbaa6352f933bd
Diffstat (limited to 'tests/CanvasCompare')
-rw-r--r-- | tests/CanvasCompare/src/com/android/test/hwuicompare/CompareActivity.java | 2 | ||||
-rw-r--r-- | tests/CanvasCompare/src/com/android/test/hwuicompare/ErrorCalculator.java | 14 |
2 files changed, 10 insertions, 6 deletions
diff --git a/tests/CanvasCompare/src/com/android/test/hwuicompare/CompareActivity.java b/tests/CanvasCompare/src/com/android/test/hwuicompare/CompareActivity.java index 0b85189..8d8d9de 100644 --- a/tests/CanvasCompare/src/com/android/test/hwuicompare/CompareActivity.java +++ b/tests/CanvasCompare/src/com/android/test/hwuicompare/CompareActivity.java @@ -97,7 +97,7 @@ abstract public class CompareActivity extends Activity { Log.d(LOG_TAG, "failure to access hardware layer"); return; } - Method copyInto = hardwareLayer.getClass().getSuperclass() + Method copyInto = hardwareLayer.getClass() .getDeclaredMethod("copyInto", Bitmap.class); if (!copyInto.isAccessible()) copyInto.setAccessible(true); diff --git a/tests/CanvasCompare/src/com/android/test/hwuicompare/ErrorCalculator.java b/tests/CanvasCompare/src/com/android/test/hwuicompare/ErrorCalculator.java index a08b558..c90b626 100644 --- a/tests/CanvasCompare/src/com/android/test/hwuicompare/ErrorCalculator.java +++ b/tests/CanvasCompare/src/com/android/test/hwuicompare/ErrorCalculator.java @@ -35,23 +35,24 @@ public class ErrorCalculator { private static final boolean LOG_TIMING = false; private static final boolean LOG_CALC = false; - private final RenderScript mRS; + private RenderScript mRS; private Allocation mIdealPixelsAllocation; private Allocation mGivenPixelsAllocation; private Allocation mOutputPixelsAllocation; - private final Allocation mInputRowsAllocation; - private final Allocation mOutputRegionsAllocation; + private Allocation mInputRowsAllocation; + private Allocation mOutputRegionsAllocation; - private final ScriptC_errorCalculator mScript; + private ScriptC_errorCalculator mScript; - private final int[] mOutputRowRegions; + private int[] mOutputRowRegions; public ErrorCalculator(Context c, Resources resources) { int width = resources.getDimensionPixelSize(R.dimen.layer_width); int height = resources.getDimensionPixelSize(R.dimen.layer_height); mOutputRowRegions = new int[height / REGION_SIZE]; +/* mRS = RenderScript.create(c); int[] rowIndices = new int[height / REGION_SIZE]; for (int i = 0; i < rowIndices.length; i++) @@ -67,12 +68,15 @@ public class ErrorCalculator { mInputRowsAllocation.copyFrom(rowIndices); mOutputRegionsAllocation = Allocation.createSized(mRS, Element.I32(mRS), mOutputRowRegions.length, Allocation.USAGE_SCRIPT); +*/ } private static long startMillis, middleMillis; public float calcErrorRS(Bitmap ideal, Bitmap given) { + if (true) + return calcError(ideal, given); if (LOG_TIMING) { startMillis = System.currentTimeMillis(); } |