diff options
-rw-r--r-- | include/ui/FloatRect.h (renamed from include/gfx/FloatRect.h) | 4 | ||||
-rw-r--r-- | include/ui/Rect.h | 4 | ||||
-rw-r--r-- | services/surfaceflinger/DisplayHardware/HWC2.cpp | 5 | ||||
-rw-r--r-- | services/surfaceflinger/DisplayHardware/HWC2.h | 6 | ||||
-rw-r--r-- | services/surfaceflinger/DisplayHardware/HWComposer_hwc1.cpp | 2 | ||||
-rw-r--r-- | services/surfaceflinger/DisplayHardware/HWComposer_hwc1.h | 6 | ||||
-rw-r--r-- | services/surfaceflinger/Layer.cpp | 8 | ||||
-rw-r--r-- | services/surfaceflinger/Layer.h | 6 |
8 files changed, 16 insertions, 25 deletions
diff --git a/include/gfx/FloatRect.h b/include/ui/FloatRect.h index 6be5e22ef5..270675cba2 100644 --- a/include/gfx/FloatRect.h +++ b/include/ui/FloatRect.h @@ -17,10 +17,9 @@ #pragma once namespace android { -namespace gfx { class FloatRect { - public: +public: FloatRect() = default; constexpr FloatRect(float _left, float _top, float _right, float _bottom) : left(_left), top(_top), right(_right), bottom(_bottom) {} @@ -38,5 +37,4 @@ inline bool operator==(const FloatRect& a, const FloatRect& b) { return a.left == b.left && a.top == b.top && a.right == b.right && a.bottom == b.bottom; } -} // namespace gfx } // namespace android diff --git a/include/ui/Rect.h b/include/ui/Rect.h index ce33d4e031..3d600be3b6 100644 --- a/include/ui/Rect.h +++ b/include/ui/Rect.h @@ -17,12 +17,12 @@ #ifndef ANDROID_UI_RECT #define ANDROID_UI_RECT -#include <gfx/FloatRect.h> #include <utils/Flattenable.h> #include <utils/Log.h> #include <utils/TypeHelpers.h> #include <log/log.h> +#include <ui/FloatRect.h> #include <ui/Point.h> #include <android/rect.h> @@ -185,7 +185,7 @@ public: inline int32_t height() const { return getHeight(); } inline void set(const Rect& rhs) { operator = (rhs); } - gfx::FloatRect toFloatRect() const { + FloatRect toFloatRect() const { return {static_cast<float>(left), static_cast<float>(top), static_cast<float>(right), static_cast<float>(bottom)}; } diff --git a/services/surfaceflinger/DisplayHardware/HWC2.cpp b/services/surfaceflinger/DisplayHardware/HWC2.cpp index a25e8a1b89..e49e7344f8 100644 --- a/services/surfaceflinger/DisplayHardware/HWC2.cpp +++ b/services/surfaceflinger/DisplayHardware/HWC2.cpp @@ -23,9 +23,8 @@ #include "HWC2.h" #include "ComposerHal.h" -#include <gfx/FloatRect.h> - #include <ui/Fence.h> +#include <ui/FloatRect.h> #include <ui/GraphicBuffer.h> #include <ui/Region.h> @@ -74,12 +73,12 @@ extern "C" { } using android::Fence; +using android::FloatRect; using android::GraphicBuffer; using android::HdrCapabilities; using android::Rect; using android::Region; using android::sp; -using android::gfx::FloatRect; using android::hardware::Return; using android::hardware::Void; diff --git a/services/surfaceflinger/DisplayHardware/HWC2.h b/services/surfaceflinger/DisplayHardware/HWC2.h index 93eb99907b..e129a3a54a 100644 --- a/services/surfaceflinger/DisplayHardware/HWC2.h +++ b/services/surfaceflinger/DisplayHardware/HWC2.h @@ -38,12 +38,10 @@ namespace android { class Fence; + class FloatRect; class GraphicBuffer; class Rect; class Region; - namespace gfx { - class FloatRect; - } namespace Hwc2 { class Composer; } @@ -410,7 +408,7 @@ public: [[clang::warn_unused_result]] Error setSidebandStream( const native_handle_t* stream); [[clang::warn_unused_result]] Error setSourceCrop( - const android::gfx::FloatRect& crop); + const android::FloatRect& crop); [[clang::warn_unused_result]] Error setTransform(Transform transform); [[clang::warn_unused_result]] Error setVisibleRegion( const android::Region& region); diff --git a/services/surfaceflinger/DisplayHardware/HWComposer_hwc1.cpp b/services/surfaceflinger/DisplayHardware/HWComposer_hwc1.cpp index 0bfc56e6a8..2fff266e96 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer_hwc1.cpp +++ b/services/surfaceflinger/DisplayHardware/HWComposer_hwc1.cpp @@ -1031,7 +1031,7 @@ public: virtual void setFrame(const Rect& frame) { getLayer()->displayFrame = reinterpret_cast<hwc_rect_t const&>(frame); } - virtual void setCrop(const gfx::FloatRect& crop) { + virtual void setCrop(const FloatRect& crop) { if (hwcHasApiVersion(mHwc, HWC_DEVICE_API_VERSION_1_3)) { getLayer()->sourceCropf = reinterpret_cast<hwc_frect_t const&>(crop); } else { diff --git a/services/surfaceflinger/DisplayHardware/HWComposer_hwc1.h b/services/surfaceflinger/DisplayHardware/HWComposer_hwc1.h index a94bc1e821..f64d69a86a 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer_hwc1.h +++ b/services/surfaceflinger/DisplayHardware/HWComposer_hwc1.h @@ -48,14 +48,12 @@ namespace android { // --------------------------------------------------------------------------- class Fence; +class FloatRect; class GraphicBuffer; class NativeHandle; class Region; class String8; class SurfaceFlinger; -namespace gfx { - class FloatRect; -} class HWComposer { @@ -172,7 +170,7 @@ public: virtual void setBlending(uint32_t blending) = 0; virtual void setTransform(uint32_t transform) = 0; virtual void setFrame(const Rect& frame) = 0; - virtual void setCrop(const gfx::FloatRect& crop) = 0; + virtual void setCrop(const FloatRect& crop) = 0; virtual void setVisibleRegionScreen(const Region& reg) = 0; virtual void setSurfaceDamage(const Region& reg) = 0; virtual void setSidebandStream(const sp<NativeHandle>& stream) = 0; diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index a854aec4bd..d04558623c 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -477,10 +477,10 @@ Rect Layer::computeInitialCrop(const sp<const DisplayDevice>& hw) const { return activeCrop; } -gfx::FloatRect Layer::computeCrop(const sp<const DisplayDevice>& hw) const { +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. This is in buffer space. - gfx::FloatRect crop = getContentCrop().toFloatRect(); + FloatRect crop = getContentCrop().toFloatRect(); // In addition there is a WM-specified crop we pull from our drawing state. const State& s(getDrawingState()); @@ -674,7 +674,7 @@ void Layer::setGeometry( hwcInfo.displayFrame = transformedFrame; } - gfx::FloatRect sourceCrop = computeCrop(displayDevice); + FloatRect sourceCrop = computeCrop(displayDevice); error = hwcLayer->setSourceCrop(sourceCrop); if (error != HWC2::Error::None) { ALOGE("[%s] Failed to set source crop [%.3f, %.3f, %.3f, %.3f]: " @@ -2338,7 +2338,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 gfx::FloatRect& crop = hwcInfo.sourceCrop; + const FloatRect& crop = hwcInfo.sourceCrop; result.appendFormat("%6.1f %6.1f %6.1f %6.1f\n", crop.left, crop.top, crop.right, crop.bottom); diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h index 8227daec8d..c578e077fe 100644 --- a/services/surfaceflinger/Layer.h +++ b/services/surfaceflinger/Layer.h @@ -27,8 +27,6 @@ #include <utils/String8.h> #include <utils/Timers.h> -#include <gfx/FloatRect.h> - #include <ui/FrameStats.h> #include <ui/GraphicBuffer.h> #include <ui/PixelFormat.h> @@ -513,7 +511,7 @@ private: uint32_t getEffectiveUsage(uint32_t usage) const; - gfx::FloatRect computeCrop(const sp<const DisplayDevice>& hw) const; + FloatRect computeCrop(const sp<const DisplayDevice>& hw) 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. Returns in screen space. @@ -694,7 +692,7 @@ private: HWC2::Composition compositionType; bool clearClientTarget; Rect displayFrame; - gfx::FloatRect sourceCrop; + FloatRect sourceCrop; }; std::unordered_map<int32_t, HWCInfo> mHwcLayers; |