diff options
| author | 2010-10-26 12:22:12 -0700 | |
|---|---|---|
| committer | 2010-10-26 12:22:12 -0700 | |
| commit | 85c5ca07b9c6e58337a149d36bc3cecbdb879046 (patch) | |
| tree | 1c99b878e01f7ac291e197e7b3057e60f93a1001 | |
| parent | 1b98a9e6a9bd22c4dca731491b701f7ece6a6eb7 (diff) | |
| parent | 2f19f56ac5bcf02ed503bdaf95b724cba8ff782d (diff) | |
am 2f19f56a: Merge "Updade Surface (ANativeWindow) format based on its buffers format" into gingerbread
| -rw-r--r-- | libs/surfaceflinger_client/Surface.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/surfaceflinger_client/Surface.cpp b/libs/surfaceflinger_client/Surface.cpp index d44aab994b91..854a3c6fdb9c 100644 --- a/libs/surfaceflinger_client/Surface.cpp +++ b/libs/surfaceflinger_client/Surface.cpp @@ -866,7 +866,18 @@ int Surface::setBuffersGeometry(int w, int h, int format) return BAD_VALUE; Mutex::Autolock _l(mSurfaceLock); + if (mConnected == NATIVE_WINDOW_API_EGL) { + return INVALID_OPERATION; + } + mBufferInfo.set(w, h, format); + if (format != 0) { + // we update the format of the surface as reported by query(). + // this is to allow applications to change the format of a surface's + // buffer, and have it reflected in EGL; which is needed for + // EGLConfig validation. + mFormat = format; + } return NO_ERROR; } |