Loading libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,8 @@ float DisplayHardware::getRefreshRate() const { return mRefreshRate; } int DisplayHardware::getWidth() const { return mWidth; } int DisplayHardware::getHeight() const { return mHeight; } PixelFormat DisplayHardware::getFormat() const { return mFormat; } uint32_t DisplayHardware::getMaxTextureSize() const { return mMaxTextureSize; } uint32_t DisplayHardware::getMaxViewportDims() const { return mMaxViewportDims; } void DisplayHardware::init(uint32_t dpy) { Loading Loading @@ -246,6 +248,11 @@ void DisplayHardware::init(uint32_t dpy) LOGI("version : %s", glGetString(GL_VERSION)); LOGI("extensions: %s", gl_extensions); glGetIntegerv(GL_MAX_TEXTURE_SIZE, &mMaxTextureSize); glGetIntegerv(GL_MAX_VIEWPORT_DIMS, &mMaxViewportDims); LOGI("GL_MAX_TEXTURE_SIZE = %d", mMaxTextureSize); LOGI("GL_MAX_VIEWPORT_DIMS = %d", mMaxViewportDims); #if 0 // for drivers that don't have proper support for flushing cached buffers // on gralloc unlock, uncomment this block and test for the specific Loading Loading @@ -273,6 +280,7 @@ void DisplayHardware::init(uint32_t dpy) #warning "EGL_ANDROID_image_native_buffer not supported" #endif // Unbind the context from this thread eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); Loading libs/surfaceflinger/DisplayHardware/DisplayHardware.h +4 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,8 @@ public: PixelFormat getFormat() const; uint32_t getFlags() const; void makeCurrent() const; uint32_t getMaxTextureSize() const; uint32_t getMaxViewportDims() const; uint32_t getPageFlipCount() const; EGLDisplay getEGLDisplay() const { return mDisplay; } Loading Loading @@ -104,6 +106,8 @@ private: PixelFormat mFormat; uint32_t mFlags; mutable uint32_t mPageFlipCount; GLint mMaxViewportDims; GLint mMaxTextureSize; sp<FramebufferNativeWindow> mNativeWindow; overlay_control_device_t* mOverlayEngine; Loading libs/surfaceflinger/Layer.cpp +15 −2 Original line number Diff line number Diff line Loading @@ -41,6 +41,10 @@ namespace android { template <typename T> inline T min(T a, T b) { return a<b ? a : b; } // --------------------------------------------------------------------------- const uint32_t Layer::typeInfo = LayerBaseClient::typeInfo | 4; Loading Loading @@ -109,6 +113,15 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h, // the display's pixel format const DisplayHardware& hw(graphicPlane(0).displayHardware()); uint32_t const maxSurfaceDims = min( hw.getMaxTextureSize(), hw.getMaxViewportDims()); // never allow a surface larger than what our underlying GL implementation // can handle. if ((uint32_t(w)>maxSurfaceDims) || (uint32_t(h)>maxSurfaceDims)) { return BAD_VALUE; } PixelFormatInfo displayInfo; getPixelFormatInfo(hw.getFormat(), &displayInfo); const uint32_t hwFlags = hw.getFlags(); Loading Loading
libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,8 @@ float DisplayHardware::getRefreshRate() const { return mRefreshRate; } int DisplayHardware::getWidth() const { return mWidth; } int DisplayHardware::getHeight() const { return mHeight; } PixelFormat DisplayHardware::getFormat() const { return mFormat; } uint32_t DisplayHardware::getMaxTextureSize() const { return mMaxTextureSize; } uint32_t DisplayHardware::getMaxViewportDims() const { return mMaxViewportDims; } void DisplayHardware::init(uint32_t dpy) { Loading Loading @@ -246,6 +248,11 @@ void DisplayHardware::init(uint32_t dpy) LOGI("version : %s", glGetString(GL_VERSION)); LOGI("extensions: %s", gl_extensions); glGetIntegerv(GL_MAX_TEXTURE_SIZE, &mMaxTextureSize); glGetIntegerv(GL_MAX_VIEWPORT_DIMS, &mMaxViewportDims); LOGI("GL_MAX_TEXTURE_SIZE = %d", mMaxTextureSize); LOGI("GL_MAX_VIEWPORT_DIMS = %d", mMaxViewportDims); #if 0 // for drivers that don't have proper support for flushing cached buffers // on gralloc unlock, uncomment this block and test for the specific Loading Loading @@ -273,6 +280,7 @@ void DisplayHardware::init(uint32_t dpy) #warning "EGL_ANDROID_image_native_buffer not supported" #endif // Unbind the context from this thread eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); Loading
libs/surfaceflinger/DisplayHardware/DisplayHardware.h +4 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,8 @@ public: PixelFormat getFormat() const; uint32_t getFlags() const; void makeCurrent() const; uint32_t getMaxTextureSize() const; uint32_t getMaxViewportDims() const; uint32_t getPageFlipCount() const; EGLDisplay getEGLDisplay() const { return mDisplay; } Loading Loading @@ -104,6 +106,8 @@ private: PixelFormat mFormat; uint32_t mFlags; mutable uint32_t mPageFlipCount; GLint mMaxViewportDims; GLint mMaxTextureSize; sp<FramebufferNativeWindow> mNativeWindow; overlay_control_device_t* mOverlayEngine; Loading
libs/surfaceflinger/Layer.cpp +15 −2 Original line number Diff line number Diff line Loading @@ -41,6 +41,10 @@ namespace android { template <typename T> inline T min(T a, T b) { return a<b ? a : b; } // --------------------------------------------------------------------------- const uint32_t Layer::typeInfo = LayerBaseClient::typeInfo | 4; Loading Loading @@ -109,6 +113,15 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h, // the display's pixel format const DisplayHardware& hw(graphicPlane(0).displayHardware()); uint32_t const maxSurfaceDims = min( hw.getMaxTextureSize(), hw.getMaxViewportDims()); // never allow a surface larger than what our underlying GL implementation // can handle. if ((uint32_t(w)>maxSurfaceDims) || (uint32_t(h)>maxSurfaceDims)) { return BAD_VALUE; } PixelFormatInfo displayInfo; getPixelFormatInfo(hw.getFormat(), &displayInfo); const uint32_t hwFlags = hw.getFlags(); Loading