SF: User buffer size instead of layer size when calculating size
- Change the remaining references to layer size with buffer size
- Fail SurfaceFlinger::createLayer if the caller provides a buffer size and the layer is a color or
container layer
- Update Transation_test to explicitly set crop for buffer-less layers
Bug:114413815
Test: go/wm-smoke
Test: mmma frameworks/native/services/surfaceflinger/tests/ && \
mmma frameworks/native/libs/gui/tests/ && adb sync data && \
adb shell /data/nativetest64/libgui_test/libgui_test && \
adb shell /data/nativetest64/libsurfaceflinger_unittest/libsurfaceflinger_unittest && \
adb shell /data/nativetest64/SurfaceFlinger_test/SurfaceFlinger_test && \
adb shell /data/nativetest64/SurfaceParcelable_test/SurfaceParcelable_test && \
echo "ALL TESTS PASSED"
Change-Id: Ic40a2ea3e629ce774891075afaf9a4d05e95ca4d
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index fe8d5a9..00a6bbe 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -596,6 +596,12 @@
int32_t getZ() const;
virtual void pushPendingState();
+ /**
+ * Returns active buffer size in the correct orientation. Buffer size is determined by undoing
+ * any buffer transformations. If the layer has no buffer then return INVALID_RECT.
+ */
+ virtual Rect getBufferSize(const Layer::State&) const { return Rect::INVALID_RECT; }
+
protected:
// constant
sp<SurfaceFlinger> mFlinger;
@@ -819,12 +825,6 @@
* bounds are constrained by its parent bounds.
*/
Rect getCroppedBufferSize(const Layer::State& s) const;
-
- /**
- * Returns active buffer size in the correct orientation. Buffer size is determined by undoing
- * any buffer transformations. If the layer has no buffer then return INVALID_RECT.
- */
- virtual Rect getBufferSize(const Layer::State&) const { return Rect::INVALID_RECT; }
};
} // namespace android