diff options
| author | 2010-10-26 12:18:32 -0700 | |
|---|---|---|
| committer | 2010-10-26 12:18:32 -0700 | |
| commit | 319b48d42a196de3836a3504be49178cc40a10f4 (patch) | |
| tree | e3a126b7232c75db642e647ecb89b1803bd57bbf | |
| parent | d7f8a8d967deca0087a94753a0ebcc497d63cf60 (diff) | |
| parent | 367dc0bd5f0fea8dcf9534d0e6b127dd467adc50 (diff) | |
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 d44aab994b..854a3c6fdb 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; } |