Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a423eaa authored by Dan Stoza's avatar Dan Stoza
Browse files

Move FloatRect from libgfx to libui

Moves FloatRect from libgfx (which is being disintegrated) to libui

Test: Builds and sailfish boots
Change-Id: I68c1b7d86a363066fe4d6f0c038ca9d92d7ab9c7
parent ff70fd8e
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
#pragma once

namespace android {
namespace gfx {

class FloatRect {
public:
@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -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)};
    }
+2 −3
Original line number Diff line number Diff line
@@ -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;

+2 −4
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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 {
Loading