summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Craig Donner <cdonner@google.com> 2016-10-28 01:01:07 +0000
committer android-build-merger <android-build-merger@google.com> 2016-10-28 01:01:07 +0000
commit78d93fcd28d4fba5e28fa29eee6d373a5e5c180d (patch)
treeff40934d162feebbed1135f008947d6ed04e2a86
parenta38cde50db07a8f010be904bbf09b908e3965569 (diff)
parenta94d940c75456714b1c4425dde1e44802cb838f7 (diff)
Keep protected content in EGLImage attrs as needed.
am: a94d940c75 Change-Id: I3376d949d387b4d0f70698b26dfd9f66755db88f
-rw-r--r--libs/gui/GLConsumer.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/libs/gui/GLConsumer.cpp b/libs/gui/GLConsumer.cpp
index aa0db4506c..10e999c228 100644
--- a/libs/gui/GLConsumer.cpp
+++ b/libs/gui/GLConsumer.cpp
@@ -1228,14 +1228,19 @@ EGLImageKHR GLConsumer::EglImage::createImage(EGLDisplay dpy,
EGL_NONE,
};
if (!crop.isValid()) {
- // No crop rect to set, so terminate the attrib array before the crop.
- attrs[2] = EGL_NONE;
+ // No crop rect to set, so leave the crop out of the attrib array. Make
+ // sure to propagate the protected content attrs if they are set.
+ attrs[2] = attrs[10];
+ attrs[3] = attrs[11];
+ attrs[4] = EGL_NONE;
} else if (!isEglImageCroppable(crop)) {
// The crop rect is not at the origin, so we can't set the crop on the
// EGLImage because that's not allowed by the EGL_ANDROID_image_crop
// extension. In the future we can add a layered extension that
// removes this restriction if there is hardware that can support it.
- attrs[2] = EGL_NONE;
+ attrs[2] = attrs[10];
+ attrs[3] = attrs[11];
+ attrs[4] = EGL_NONE;
}
eglInitialize(dpy, 0, 0);
EGLImageKHR image = eglCreateImageKHR(dpy, EGL_NO_CONTEXT,