fix [2167050] glTexImage2D code path buggy in SurfaceFlinger
When EGLImage extension is not available, SurfaceFlinger will fallback to using
glTexImage2D and glTexSubImage2D instead, which requires 50% more memory and an
extra copy. However this code path has never been exercised and had some bugs
which this patch fix.
Mainly the scale factor wasn't computed right when falling back on glDrawElements.
We also fallback to this mode of operation if a buffer doesn't have the adequate
usage bits for EGLImage usage.
This changes only code that is currently not executed. Some refactoring was needed to
keep the change clean. This doesn't change anything functionaly.
diff --git a/include/ui/ISurface.h b/include/ui/ISurface.h
index 1283033..2ca0026 100644
--- a/include/ui/ISurface.h
+++ b/include/ui/ISurface.h
@@ -34,7 +34,7 @@
class IMemoryHeap;
class OverlayRef;
-class SurfaceBuffer;
+class GraphicBuffer;
class ISurface : public IInterface
{
@@ -50,7 +50,7 @@
public:
DECLARE_META_INTERFACE(Surface);
- virtual sp<SurfaceBuffer> requestBuffer(int bufferIdx, int usage) = 0;
+ virtual sp<GraphicBuffer> requestBuffer(int bufferIdx, int usage) = 0;
class BufferHeap {
public: