diff options
author | Mathias Agopian <mathias@google.com> | 2010-10-25 16:29:24 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2010-10-25 17:08:37 -0700 |
commit | b9737a1d1b9eb24cab18a6f50659a43c8bca79be (patch) | |
tree | e2852ec578389d66a4ad592c109a7697c8306924 /libs/surfaceflinger_client | |
parent | 3026a1c4e88412b7fe997f93fedba871d79a03cd (diff) | |
download | frameworks_base-b9737a1d1b9eb24cab18a6f50659a43c8bca79be.zip frameworks_base-b9737a1d1b9eb24cab18a6f50659a43c8bca79be.tar.gz frameworks_base-b9737a1d1b9eb24cab18a6f50659a43c8bca79be.tar.bz2 |
Updade Surface (ANativeWindow) format based on its buffers format
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.
Change-Id: Iee074c30ad765881e2409c1d37450b05e561c44d
Diffstat (limited to 'libs/surfaceflinger_client')
-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 d44aab9..854a3c6 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; } |