From a493be5825d15f6a94d1afb5910db075a2a7abc1 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Fri, 15 Mar 2013 16:08:10 -0700 Subject: [PATCH] don't capture hidden layers in screenshots Bug: 8389956 Change-Id: I9ed836395258732c743c6fd44092bd01020dde13 --- services/surfaceflinger/SurfaceFlinger.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 98f6dedcc..40876eced 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -2719,9 +2719,11 @@ status_t SurfaceFlinger::captureScreenImplLocked( const Layer::State& state(layer->drawingState()); if (state.layerStack == hw->getLayerStack()) { if (state.z >= minLayerZ && state.z <= maxLayerZ) { - if (filtering) layer->setFiltering(true); - layer->draw(hw); - if (filtering) layer->setFiltering(false); + if (layer->isVisible()) { + if (filtering) layer->setFiltering(true); + layer->draw(hw); + if (filtering) layer->setFiltering(false); + } } } }