diff options
author | Mathias Agopian <mathias@google.com> | 2010-03-08 11:14:20 -0800 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2010-03-08 11:14:20 -0800 |
commit | fcfeb4b5970c8f361634429934a2518d7e8328dd (patch) | |
tree | 5a8337f84c6d707b28c9be732842555c622786d6 /libs/surfaceflinger/Layer.cpp | |
parent | 8addafe823381addbb8b9ca4edeca846fa13122f (diff) | |
download | frameworks_native-fcfeb4b5970c8f361634429934a2518d7e8328dd.zip frameworks_native-fcfeb4b5970c8f361634429934a2518d7e8328dd.tar.gz frameworks_native-fcfeb4b5970c8f361634429934a2518d7e8328dd.tar.bz2 |
fixes for [2474091] Saw Poor behaviour playing a video.
- fix a bug when hacking video buffers into gralloc buffers
where the buffer size was incorrect this was causing the
"direct-form-texture" mode to fail
- also when the above fails, make sure to revert to the
"mdp copy mode" before going to "slow mode"
- finally disable completely the "direct-from-texture" mode
for now. It cannot work because the allocated buffers can't
respect the GPU constraints (alignment and such). We'll
have to find a solution for that.
Diffstat (limited to 'libs/surfaceflinger/Layer.cpp')
-rw-r--r-- | libs/surfaceflinger/Layer.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/libs/surfaceflinger/Layer.cpp b/libs/surfaceflinger/Layer.cpp index c080513..7ca7875 100644 --- a/libs/surfaceflinger/Layer.cpp +++ b/libs/surfaceflinger/Layer.cpp @@ -156,7 +156,11 @@ void Layer::reloadTexture(const Region& dirty) if (mFlags & DisplayHardware::DIRECT_TEXTURE) { if (buffer->usage & GraphicBuffer::USAGE_HW_TEXTURE) { if (mTextures[index].dirty) { - initializeEglImage(buffer, &mTextures[index]); + if (initializeEglImage(buffer, &mTextures[index]) != NO_ERROR) { + // not sure what we can do here... + mFlags &= ~DisplayHardware::DIRECT_TEXTURE; + goto slowpath; + } } } else { if (mHybridBuffer==0 || (mHybridBuffer->width != buffer->width || @@ -166,8 +170,13 @@ void Layer::reloadTexture(const Region& dirty) buffer->width, buffer->height, buffer->format, GraphicBuffer::USAGE_SW_WRITE_OFTEN | GraphicBuffer::USAGE_HW_TEXTURE); - initializeEglImage( - mHybridBuffer, &mTextures[0]); + if (initializeEglImage( + mHybridBuffer, &mTextures[0]) != NO_ERROR) { + // not sure what we can do here... + mFlags &= ~DisplayHardware::DIRECT_TEXTURE; + mHybridBuffer.clear(); + goto slowpath; + } } GGLSurface t; @@ -236,6 +245,7 @@ void Layer::reloadTexture(const Region& dirty) } else #endif { +slowpath: for (size_t i=0 ; i<NUM_BUFFERS ; i++) { mTextures[i].image = EGL_NO_IMAGE_KHR; } |