SF: Use consistent names for display IDs
There are two types of display IDs: hwc2_display_t for HWC IDs, and
int32_t for SF IDs. The latter are confusingly referred to as "hwcId".
This CL renames them to "hwcDisplayId" and "displayId", respectively.
Note that int32_t will be replaced by DisplayId in a follow-up CL.
Bug: 74619554
Test: Build
Change-Id: Ia9b621d385c2bf842a2093b578140dc7a2eaea69
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 5e0de88..c521d5d 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -304,7 +304,7 @@
void writeToProto(LayerProto* layerInfo,
LayerVector::StateSet stateSet = LayerVector::StateSet::Drawing);
- void writeToProto(LayerProto* layerInfo, int32_t hwcId);
+ void writeToProto(LayerProto* layerInfo, int32_t displayId);
protected:
/*
@@ -317,16 +317,16 @@
virtual void setDefaultBufferSize(uint32_t /*w*/, uint32_t /*h*/) {}
void setGeometry(const sp<const DisplayDevice>& display, uint32_t z);
- void forceClientComposition(int32_t hwcId);
- bool getForceClientComposition(int32_t hwcId);
+ void forceClientComposition(int32_t displayId);
+ bool getForceClientComposition(int32_t displayId);
virtual void setPerFrameData(const sp<const DisplayDevice>& display) = 0;
// callIntoHwc exists so we can update our local state and call
// acceptDisplayChanges without unnecessarily updating the device's state
- void setCompositionType(int32_t hwcId, HWC2::Composition type, bool callIntoHwc = true);
- HWC2::Composition getCompositionType(int32_t hwcId) const;
- void setClearClientTarget(int32_t hwcId, bool clear);
- bool getClearClientTarget(int32_t hwcId) const;
+ void setCompositionType(int32_t displayId, HWC2::Composition type, bool callIntoHwc = true);
+ HWC2::Composition getCompositionType(int32_t displayId) const;
+ void setClearClientTarget(int32_t displayId, bool clear);
+ bool getClearClientTarget(int32_t displayId) const;
void updateCursorPosition(const sp<const DisplayDevice>& hw);
/*
@@ -443,19 +443,17 @@
// -----------------------------------------------------------------------
- bool createHwcLayer(HWComposer* hwc, int32_t hwcId);
- bool destroyHwcLayer(int32_t hwcId);
+ bool createHwcLayer(HWComposer* hwc, int32_t displayId);
+ bool destroyHwcLayer(int32_t displayId);
void destroyAllHwcLayers();
- bool hasHwcLayer(int32_t hwcId) {
- return getBE().mHwcLayers.count(hwcId) > 0;
- }
+ bool hasHwcLayer(int32_t displayId) { return getBE().mHwcLayers.count(displayId) > 0; }
- HWC2::Layer* getHwcLayer(int32_t hwcId) {
- if (getBE().mHwcLayers.count(hwcId) == 0) {
+ HWC2::Layer* getHwcLayer(int32_t displayId) {
+ if (getBE().mHwcLayers.count(displayId) == 0) {
return nullptr;
}
- return getBE().mHwcLayers[hwcId].layer;
+ return getBE().mHwcLayers[displayId].layer;
}
// -----------------------------------------------------------------------
@@ -473,7 +471,7 @@
/* always call base class first */
static void miniDumpHeader(String8& result);
- void miniDump(String8& result, int32_t hwcId) const;
+ void miniDump(String8& result, int32_t displayId) const;
void dumpFrameStats(String8& result) const;
void dumpFrameEvents(String8& result);
void clearFrameStats();