summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2011-08-19 16:57:32 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2011-08-19 16:57:32 -0700
commitbb41daadf9dc3e28fd96f1da515c43dbdeedfc0f (patch)
treec00b4217b2410db2ae565dd075f1908efa35f3ce
parent6d97842849bed82affbd45251529f85f0958a6b8 (diff)
parentc01391fb4eb0eef33d142e89e060eac7e75de39d (diff)
Merge "Minor fixes to SurfaceTexture transform matrix."
-rw-r--r--core/java/android/view/TextureView.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/core/java/android/view/TextureView.java b/core/java/android/view/TextureView.java
index b72222ee9f99..9d959fbf5981 100644
--- a/core/java/android/view/TextureView.java
+++ b/core/java/android/view/TextureView.java
@@ -261,6 +261,7 @@ public class TextureView extends View {
@Override
public final void draw(Canvas canvas) {
applyUpdate();
+ applyTransformMatrix();
}
/**
@@ -315,11 +316,7 @@ public class TextureView extends View {
}
applyUpdate();
-
- if (mMatrixChanged) {
- mLayer.setTransform(mMatrix);
- mMatrixChanged = false;
- }
+ applyTransformMatrix();
return mLayer;
}
@@ -386,7 +383,7 @@ public class TextureView extends View {
public void setTransform(Matrix transform) {
mMatrix.set(transform);
mMatrixChanged = true;
- invalidate();
+ invalidateParentIfNeeded();
}
/**
@@ -410,6 +407,13 @@ public class TextureView extends View {
return transform;
}
+ private void applyTransformMatrix() {
+ if (mMatrixChanged) {
+ mLayer.setTransform(mMatrix);
+ mMatrixChanged = false;
+ }
+ }
+
/**
* <p>Returns a {@link android.graphics.Bitmap} representation of the content
* of the associated surface texture. If the surface texture is not available,