diff options
author | Mathias Agopian <mathias@google.com> | 2010-04-20 17:55:49 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2010-04-21 22:28:20 -0700 |
commit | 1b5e1021b8c9b87113b70d94dfb7b50f8c5b01b8 (patch) | |
tree | 0647a68e25a4a6329cc0572a75dee37b8fd3dc19 /libs/surfaceflinger/Layer.cpp | |
parent | 940bc0545faf7394419ce1f8d890e1e2ec0d3183 (diff) | |
download | frameworks_native-1b5e1021b8c9b87113b70d94dfb7b50f8c5b01b8.zip frameworks_native-1b5e1021b8c9b87113b70d94dfb7b50f8c5b01b8.tar.gz frameworks_native-1b5e1021b8c9b87113b70d94dfb7b50f8c5b01b8.tar.bz2 |
more surfaceflinger cleanups
get rid of the "fake rtti" code, and use polymorphism instead.
also simplify how we log SF's state (using polymorphism)
Change-Id: I2bae7c98de4dd207a3e2b00083fa3fde7c467922
Diffstat (limited to 'libs/surfaceflinger/Layer.cpp')
-rw-r--r-- | libs/surfaceflinger/Layer.cpp | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/libs/surfaceflinger/Layer.cpp b/libs/surfaceflinger/Layer.cpp index 1a66970..566428f 100644 --- a/libs/surfaceflinger/Layer.cpp +++ b/libs/surfaceflinger/Layer.cpp @@ -47,11 +47,6 @@ template <typename T> inline T min(T a, T b) { // --------------------------------------------------------------------------- -const uint32_t Layer::typeInfo = LayerBaseClient::typeInfo | 4; -const char* const Layer::typeID = "Layer"; - -// --------------------------------------------------------------------------- - Layer::Layer(SurfaceFlinger* flinger, DisplayID display, const sp<Client>& c, int32_t i) : LayerBaseClient(flinger, display, c, i), @@ -572,7 +567,7 @@ void Layer::unlockPageFlip( } if (visibleRegionScreen.isEmpty()) { // an invisible layer should not hold a freeze-lock - // (because it may never be updated and thereore never release it) + // (because it may never be updated and therefore never release it) mFreezeLock.clear(); } } @@ -585,6 +580,38 @@ void Layer::finishPageFlip() this, mFrontBufferIndex); } + +void Layer::dump(String8& result, char* buffer, size_t SIZE) const +{ + LayerBaseClient::dump(result, buffer, SIZE); + + SharedBufferStack::Statistics stats = lcblk->getStats(); + result.append( lcblk->dump(" ") ); + sp<const GraphicBuffer> buf0(getBuffer(0)); + sp<const GraphicBuffer> buf1(getBuffer(1)); + uint32_t w0=0, h0=0, s0=0; + uint32_t w1=0, h1=0, s1=0; + if (buf0 != 0) { + w0 = buf0->getWidth(); + h0 = buf0->getHeight(); + s0 = buf0->getStride(); + } + if (buf1 != 0) { + w1 = buf1->getWidth(); + h1 = buf1->getHeight(); + s1 = buf1->getStride(); + } + snprintf(buffer, SIZE, + " " + "format=%2d, [%3ux%3u:%3u] [%3ux%3u:%3u]," + " freezeLock=%p, dq-q-time=%u us\n", + pixelFormat(), + w0, h0, s0, w1, h1, s1, + getFreezeLock().get(), stats.totalTime); + + result.append(buffer); +} + // --------------------------------------------------------------------------- Layer::SurfaceLayer::SurfaceLayer(const sp<SurfaceFlinger>& flinger, |