summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/SurfaceFlinger.h
diff options
context:
space:
mode:
authorDan Stoza <stoza@google.com>2015-04-30 13:29:25 -0700
committerDan Stoza <stoza@google.com>2015-04-30 15:10:00 -0700
commit7d89d06a6fe1bfadfe277f19dbb7e4aa021444e0 (patch)
treee4bc2cff57d40c689c8b325a94f67ce02883e381 /services/surfaceflinger/SurfaceFlinger.h
parent84f1d9c288f35fa399f97207b6af43a261d5989a (diff)
downloadframeworks_native-7d89d06a6fe1bfadfe277f19dbb7e4aa021444e0.zip
frameworks_native-7d89d06a6fe1bfadfe277f19dbb7e4aa021444e0.tar.gz
frameworks_native-7d89d06a6fe1bfadfe277f19dbb7e4aa021444e0.tar.bz2
SurfaceFlinger: Limit to 4k Layers
Sets a limit of 4k Layers which SurfaceFlinger will allow to be in existence at any given time. An attempt to create Layers in excess of this limit will fail with NO_MEMORY. Bug: 20674586 Change-Id: I2dfaf59643d826f982b2fa44e8a9ed643176d972 (cherry picked from commit e7f8dde3f3c398c1ea1bec14e76725a760f71d31)
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.h')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index d2654d4..3759a92 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -144,6 +144,8 @@ private:
// every half hour.
enum { LOG_FRAME_STATS_PERIOD = 30*60*60 };
+ static const size_t MAX_LAYERS = 4096;
+
// We're reference counted, never destroy SurfaceFlinger directly
virtual ~SurfaceFlinger();
@@ -305,7 +307,7 @@ private:
status_t removeLayer(const sp<Layer>& layer);
// add a layer to SurfaceFlinger
- void addClientLayer(const sp<Client>& client,
+ status_t addClientLayer(const sp<Client>& client,
const sp<IBinder>& handle,
const sp<IGraphicBufferProducer>& gbc,
const sp<Layer>& lbc);