SurfaceFlinger and libgui: Switch Z-order to signed type.
In preparation for SurfaceFlinger child layers. In that model
children's Z order will be relative to their parent. We need
negative Z values to represent children stacking below their
parent (e.g. SurfaceView). Java side already uses signed types
strangely enough.
Test: Basically a refactoring. SurfaceFlinger still works.
Change-Id: Ifcece69f6f9d917cbf5238a59f8e5de1e8ba6a25
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 1654a51..3959341 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -109,7 +109,7 @@
struct State {
Geometry active;
Geometry requested;
- uint32_t z;
+ int32_t z;
uint32_t layerStack;
#ifdef USE_HWC2
float alpha;
@@ -154,7 +154,7 @@
// modify current state
bool setPosition(float x, float y, bool immediate);
- bool setLayer(uint32_t z);
+ bool setLayer(int32_t z);
bool setSize(uint32_t w, uint32_t h);
#ifdef USE_HWC2
bool setAlpha(float alpha);
@@ -234,7 +234,7 @@
// -----------------------------------------------------------------------
#ifdef USE_HWC2
- void setGeometry(const sp<const DisplayDevice>& displayDevice);
+ void setGeometry(const sp<const DisplayDevice>& displayDevice, uint32_t z);
void forceClientComposition(int32_t hwcId);
void setPerFrameData(const sp<const DisplayDevice>& displayDevice);