SurfaceFlinger: Remove the duty of ColorLayer in computeCrop
There is no active buffer in ColorLayer. Computing its source crop is
nonsense and may cause unwanted behavior in HWC.
Bug: b/109829386
Test: ColorLayer can be displayed correctly.
Change-Id: Ia30bb13e932a55a5cfb0a38da2c459d53dff5e3b
diff --git a/services/surfaceflinger/ColorLayer.h b/services/surfaceflinger/ColorLayer.h
index 6a6e7c0..3408045 100644
--- a/services/surfaceflinger/ColorLayer.h
+++ b/services/surfaceflinger/ColorLayer.h
@@ -35,6 +35,9 @@
bool isVisible() const override;
void setPerFrameData(const sp<const DisplayDevice>& display) override;
+
+protected:
+ FloatRect computeCrop(const sp<const DisplayDevice>& /*display*/) const override { return {}; }
};
} // namespace android
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index fb94058..49c0d63 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -556,7 +556,7 @@
uint32_t getEffectiveUsage(uint32_t usage) const;
- FloatRect computeCrop(const sp<const DisplayDevice>& display) const;
+ virtual FloatRect computeCrop(const sp<const DisplayDevice>& display) const;
// Compute the initial crop as specified by parent layers and the
// SurfaceControl for this layer. Does not include buffer crop from the
// IGraphicBufferProducer client, as that should not affect child clipping.