diff options
author | Mathias Agopian <mathias@google.com> | 2010-06-29 15:31:58 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2010-06-29 15:31:58 -0700 |
commit | 5d8f41cab1c9d48b3d9066090674ec841a68a7aa (patch) | |
tree | 0724da43a313dd0b386044e351120c64b32fa3e2 /libs/surfaceflinger | |
parent | f8e79cc372faf6861ef545a11fb3cd6f3e98f093 (diff) | |
download | frameworks_native-5d8f41cab1c9d48b3d9066090674ec841a68a7aa.zip frameworks_native-5d8f41cab1c9d48b3d9066090674ec841a68a7aa.tar.gz frameworks_native-5d8f41cab1c9d48b3d9066090674ec841a68a7aa.tar.bz2 |
remove a hack that was used only used on h/w we no longer support.
this should fix the opal build.
Change-Id: I43d7633696fea5be6bc834293a832d22f6bdfc61
Diffstat (limited to 'libs/surfaceflinger')
-rw-r--r-- | libs/surfaceflinger/Android.mk | 4 | ||||
-rw-r--r-- | libs/surfaceflinger/LayerDim.cpp | 69 |
2 files changed, 1 insertions, 72 deletions
diff --git a/libs/surfaceflinger/Android.mk b/libs/surfaceflinger/Android.mk index b0229c0..dbe351e 100644 --- a/libs/surfaceflinger/Android.mk +++ b/libs/surfaceflinger/Android.mk @@ -20,10 +20,6 @@ LOCAL_SRC_FILES:= \ LOCAL_CFLAGS:= -DLOG_TAG=\"SurfaceFlinger\" LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES -ifeq ($(TARGET_BOARD_PLATFORM), msm7k) - LOCAL_CFLAGS += -DDIM_WITH_TEXTURE -endif - # need "-lrt" on Linux simulator to pick up clock_gettime ifeq ($(TARGET_SIMULATOR),true) ifeq ($(HOST_OS),linux) diff --git a/libs/surfaceflinger/LayerDim.cpp b/libs/surfaceflinger/LayerDim.cpp index c13b4b3..a1f339e 100644 --- a/libs/surfaceflinger/LayerDim.cpp +++ b/libs/surfaceflinger/LayerDim.cpp @@ -51,54 +51,6 @@ void LayerDim::initDimmer(SurfaceFlinger* flinger, uint32_t w, uint32_t h) sWidth = w; sHeight = h; sUseTexture = false; - -#if defined(DIM_WITH_TEXTURE) && defined(EGL_ANDROID_image_native_buffer) - -#warning "using a texture to implement LayerDim" - - /* On some h/w like msm7K, it is faster to use a texture because the - * software renderer will defer to copybit, for this to work we need to - * use an EGLImage texture so copybit can actually make use of it. - * This burns a full-screen worth of graphic memory. - */ - - const DisplayHardware& hw(flinger->graphicPlane(0).displayHardware()); - uint32_t flags = hw.getFlags(); - - if (LIKELY(flags & DisplayHardware::DIRECT_TEXTURE)) { - sp<GraphicBuffer> buffer = new GraphicBuffer(w, h, PIXEL_FORMAT_RGB_565, - GraphicBuffer::USAGE_SW_WRITE_OFTEN | - GraphicBuffer::USAGE_HW_TEXTURE); - - android_native_buffer_t* clientBuf = buffer->getNativeBuffer(); - - glGenTextures(1, &sTexId); - glBindTexture(GL_TEXTURE_2D, sTexId); - - EGLDisplay dpy = eglGetCurrentDisplay(); - sImage = eglCreateImageKHR(dpy, EGL_NO_CONTEXT, - EGL_NATIVE_BUFFER_ANDROID, (EGLClientBuffer)clientBuf, 0); - if (sImage == EGL_NO_IMAGE_KHR) { - LOGE("eglCreateImageKHR() failed. err=0x%4x", eglGetError()); - return; - } - - glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, (GLeglImageOES)sImage); - GLint error = glGetError(); - if (error != GL_NO_ERROR) { - eglDestroyImageKHR(dpy, sImage); - LOGE("glEGLImageTargetTexture2DOES() failed. err=0x%4x", error); - return; - } - - // initialize the texture with zeros - GGLSurface t; - buffer->lock(&t, GRALLOC_USAGE_SW_WRITE_OFTEN); - memset(t.data, 0, t.stride * t.height * 2); - buffer->unlock(); - sUseTexture = true; - } -#endif } LayerDim::~LayerDim() @@ -124,26 +76,7 @@ void LayerDim::onDraw(const Region& clip) const glDisable(GL_TEXTURE_EXTERNAL_OES); } #endif -#if defined(DIM_WITH_TEXTURE) && defined(EGL_ANDROID_image_native_buffer) - if (sUseTexture) { - glBindTexture(GL_TEXTURE_2D, sTexId); - glEnable(GL_TEXTURE_2D); - glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - const GLshort texCoords[4][2] = { - { 0, 0 }, - { 0, 1 }, - { 1, 1 }, - { 1, 0 } - }; - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glTexCoordPointer(2, GL_SHORT, 0, texCoords); - } else -#endif - { - glDisable(GL_TEXTURE_2D); - } + glDisable(GL_TEXTURE_2D); GLshort w = sWidth; GLshort h = sHeight; |