diff options
author | 2016-10-19 11:10:33 -0700 | |
---|---|---|
committer | 2016-12-29 15:16:41 -0800 | |
commit | 71bded513d37a6c1260b4a62c69ecc0d24be95f7 (patch) | |
tree | 7ffd1730954cd23844985dcd3c956d9ac2aa3a60 /services/surfaceflinger/Layer.cpp | |
parent | c03d283e8b3f830d76dd94822b2a13872c05c730 (diff) |
Create libgfx, starting with FloatRect
Creates libgfx, the future home of everything currently in libui and
libgui, which will be rigorously checked with -Weverything (with a few
common-sense exceptions) and clang-tidy and formatted using the included
.clang-format file.
Starts by moving FloatRect out of services/surfaceflinger since it will
be used by other libgfx primitives later.
Test: m
Change-Id: I5045ac089020e6ee380e81e8735117c500264b37
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
-rw-r--r-- | services/surfaceflinger/Layer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index c7d37a561f..22d01ae0b3 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -377,10 +377,10 @@ Rect Layer::computeBounds(const Region& activeTransparentRegion) const { return reduce(win, activeTransparentRegion); } -FloatRect Layer::computeCrop(const sp<const DisplayDevice>& hw) const { +gfx::FloatRect Layer::computeCrop(const sp<const DisplayDevice>& hw) const { // the content crop is the area of the content that gets scaled to the // layer's size. - FloatRect crop(getContentCrop()); + gfx::FloatRect crop = getContentCrop().toFloatRect(); // the crop is the area of the window that gets cropped, but not // scaled in any ways. @@ -585,7 +585,7 @@ void Layer::setGeometry( hwcInfo.displayFrame = transformedFrame; } - FloatRect sourceCrop = computeCrop(displayDevice); + gfx::FloatRect sourceCrop = computeCrop(displayDevice); error = hwcLayer->setSourceCrop(sourceCrop); if (error != HWC2::Error::None) { ALOGE("[%s] Failed to set source crop [%.3f, %.3f, %.3f, %.3f]: " @@ -2179,7 +2179,7 @@ void Layer::miniDump(String8& result, int32_t hwcId) const { const Rect& frame = hwcInfo.displayFrame; result.appendFormat("%4d %4d %4d %4d | ", frame.left, frame.top, frame.right, frame.bottom); - const FloatRect& crop = hwcInfo.sourceCrop; + const gfx::FloatRect& crop = hwcInfo.sourceCrop; result.appendFormat("%6.1f %6.1f %6.1f %6.1f\n", crop.left, crop.top, crop.right, crop.bottom); |