diff options
| -rw-r--r-- | libs/surfaceflinger/LayerBase.cpp | 3 | ||||
| -rw-r--r-- | libs/surfaceflinger/SurfaceFlinger.cpp | 8 |
2 files changed, 8 insertions, 3 deletions
diff --git a/libs/surfaceflinger/LayerBase.cpp b/libs/surfaceflinger/LayerBase.cpp index 9ddf9720e4..ec38fe9fd5 100644 --- a/libs/surfaceflinger/LayerBase.cpp +++ b/libs/surfaceflinger/LayerBase.cpp @@ -398,7 +398,8 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const glEnable(GL_TEXTURE_2D); // Dithering... - if (s.flags & ISurfaceComposer::eLayerDither) { + bool fast = !(mFlags & DisplayHardware::SLOW_CONFIG); + if (fast || s.flags & ISurfaceComposer::eLayerDither) { glEnable(GL_DITHER); } else { glDisable(GL_DITHER); diff --git a/libs/surfaceflinger/SurfaceFlinger.cpp b/libs/surfaceflinger/SurfaceFlinger.cpp index a72294a2ac..c78921a115 100644 --- a/libs/surfaceflinger/SurfaceFlinger.cpp +++ b/libs/surfaceflinger/SurfaceFlinger.cpp @@ -573,8 +573,10 @@ void SurfaceFlinger::handleTransaction(uint32_t transactionFlags) // do this without lock held const size_t count = ditchedLayers.size(); for (size_t i=0 ; i<count ; i++) { - //LOGD("ditching layer %p", ditchedLayers[i].get()); - ditchedLayers[i]->ditch(); + if (ditchedLayers[i] != 0) { + //LOGD("ditching layer %p", ditchedLayers[i].get()); + ditchedLayers[i]->ditch(); + } } } @@ -1082,6 +1084,8 @@ status_t SurfaceFlinger::invalidateLayerVisibility(const sp<LayerBase>& layer) status_t SurfaceFlinger::addLayer_l(const sp<LayerBase>& layer) { + if (layer == 0) + return BAD_VALUE; ssize_t i = mCurrentState.layersSortedByZ.add( layer, &LayerBase::compareCurrentStateZ); sp<LayerBaseClient> lbc = LayerBase::dynamicCast< LayerBaseClient* >(layer.get()); |