From 3f085429fd47ebd32ac2463b3eae2a5a6c17be25 Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Tue, 15 Apr 2014 16:18:08 -0700 Subject: Clip TouchFeedbackDrawable effect to receiver Outline Projected RenderNodes are now wrapped with a ClipRect or masked SaveLayer, so that they are clipped to the outline of the projection receiver surface. Change-Id: I1d4afc1bb5d638d650bc0b1dac51a498f216773e --- tests/HwAccelerationTest/AndroidManifest.xml | 11 +++++++++ .../res/drawable/round_rect_background.xml | 6 +++++ .../res/layout/projection_clipping.xml | 26 +++++++++++++++++++++ .../test/hwui/ProjectionClippingActivity.java | 27 ++++++++++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 tests/HwAccelerationTest/res/drawable/round_rect_background.xml create mode 100644 tests/HwAccelerationTest/res/layout/projection_clipping.xml create mode 100644 tests/HwAccelerationTest/src/com/android/test/hwui/ProjectionClippingActivity.java (limited to 'tests/HwAccelerationTest') diff --git a/tests/HwAccelerationTest/AndroidManifest.xml b/tests/HwAccelerationTest/AndroidManifest.xml index 0ad3456..ac741e7 100644 --- a/tests/HwAccelerationTest/AndroidManifest.xml +++ b/tests/HwAccelerationTest/AndroidManifest.xml @@ -867,5 +867,16 @@ + + + + + + + + + diff --git a/tests/HwAccelerationTest/res/drawable/round_rect_background.xml b/tests/HwAccelerationTest/res/drawable/round_rect_background.xml new file mode 100644 index 0000000..14d4073 --- /dev/null +++ b/tests/HwAccelerationTest/res/drawable/round_rect_background.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/tests/HwAccelerationTest/res/layout/projection_clipping.xml b/tests/HwAccelerationTest/res/layout/projection_clipping.xml new file mode 100644 index 0000000..7caf90a --- /dev/null +++ b/tests/HwAccelerationTest/res/layout/projection_clipping.xml @@ -0,0 +1,26 @@ + + + + + + + \ No newline at end of file diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ProjectionClippingActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ProjectionClippingActivity.java new file mode 100644 index 0000000..2ae960b --- /dev/null +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ProjectionClippingActivity.java @@ -0,0 +1,27 @@ +package com.android.test.hwui; + +import android.app.Activity; +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.graphics.RectF; +import android.os.Bundle; +import android.util.AttributeSet; +import android.view.RenderNode; +import android.view.View; + +public class ProjectionClippingActivity extends Activity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.projection_clipping); + View.OnClickListener listener = new View.OnClickListener() { + @Override + public void onClick(View v) { + // woo! nothing! + } + }; + findViewById(R.id.clickable1).setOnClickListener(listener); + findViewById(R.id.clickable2).setOnClickListener(listener); + } +} -- cgit v1.1