summaryrefslogtreecommitdiffstats
path: root/tests/CanvasCompare
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2013-05-08 18:35:44 -0700
committerChris Craik <ccraik@google.com>2013-05-14 14:12:55 -0700
commit6d29c8d5218cac0fb35f3b7c253f2bdebd44f15a (patch)
treee7b76c068ff3e8485fdc164118914ee3b53a2368 /tests/CanvasCompare
parent0ace0aa7d643b5b9952d32827575f041ba563c58 (diff)
downloadframeworks_base-6d29c8d5218cac0fb35f3b7c253f2bdebd44f15a.zip
frameworks_base-6d29c8d5218cac0fb35f3b7c253f2bdebd44f15a.tar.gz
frameworks_base-6d29c8d5218cac0fb35f3b7c253f2bdebd44f15a.tar.bz2
Add tessellation path for points
bug:4351353 bug:8185479 Point tessellation is similar to line special case, except that we only tessellate one point (as a circle or rect) and duplicate it across other instances. Additionally: Fixes square caps for AA=false lines Cleanup in CanvasCompare, disabling interpolation on zoomed-in comparison view Change-Id: I0756fcc4b20f77878fed0d8057297c80e82ed9dc
Diffstat (limited to 'tests/CanvasCompare')
-rw-r--r--tests/CanvasCompare/res/layout/manual_layout.xml2
-rw-r--r--tests/CanvasCompare/src/com/android/test/hwuicompare/DisplayModifier.java2
-rw-r--r--tests/CanvasCompare/src/com/android/test/hwuicompare/NearestImageView.java47
3 files changed, 49 insertions, 2 deletions
diff --git a/tests/CanvasCompare/res/layout/manual_layout.xml b/tests/CanvasCompare/res/layout/manual_layout.xml
index 1a9288c..d7838eb 100644
--- a/tests/CanvasCompare/res/layout/manual_layout.xml
+++ b/tests/CanvasCompare/res/layout/manual_layout.xml
@@ -64,7 +64,7 @@
</LinearLayout>
</LinearLayout>
- <ImageView
+ <com.android.test.hwuicompare.NearestImageView
android:id="@+id/compare_image_view"
android:layout_width="@dimen/layer_width_double"
android:layout_height="@dimen/layer_height_double"
diff --git a/tests/CanvasCompare/src/com/android/test/hwuicompare/DisplayModifier.java b/tests/CanvasCompare/src/com/android/test/hwuicompare/DisplayModifier.java
index 9939c08..6ad01a0 100644
--- a/tests/CanvasCompare/src/com/android/test/hwuicompare/DisplayModifier.java
+++ b/tests/CanvasCompare/src/com/android/test/hwuicompare/DisplayModifier.java
@@ -224,7 +224,7 @@ public abstract class DisplayModifier {
put("rotate45", new DisplayModifier() {
@Override
public void modifyDrawing(Paint paint, Canvas canvas) {
- canvas.rotate(5);
+ canvas.rotate(45);
}
});
put("rotate90", new DisplayModifier() {
diff --git a/tests/CanvasCompare/src/com/android/test/hwuicompare/NearestImageView.java b/tests/CanvasCompare/src/com/android/test/hwuicompare/NearestImageView.java
new file mode 100644
index 0000000..542b55a
--- /dev/null
+++ b/tests/CanvasCompare/src/com/android/test/hwuicompare/NearestImageView.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.test.hwuicompare;
+
+import android.content.Context;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.graphics.PaintFlagsDrawFilter;
+import android.util.AttributeSet;
+import android.widget.ImageView;
+
+public class NearestImageView extends ImageView {
+ public NearestImageView(Context context) {
+ super(context);
+ }
+
+ public NearestImageView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ public NearestImageView(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ }
+
+ final PaintFlagsDrawFilter mFilter = new PaintFlagsDrawFilter(Paint.FILTER_BITMAP_FLAG, 0);
+
+ @Override
+ public void onDraw(Canvas canvas) {
+ canvas.setDrawFilter(mFilter);
+ super.onDraw(canvas);
+ canvas.setDrawFilter(null);
+ }
+} \ No newline at end of file