From 6ad317c0dfcf07723ee36ed33c3eb16585469f63 Mon Sep 17 00:00:00 2001 From: Marin Shalamanov Date: Wed, 29 Jul 2020 23:34:07 +0200 Subject: [SF, CE] Rename viewport, frame and destinationClip This change introduces a new class ProjectionSpace and uses it in OutputCompositionState to describe the layer stack space, the physical display space and the oriented display space. We rename viewport to layerStackSpaceRect, frame to orientedDisplaySpaceRect and destinationClip displaySpaceRect. This aims to provide better readibility of the code and it's also consistent with SurfaceControl.setDisplayProjction where layerStackRect and displayRect are used for viewport and frame. Bug: 161793589 Bug: 160404780 Test: m && flash device Test: atest libsurfaceflinger_unittest libcompositionengine_test Test: adb shell dumpsys SurfaceFlinger Change-Id: Iee20b908157cbef4de4d9addf429f98356ec942d --- libs/ui/Rect.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libs/ui/Rect.cpp') diff --git a/libs/ui/Rect.cpp b/libs/ui/Rect.cpp index 13fed3a239..a8d6285169 100644 --- a/libs/ui/Rect.cpp +++ b/libs/ui/Rect.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#include #include #include @@ -149,4 +150,13 @@ Rect Rect::reduce(const Rect& exclude) const { return result; } +std::string to_string(const android::Rect& rect) { + return android::base::StringPrintf("Rect(%d, %d, %d, %d)", rect.left, rect.top, rect.right, + rect.bottom); +} + +void PrintTo(const Rect& rect, ::std::ostream* os) { + *os << to_string(rect); +} + }; // namespace android -- cgit v1.2.3-59-g8ed1b