Loading services/surfaceflinger/Layer.cpp +8 −4 Original line number Original line Diff line number Diff line Loading @@ -182,10 +182,14 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h, mSurfaceTexture->setDefaultBufferSize(w, h); mSurfaceTexture->setDefaultBufferSize(w, h); mSurfaceTexture->setDefaultBufferFormat(format); mSurfaceTexture->setDefaultBufferFormat(format); if (mFlinger->getUseDithering()) { // we use the red index // we use the red index int displayRedSize = displayInfo.getSize(PixelFormatInfo::INDEX_RED); int displayRedSize = displayInfo.getSize(PixelFormatInfo::INDEX_RED); int layerRedsize = info.getSize(PixelFormatInfo::INDEX_RED); int layerRedsize = info.getSize(PixelFormatInfo::INDEX_RED); mNeedsDithering = layerRedsize > displayRedSize; mNeedsDithering = layerRedsize > displayRedSize; } else { mNeedsDithering = false; } return NO_ERROR; return NO_ERROR; } } Loading services/surfaceflinger/LayerBase.cpp +13 −0 Original line number Original line Diff line number Diff line Loading @@ -406,6 +406,7 @@ void LayerBase::clearWithOpenGL(const Region& clip, GLclampf red, glDisable(GL_TEXTURE_EXTERNAL_OES); glDisable(GL_TEXTURE_EXTERNAL_OES); glDisable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_2D); glDisable(GL_BLEND); glDisable(GL_BLEND); glDisable(GL_DITHER); Region::const_iterator it = clip.begin(); Region::const_iterator it = clip.begin(); Region::const_iterator const end = clip.end(); Region::const_iterator const end = clip.end(); Loading Loading @@ -467,6 +468,12 @@ void LayerBase::drawWithOpenGL(const Region& clip) const texCoords[3].u = 1; texCoords[3].u = 1; texCoords[3].v = 1; texCoords[3].v = 1; if (needsDithering()) { glEnable(GL_DITHER); } else { glDisable(GL_DITHER); } glEnableClientState(GL_TEXTURE_COORD_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glVertexPointer(2, GL_FLOAT, 0, mVertices); glVertexPointer(2, GL_FLOAT, 0, mVertices); glTexCoordPointer(2, GL_FLOAT, 0, texCoords); glTexCoordPointer(2, GL_FLOAT, 0, texCoords); Loading Loading @@ -530,6 +537,12 @@ void LayerBase::drawS3DUIWithOpenGL(const Region& clip) const texCoords[3].u = 1; texCoords[3].u = 1; texCoords[3].v = 1; texCoords[3].v = 1; if (needsDithering()) { glEnable(GL_DITHER); } else { glDisable(GL_DITHER); } glEnableClientState(GL_TEXTURE_COORD_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); Region::const_iterator it = clip.begin(); Region::const_iterator it = clip.begin(); Loading services/surfaceflinger/SurfaceFlinger.cpp +7 −1 Original line number Original line Diff line number Diff line Loading @@ -112,7 +112,8 @@ SurfaceFlinger::SurfaceFlinger() mCanSkipComposition(false), mCanSkipComposition(false), #endif #endif mConsoleSignals(0), mConsoleSignals(0), mSecureFrameBuffer(0) mSecureFrameBuffer(0), mUseDithering(false) { { init(); init(); } } Loading @@ -132,6 +133,10 @@ void SurfaceFlinger::init() property_get("debug.sf.ddms", value, "0"); property_get("debug.sf.ddms", value, "0"); mDebugDDMS = atoi(value); mDebugDDMS = atoi(value); property_get("persist.sys.use_dithering", value, "0"); mUseDithering = atoi(value) == 1; if (mDebugDDMS) { if (mDebugDDMS) { DdmConnection::start(getServiceName()); DdmConnection::start(getServiceName()); } } Loading @@ -139,6 +144,7 @@ void SurfaceFlinger::init() LOGI_IF(mDebugRegion, "showupdates enabled"); LOGI_IF(mDebugRegion, "showupdates enabled"); LOGI_IF(mDebugBackground, "showbackground enabled"); LOGI_IF(mDebugBackground, "showbackground enabled"); LOGI_IF(mDebugDDMS, "DDMS debugging enabled"); LOGI_IF(mDebugDDMS, "DDMS debugging enabled"); LOGI_IF(mUseDithering, "use dithering"); } } SurfaceFlinger::~SurfaceFlinger() SurfaceFlinger::~SurfaceFlinger() Loading services/surfaceflinger/SurfaceFlinger.h +4 −0 Original line number Original line Diff line number Diff line Loading @@ -221,6 +221,8 @@ public: GLuint getProtectedTexName() const { return mProtectedTexName; } GLuint getProtectedTexName() const { return mProtectedTexName; } inline int getUseDithering() const { return mUseDithering; } class MessageDestroyGLTexture : public MessageBase { class MessageDestroyGLTexture : public MessageBase { GLuint texture; GLuint texture; Loading Loading @@ -442,6 +444,8 @@ private: // only written in the main thread, only read in other threads // only written in the main thread, only read in other threads volatile int32_t mSecureFrameBuffer; volatile int32_t mSecureFrameBuffer; bool mUseDithering; }; }; // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- Loading Loading
services/surfaceflinger/Layer.cpp +8 −4 Original line number Original line Diff line number Diff line Loading @@ -182,10 +182,14 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h, mSurfaceTexture->setDefaultBufferSize(w, h); mSurfaceTexture->setDefaultBufferSize(w, h); mSurfaceTexture->setDefaultBufferFormat(format); mSurfaceTexture->setDefaultBufferFormat(format); if (mFlinger->getUseDithering()) { // we use the red index // we use the red index int displayRedSize = displayInfo.getSize(PixelFormatInfo::INDEX_RED); int displayRedSize = displayInfo.getSize(PixelFormatInfo::INDEX_RED); int layerRedsize = info.getSize(PixelFormatInfo::INDEX_RED); int layerRedsize = info.getSize(PixelFormatInfo::INDEX_RED); mNeedsDithering = layerRedsize > displayRedSize; mNeedsDithering = layerRedsize > displayRedSize; } else { mNeedsDithering = false; } return NO_ERROR; return NO_ERROR; } } Loading
services/surfaceflinger/LayerBase.cpp +13 −0 Original line number Original line Diff line number Diff line Loading @@ -406,6 +406,7 @@ void LayerBase::clearWithOpenGL(const Region& clip, GLclampf red, glDisable(GL_TEXTURE_EXTERNAL_OES); glDisable(GL_TEXTURE_EXTERNAL_OES); glDisable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_2D); glDisable(GL_BLEND); glDisable(GL_BLEND); glDisable(GL_DITHER); Region::const_iterator it = clip.begin(); Region::const_iterator it = clip.begin(); Region::const_iterator const end = clip.end(); Region::const_iterator const end = clip.end(); Loading Loading @@ -467,6 +468,12 @@ void LayerBase::drawWithOpenGL(const Region& clip) const texCoords[3].u = 1; texCoords[3].u = 1; texCoords[3].v = 1; texCoords[3].v = 1; if (needsDithering()) { glEnable(GL_DITHER); } else { glDisable(GL_DITHER); } glEnableClientState(GL_TEXTURE_COORD_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glVertexPointer(2, GL_FLOAT, 0, mVertices); glVertexPointer(2, GL_FLOAT, 0, mVertices); glTexCoordPointer(2, GL_FLOAT, 0, texCoords); glTexCoordPointer(2, GL_FLOAT, 0, texCoords); Loading Loading @@ -530,6 +537,12 @@ void LayerBase::drawS3DUIWithOpenGL(const Region& clip) const texCoords[3].u = 1; texCoords[3].u = 1; texCoords[3].v = 1; texCoords[3].v = 1; if (needsDithering()) { glEnable(GL_DITHER); } else { glDisable(GL_DITHER); } glEnableClientState(GL_TEXTURE_COORD_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); Region::const_iterator it = clip.begin(); Region::const_iterator it = clip.begin(); Loading
services/surfaceflinger/SurfaceFlinger.cpp +7 −1 Original line number Original line Diff line number Diff line Loading @@ -112,7 +112,8 @@ SurfaceFlinger::SurfaceFlinger() mCanSkipComposition(false), mCanSkipComposition(false), #endif #endif mConsoleSignals(0), mConsoleSignals(0), mSecureFrameBuffer(0) mSecureFrameBuffer(0), mUseDithering(false) { { init(); init(); } } Loading @@ -132,6 +133,10 @@ void SurfaceFlinger::init() property_get("debug.sf.ddms", value, "0"); property_get("debug.sf.ddms", value, "0"); mDebugDDMS = atoi(value); mDebugDDMS = atoi(value); property_get("persist.sys.use_dithering", value, "0"); mUseDithering = atoi(value) == 1; if (mDebugDDMS) { if (mDebugDDMS) { DdmConnection::start(getServiceName()); DdmConnection::start(getServiceName()); } } Loading @@ -139,6 +144,7 @@ void SurfaceFlinger::init() LOGI_IF(mDebugRegion, "showupdates enabled"); LOGI_IF(mDebugRegion, "showupdates enabled"); LOGI_IF(mDebugBackground, "showbackground enabled"); LOGI_IF(mDebugBackground, "showbackground enabled"); LOGI_IF(mDebugDDMS, "DDMS debugging enabled"); LOGI_IF(mDebugDDMS, "DDMS debugging enabled"); LOGI_IF(mUseDithering, "use dithering"); } } SurfaceFlinger::~SurfaceFlinger() SurfaceFlinger::~SurfaceFlinger() Loading
services/surfaceflinger/SurfaceFlinger.h +4 −0 Original line number Original line Diff line number Diff line Loading @@ -221,6 +221,8 @@ public: GLuint getProtectedTexName() const { return mProtectedTexName; } GLuint getProtectedTexName() const { return mProtectedTexName; } inline int getUseDithering() const { return mUseDithering; } class MessageDestroyGLTexture : public MessageBase { class MessageDestroyGLTexture : public MessageBase { GLuint texture; GLuint texture; Loading Loading @@ -442,6 +444,8 @@ private: // only written in the main thread, only read in other threads // only written in the main thread, only read in other threads volatile int32_t mSecureFrameBuffer; volatile int32_t mSecureFrameBuffer; bool mUseDithering; }; }; // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- Loading