summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/Layer.cpp
diff options
context:
space:
mode:
author James Dong <jdong@google.com> 2011-10-09 09:16:37 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2011-10-09 09:16:37 -0700
commit650c53aad5a49c793bbcddad9bfce63a3b3d0360 (patch)
tree960e54bc99da489d806ab9f76cb7ddad4850ccaf /services/surfaceflinger/Layer.cpp
parent8765ebf9b5c5256dfbf8232b11bcf5f0045c5ac1 (diff)
parent830d083bf75f1dfe3753f9565f0c90b1dbcc264f (diff)
Merge "SurfaceFlinger: screenshots w/ protected buffers"
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
-rw-r--r--services/surfaceflinger/Layer.cpp33
1 files changed, 21 insertions, 12 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 41d7a90978ad..feb2c5272dbd 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -280,20 +280,29 @@ void Layer::onDraw(const Region& clip) const
return;
}
- const GLenum target = GL_TEXTURE_EXTERNAL_OES;
- glBindTexture(target, mTextureName);
- if (getFiltering() || needsFiltering() || isFixedSize() || isCropped()) {
- // TODO: we could be more subtle with isFixedSize()
- glTexParameterx(target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameterx(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ GLenum target = GL_TEXTURE_EXTERNAL_OES;
+ if (!isProtected()) {
+ glBindTexture(target, mTextureName);
+ if (getFiltering() || needsFiltering() || isFixedSize() || isCropped()) {
+ // TODO: we could be more subtle with isFixedSize()
+ glTexParameterx(target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameterx(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ } else {
+ glTexParameterx(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameterx(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ }
+ glEnable(target);
+ glMatrixMode(GL_TEXTURE);
+ glLoadMatrixf(mTextureMatrix);
+ glMatrixMode(GL_MODELVIEW);
} else {
- glTexParameterx(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameterx(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ target = GL_TEXTURE_2D;
+ glBindTexture(target, mFlinger->getProtectedTexName());
+ glEnable(target);
+ glMatrixMode(GL_TEXTURE);
+ glLoadIdentity();
+ glMatrixMode(GL_MODELVIEW);
}
- glEnable(target);
- glMatrixMode(GL_TEXTURE);
- glLoadMatrixf(mTextureMatrix);
- glMatrixMode(GL_MODELVIEW);
drawWithOpenGL(clip);