Loading libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp +8 −8 Original line number Diff line number Diff line Loading @@ -160,7 +160,7 @@ void DisplayHardware::init(uint32_t dpy) if (mNativeWindow->isUpdateOnDemand()) { mFlags |= UPDATE_ON_DEMAND; mFlags |= PARTIAL_UPDATES; } if (eglGetConfigAttrib(display, config, EGL_CONFIG_CAVEAT, &dummy) == EGL_TRUE) { Loading @@ -174,9 +174,9 @@ void DisplayHardware::init(uint32_t dpy) surface = eglCreateWindowSurface(display, config, mNativeWindow.get(), NULL); if (mFlags & UPDATE_ON_DEMAND) { // if we have update on demand, we definitely don't need to // preserve the backbuffer, which is usually costly. if (mFlags & PARTIAL_UPDATES) { // if we have partial updates, we definitely don't need to // preserve the backbuffer, which may be costly. eglSurfaceAttrib(display, surface, EGL_SWAP_BEHAVIOR, EGL_BUFFER_DESTROYED); } Loading @@ -199,9 +199,9 @@ void DisplayHardware::init(uint32_t dpy) mFlags |= SWAP_RECTANGLE; } } // when we have the choice between UPDATE_ON_DEMAND and SWAP_RECTANGLE // choose UPDATE_ON_DEMAND, which is more efficient if (mFlags & UPDATE_ON_DEMAND) // when we have the choice between PARTIAL_UPDATES and SWAP_RECTANGLE // choose PARTIAL_UPDATES, which should be more efficient if (mFlags & PARTIAL_UPDATES) mFlags &= ~SWAP_RECTANGLE; #endif Loading Loading @@ -317,7 +317,7 @@ void DisplayHardware::flip(const Region& dirty) const } #endif if (mFlags & UPDATE_ON_DEMAND) { if (mFlags & PARTIAL_UPDATES) { mNativeWindow->setUpdateRectangle(dirty.getBounds()); } Loading libs/surfaceflinger/DisplayHardware/DisplayHardware.h +1 −1 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ public: NPOT_EXTENSION = 0x00000100, DRAW_TEXTURE_EXTENSION = 0x00000200, BUFFER_PRESERVED = 0x00010000, UPDATE_ON_DEMAND = 0x00020000, // video driver feature PARTIAL_UPDATES = 0x00020000, // video driver feature SLOW_CONFIG = 0x00040000, // software SWAP_RECTANGLE = 0x00080000, }; Loading libs/surfaceflinger/Layer.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -223,14 +223,12 @@ void Layer::onDraw(const Region& clip) const mFrontBufferIndex : 0; GLuint textureName = mTextures[index].name; if (UNLIKELY(textureName == -1LU)) { //LOGW("Layer %p doesn't have a texture", this); // the texture has not been created yet, this Layer has // in fact never been drawn into. this happens frequently with // SurfaceView. clearWithOpenGL(clip); return; } drawWithOpenGL(clip, mTextures[index]); } Loading libs/surfaceflinger/LayerBase.cpp +55 −65 Original line number Diff line number Diff line Loading @@ -363,7 +363,6 @@ void LayerBase::clearWithOpenGL(const Region& clip, GLclampx red, Region::const_iterator it = clip.begin(); Region::const_iterator const end = clip.end(); if (it != end) { glEnable(GL_SCISSOR_TEST); glVertexPointer(2, GL_FIXED, 0, mVertices); while (it != end) { Loading @@ -373,7 +372,6 @@ void LayerBase::clearWithOpenGL(const Region& clip, GLclampx red, glDrawArrays(GL_TRIANGLE_FAN, 0, 4); } } } void LayerBase::clearWithOpenGL(const Region& clip) const { Loading Loading @@ -427,13 +425,12 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const } } Region::const_iterator it = clip.begin(); Region::const_iterator const end = clip.end(); if (UNLIKELY(transformed() || !(mFlags & DisplayHardware::DRAW_TEXTURE_EXTENSION) )) { //StopWatch watch("GL transformed"); Region::const_iterator it = clip.begin(); Region::const_iterator const end = clip.end(); if (it != end) { const GLfixed texCoords[4][2] = { { 0, 0 }, { 0, 0x10000 }, Loading @@ -458,8 +455,6 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const GLuint th = 1 << (31 - clz(height)); if (tw < width) tw <<= 1; if (th < height) th <<= 1; // this divide should be relatively fast because it's // a power-of-two (optimized path in libgcc) GLfloat ws = GLfloat(width) /tw; GLfloat hs = GLfloat(height)/th; glScalef(ws, hs, 1.0f); Loading @@ -476,11 +471,7 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const glDrawArrays(GL_TRIANGLE_FAN, 0, 4); } glDisableClientState(GL_TEXTURE_COORD_ARRAY); } } else { Region::const_iterator it = clip.begin(); Region::const_iterator const end = clip.end(); if (it != end) { GLint crop[4] = { 0, height, width, -height }; glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop); int x = tx(); Loading @@ -494,7 +485,6 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const } } } } void LayerBase::validateTexture(GLint textureName) const { Loading libs/surfaceflinger/SurfaceFlinger.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -859,10 +859,10 @@ void SurfaceFlinger::handleRepaint() // is costly and usually involves copying the whole update back. } } else { if (flags & DisplayHardware::UPDATE_ON_DEMAND) { if (flags & DisplayHardware::PARTIAL_UPDATES) { // We need to redraw the rectangle that will be updated // (pushed to the framebuffer). // This is needed because UPDATE_ON_DEMAND only takes one // This is needed because PARTIAL_UPDATES only takes one // rectangle instead of a region (see DisplayHardware::flip()) mDirtyRegion.set(mInvalidRegion.bounds()); } else { Loading Loading @@ -920,7 +920,7 @@ void SurfaceFlinger::debugFlashRegions() if (!((flags & DisplayHardware::SWAP_RECTANGLE) || (flags & DisplayHardware::BUFFER_PRESERVED))) { const Region repaint((flags & DisplayHardware::UPDATE_ON_DEMAND) ? const Region repaint((flags & DisplayHardware::PARTIAL_UPDATES) ? mDirtyRegion.bounds() : hw.bounds()); composeSurfaces(repaint); } Loading Loading
libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp +8 −8 Original line number Diff line number Diff line Loading @@ -160,7 +160,7 @@ void DisplayHardware::init(uint32_t dpy) if (mNativeWindow->isUpdateOnDemand()) { mFlags |= UPDATE_ON_DEMAND; mFlags |= PARTIAL_UPDATES; } if (eglGetConfigAttrib(display, config, EGL_CONFIG_CAVEAT, &dummy) == EGL_TRUE) { Loading @@ -174,9 +174,9 @@ void DisplayHardware::init(uint32_t dpy) surface = eglCreateWindowSurface(display, config, mNativeWindow.get(), NULL); if (mFlags & UPDATE_ON_DEMAND) { // if we have update on demand, we definitely don't need to // preserve the backbuffer, which is usually costly. if (mFlags & PARTIAL_UPDATES) { // if we have partial updates, we definitely don't need to // preserve the backbuffer, which may be costly. eglSurfaceAttrib(display, surface, EGL_SWAP_BEHAVIOR, EGL_BUFFER_DESTROYED); } Loading @@ -199,9 +199,9 @@ void DisplayHardware::init(uint32_t dpy) mFlags |= SWAP_RECTANGLE; } } // when we have the choice between UPDATE_ON_DEMAND and SWAP_RECTANGLE // choose UPDATE_ON_DEMAND, which is more efficient if (mFlags & UPDATE_ON_DEMAND) // when we have the choice between PARTIAL_UPDATES and SWAP_RECTANGLE // choose PARTIAL_UPDATES, which should be more efficient if (mFlags & PARTIAL_UPDATES) mFlags &= ~SWAP_RECTANGLE; #endif Loading Loading @@ -317,7 +317,7 @@ void DisplayHardware::flip(const Region& dirty) const } #endif if (mFlags & UPDATE_ON_DEMAND) { if (mFlags & PARTIAL_UPDATES) { mNativeWindow->setUpdateRectangle(dirty.getBounds()); } Loading
libs/surfaceflinger/DisplayHardware/DisplayHardware.h +1 −1 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ public: NPOT_EXTENSION = 0x00000100, DRAW_TEXTURE_EXTENSION = 0x00000200, BUFFER_PRESERVED = 0x00010000, UPDATE_ON_DEMAND = 0x00020000, // video driver feature PARTIAL_UPDATES = 0x00020000, // video driver feature SLOW_CONFIG = 0x00040000, // software SWAP_RECTANGLE = 0x00080000, }; Loading
libs/surfaceflinger/Layer.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -223,14 +223,12 @@ void Layer::onDraw(const Region& clip) const mFrontBufferIndex : 0; GLuint textureName = mTextures[index].name; if (UNLIKELY(textureName == -1LU)) { //LOGW("Layer %p doesn't have a texture", this); // the texture has not been created yet, this Layer has // in fact never been drawn into. this happens frequently with // SurfaceView. clearWithOpenGL(clip); return; } drawWithOpenGL(clip, mTextures[index]); } Loading
libs/surfaceflinger/LayerBase.cpp +55 −65 Original line number Diff line number Diff line Loading @@ -363,7 +363,6 @@ void LayerBase::clearWithOpenGL(const Region& clip, GLclampx red, Region::const_iterator it = clip.begin(); Region::const_iterator const end = clip.end(); if (it != end) { glEnable(GL_SCISSOR_TEST); glVertexPointer(2, GL_FIXED, 0, mVertices); while (it != end) { Loading @@ -373,7 +372,6 @@ void LayerBase::clearWithOpenGL(const Region& clip, GLclampx red, glDrawArrays(GL_TRIANGLE_FAN, 0, 4); } } } void LayerBase::clearWithOpenGL(const Region& clip) const { Loading Loading @@ -427,13 +425,12 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const } } Region::const_iterator it = clip.begin(); Region::const_iterator const end = clip.end(); if (UNLIKELY(transformed() || !(mFlags & DisplayHardware::DRAW_TEXTURE_EXTENSION) )) { //StopWatch watch("GL transformed"); Region::const_iterator it = clip.begin(); Region::const_iterator const end = clip.end(); if (it != end) { const GLfixed texCoords[4][2] = { { 0, 0 }, { 0, 0x10000 }, Loading @@ -458,8 +455,6 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const GLuint th = 1 << (31 - clz(height)); if (tw < width) tw <<= 1; if (th < height) th <<= 1; // this divide should be relatively fast because it's // a power-of-two (optimized path in libgcc) GLfloat ws = GLfloat(width) /tw; GLfloat hs = GLfloat(height)/th; glScalef(ws, hs, 1.0f); Loading @@ -476,11 +471,7 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const glDrawArrays(GL_TRIANGLE_FAN, 0, 4); } glDisableClientState(GL_TEXTURE_COORD_ARRAY); } } else { Region::const_iterator it = clip.begin(); Region::const_iterator const end = clip.end(); if (it != end) { GLint crop[4] = { 0, height, width, -height }; glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop); int x = tx(); Loading @@ -494,7 +485,6 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const } } } } void LayerBase::validateTexture(GLint textureName) const { Loading
libs/surfaceflinger/SurfaceFlinger.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -859,10 +859,10 @@ void SurfaceFlinger::handleRepaint() // is costly and usually involves copying the whole update back. } } else { if (flags & DisplayHardware::UPDATE_ON_DEMAND) { if (flags & DisplayHardware::PARTIAL_UPDATES) { // We need to redraw the rectangle that will be updated // (pushed to the framebuffer). // This is needed because UPDATE_ON_DEMAND only takes one // This is needed because PARTIAL_UPDATES only takes one // rectangle instead of a region (see DisplayHardware::flip()) mDirtyRegion.set(mInvalidRegion.bounds()); } else { Loading Loading @@ -920,7 +920,7 @@ void SurfaceFlinger::debugFlashRegions() if (!((flags & DisplayHardware::SWAP_RECTANGLE) || (flags & DisplayHardware::BUFFER_PRESERVED))) { const Region repaint((flags & DisplayHardware::UPDATE_ON_DEMAND) ? const Region repaint((flags & DisplayHardware::PARTIAL_UPDATES) ? mDirtyRegion.bounds() : hw.bounds()); composeSurfaces(repaint); } Loading