summaryrefslogtreecommitdiff
path: root/core/java/android/view/TextureView.java
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2012-10-07 17:55:17 -0700
committerRomain Guy <romainguy@google.com>2012-10-07 17:57:30 -0700
commit52b307ebc86e12e368694442eb8751e7e0de239e (patch)
tree1cc6b91ae735d3dcd7d62999e866af41a1d423e9 /core/java/android/view/TextureView.java
parent50ae66a554126fadee2054e0d01a9e57150cedb5 (diff)
Clear draw flags when updating TextureView's layer
Bug #7171323 Finally! Change-Id: Iefef8fb9a8ef1fe4b374005067145319312c57cf
Diffstat (limited to 'core/java/android/view/TextureView.java')
-rw-r--r--core/java/android/view/TextureView.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/java/android/view/TextureView.java b/core/java/android/view/TextureView.java
index a9b6e097daf4..230f426626a0 100644
--- a/core/java/android/view/TextureView.java
+++ b/core/java/android/view/TextureView.java
@@ -224,6 +224,8 @@ public class TextureView extends View {
private void destroySurface() {
if (mLayer != null) {
mSurface.detachFromGLContext();
+ // SurfaceTexture owns the texture name and detachFromGLContext
+ // should have deleted it
mLayer.clearStorage();
boolean shouldRelease = true;
@@ -291,6 +293,9 @@ public class TextureView extends View {
*/
@Override
public final void draw(Canvas canvas) {
+ // NOTE: Maintain this carefully (see View.java)
+ mPrivateFlags = (mPrivateFlags & ~PFLAG_DIRTY_MASK) | PFLAG_DRAWN;
+
applyUpdate();
applyTransformMatrix();
}
@@ -335,6 +340,10 @@ public class TextureView extends View {
@Override
HardwareLayer getHardwareLayer() {
+ // NOTE: Maintain these two lines very carefully (see View.java)
+ mPrivateFlags |= PFLAG_DRAWN | PFLAG_DRAWING_CACHE_VALID;
+ mPrivateFlags &= ~PFLAG_DIRTY_MASK;
+
if (mLayer == null) {
if (mAttachInfo == null || mAttachInfo.mHardwareRenderer == null) {
return null;
@@ -773,6 +782,7 @@ public class TextureView extends View {
* Invoked when the specified {@link SurfaceTexture} is about to be destroyed.
* If returns true, no rendering should happen inside the surface texture after this method
* is invoked. If returns false, the client needs to call {@link SurfaceTexture#release()}.
+ * Most applications should return true.
*
* @param surface The surface about to be destroyed
*/