summaryrefslogtreecommitdiff
path: root/libs/surfaceflinger/LayerBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/surfaceflinger/LayerBase.cpp')
-rw-r--r--libs/surfaceflinger/LayerBase.cpp43
1 files changed, 33 insertions, 10 deletions
diff --git a/libs/surfaceflinger/LayerBase.cpp b/libs/surfaceflinger/LayerBase.cpp
index 7feccdac42ed..48b0e47a83b0 100644
--- a/libs/surfaceflinger/LayerBase.cpp
+++ b/libs/surfaceflinger/LayerBase.cpp
@@ -38,14 +38,6 @@ namespace android {
// ---------------------------------------------------------------------------
-const uint32_t LayerBase::typeInfo = 1;
-const char* const LayerBase::typeID = "LayerBase";
-
-const uint32_t LayerBaseClient::typeInfo = LayerBase::typeInfo | 2;
-const char* const LayerBaseClient::typeID = "LayerBaseClient";
-
-// ---------------------------------------------------------------------------
-
LayerBase::LayerBase(SurfaceFlinger* flinger, DisplayID display)
: dpy(display), contentDirty(false),
mFlinger(flinger),
@@ -681,6 +673,22 @@ status_t LayerBase::initializeEglImage(
return err;
}
+void LayerBase::dump(String8& result, char* buffer, size_t SIZE) const
+{
+ const Layer::State& s(drawingState());
+ snprintf(buffer, SIZE,
+ "+ %s %p\n"
+ " "
+ "z=%9d, pos=(%4d,%4d), size=(%4d,%4d), "
+ "needsBlending=%1d, needsDithering=%1d, invalidate=%1d, "
+ "alpha=0x%02x, flags=0x%08x, tr=[%.2f, %.2f][%.2f, %.2f]\n",
+ getTypeId(), this, s.z, tx(), ty(), s.w, s.h,
+ needsBlending(), needsDithering(), contentDirty,
+ s.alpha, s.flags,
+ s.transform[0][0], s.transform[0][1],
+ s.transform[1][0], s.transform[1][1]);
+ result.append(buffer);
+}
// ---------------------------------------------------------------------------
@@ -713,13 +721,13 @@ LayerBaseClient::~LayerBaseClient()
delete lcblk;
}
-int32_t LayerBaseClient::serverIndex() const
+ssize_t LayerBaseClient::serverIndex() const
{
sp<Client> client(this->client.promote());
if (client != 0) {
return (client->cid<<16)|mIndex;
}
- return 0xFFFF0000 | mIndex;
+ return ssize_t(0xFFFF0000 | mIndex);
}
sp<LayerBaseClient::Surface> LayerBaseClient::getSurface()
@@ -748,6 +756,21 @@ void LayerBaseClient::onRemoved()
lcblk->setStatus(NO_INIT);
}
+void LayerBaseClient::dump(String8& result, char* buffer, size_t SIZE) const
+{
+ LayerBase::dump(result, buffer, SIZE);
+
+ sp<Client> client(this->client.promote());
+ snprintf(buffer, SIZE,
+ " name=%s\n"
+ " id=0x%08x, client=0x%08x, identity=%u\n",
+ getName().string(),
+ clientIndex(), client.get() ? client->cid : 0,
+ getIdentity());
+
+ result.append(buffer);
+}
+
// ---------------------------------------------------------------------------
LayerBaseClient::Surface::Surface(