EGL: fix the ANativeWindow size/fmt override
This change fixes how the Android EGL layer overrides the size and
format of an ANativeWindow in eglCreateWindowSurface. The new behavior
is to leave the size untouched when overriding the format. The previous
behavior was to reset the ANativeWindow to use the default size set by
the ANativeWindow implementation.
It also adds two new 'perform' methods to the ANativeWindow interface:
set_buffers_dimensions and set_buffers_format, and redefines the
behavior of set_buffers_geometry to be the combination of these two new
methods.
Additionally, this change adds an error check for the return value of
the new native_window_set_buffers_format call, which required adding a
(stub) handler for to FramebufferNativeWindow.
Change-Id: I805c7ccd8d4730dfb132d10d8bc3fb058a0b9df1
diff --git a/include/gui/SurfaceTextureClient.h b/include/gui/SurfaceTextureClient.h
index 6ce44fc..9db7364 100644
--- a/include/gui/SurfaceTextureClient.h
+++ b/include/gui/SurfaceTextureClient.h
@@ -65,6 +65,8 @@
int dispatchDisconnect(va_list args);
int dispatchSetBufferCount(va_list args);
int dispatchSetBuffersGeometry(va_list args);
+ int dispatchSetBuffersDimensions(va_list args);
+ int dispatchSetBuffersFormat(va_list args);
int dispatchSetBuffersTransform(va_list args);
int dispatchSetBuffersTimestamp(va_list args);
int dispatchSetCrop(va_list args);
@@ -73,7 +75,8 @@
int connect(int api);
int disconnect(int api);
int setBufferCount(int bufferCount);
- int setBuffersGeometry(int w, int h, int format);
+ int setBuffersDimensions(int w, int h);
+ int setBuffersFormat(int format);
int setBuffersTransform(int transform);
int setBuffersTimestamp(int64_t timestamp);
int setCrop(Rect const* rect);