diff options
author | Andreas Huber <andih@google.com> | 2010-06-25 09:25:19 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2010-06-25 11:05:37 -0700 |
commit | e049a957ce2a529564a1312dca60e86d0bcb0964 (patch) | |
tree | deb076b69ffbc2939d2a76c0fb3cdd38053f668d /libs/surfaceflinger/Layer.cpp | |
parent | deaaf5029aaf5e2754a7b8f68d665cad3cb4e5b5 (diff) | |
download | frameworks_native-e049a957ce2a529564a1312dca60e86d0bcb0964.zip frameworks_native-e049a957ce2a529564a1312dca60e86d0bcb0964.tar.gz frameworks_native-e049a957ce2a529564a1312dca60e86d0bcb0964.tar.bz2 |
Revert "fix [2793164] Spam 2x/second with TOT master in SurfaceFlinger"
This reverts commit 081bc5c47d8a980e6eafa70ddafcd89981586391.
Diffstat (limited to 'libs/surfaceflinger/Layer.cpp')
-rw-r--r-- | libs/surfaceflinger/Layer.cpp | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/libs/surfaceflinger/Layer.cpp b/libs/surfaceflinger/Layer.cpp index 758da4e..e606f71 100644 --- a/libs/surfaceflinger/Layer.cpp +++ b/libs/surfaceflinger/Layer.cpp @@ -31,7 +31,6 @@ #include <surfaceflinger/Surface.h> #include "clz.h" -#include "GLExtensions.h" #include "Layer.h" #include "SurfaceFlinger.h" #include "DisplayHardware/DisplayHardware.h" @@ -51,11 +50,10 @@ template <typename T> inline T min(T a, T b) { Layer::Layer(SurfaceFlinger* flinger, DisplayID display, const sp<Client>& client) : LayerBaseClient(flinger, display, client), - mGLExtensions(GLExtensions::getInstance()), mNeedsBlending(true), mNeedsDithering(false), mSecure(false), - mTextureManager(), + mTextureManager(mFlags), mBufferManager(mTextureManager), mWidth(0), mHeight(0), mFixedSize(false) { @@ -187,13 +185,17 @@ void Layer::reloadTexture(const Region& dirty) return; } - if (mGLExtensions.haveDirectTexture()) { +#ifdef EGL_ANDROID_image_native_buffer + if (mFlags & DisplayHardware::DIRECT_TEXTURE) { EGLDisplay dpy(mFlinger->graphicPlane(0).getEGLDisplay()); if (mBufferManager.initEglImage(dpy, buffer) != NO_ERROR) { // not sure what we can do here... + mFlags &= ~DisplayHardware::DIRECT_TEXTURE; goto slowpath; } - } else { + } else +#endif + { slowpath: GGLSurface t; status_t res = buffer->lock(&t, GRALLOC_USAGE_SW_READ_OFTEN); @@ -784,24 +786,19 @@ status_t Layer::BufferManager::initEglImage(EGLDisplay dpy, status_t err = NO_INIT; ssize_t index = mActiveBuffer; if (index >= 0) { - if (!mFailover) { - Image& texture(mBufferData[index].texture); - err = mTextureManager.initEglImage(&texture, dpy, buffer); - // if EGLImage fails, we switch to regular texture mode, and we - // free all resources associated with using EGLImages. - if (err == NO_ERROR) { - mFailover = false; - destroyTexture(&mFailoverTexture, dpy); - } else { - mFailover = true; - const size_t num = mNumBuffers; - for (size_t i=0 ; i<num ; i++) { - destroyTexture(&mBufferData[i].texture, dpy); - } - } + Image& texture(mBufferData[index].texture); + err = mTextureManager.initEglImage(&texture, dpy, buffer); + // if EGLImage fails, we switch to regular texture mode, and we + // free all resources associated with using EGLImages. + if (err == NO_ERROR) { + mFailover = false; + destroyTexture(&mFailoverTexture, dpy); } else { - // we failed once, don't try again - err = BAD_VALUE; + mFailover = true; + const size_t num = mNumBuffers; + for (size_t i=0 ; i<num ; i++) { + destroyTexture(&mBufferData[i].texture, dpy); + } } } return err; |