DSDisplayArea: remove setPosition and setSize 00/241700/1
authorSooChan Lim <sc1.lim@samsung.com>
Fri, 31 Jul 2020 04:55:09 +0000 (13:55 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Thu, 20 Aug 2020 10:05:00 +0000 (19:05 +0900)
These methods do not support at this time.
The size and position of the DisplayArea is determined by DSOutput.

Change-Id: Ic69ce8fa1e9f593a29e23ce9647450e6d76ec486

samples/exampleCompositor.cpp
src/DSDisplayArea/DSDisplayArea.cpp
src/DSDisplayArea/DSDisplayArea.h
src/DSDisplayArea/DSDisplayAreaPrivate.h
tests/DSDisplayArea-test.cpp

index 5833c2b..438c642 100644 (file)
@@ -82,8 +82,6 @@ public:
 
                // make a display area.
                __displayArea = std::make_shared<DSDisplayArea>(output);
-               __displayArea->setPosition(0, 0);
-               __displayArea->setSize(output->getResolutionWidth(), output->getResolutionHeight());
        }
 
        void _onOutputRemoved(std::shared_ptr<IDSOutput> output) override
index c97da10..1bef4c2 100644 (file)
@@ -13,26 +13,6 @@ DSDisplayArea::DSDisplayArea(std::shared_ptr<IDSOutput> output)
 DSDisplayArea::~DSDisplayArea()
 {}
 
-bool DSDisplayArea::setPosition(int x, int y)
-{
-       DS_GET_PRIV(DSDisplayArea);
-
-       if (!priv->setPosition(x, y))
-               return false;
-
-       return true;
-}
-
-bool DSDisplayArea::setSize(int width, int height)
-{
-       DS_GET_PRIV(DSDisplayArea);
-
-       if (!priv->setSize(width, height))
-               return false;
-
-       return true;
-}
-
 int DSDisplayArea::getWidth()
 {
        DS_GET_PRIV(DSDisplayArea);
@@ -87,27 +67,15 @@ DSDisplayAreaPrivate::DSDisplayAreaPrivate(DSDisplayArea *p_ptr, std::shared_ptr
 
        // add idle enterer event on __onEventIdleEnterer for rendereing and displaying
        DSEventLoop::addIdleEnterer(this, __onEventIdleEnterer);
+
+       // The size of DSDisplayArea is the one of DSOutput
+       __width = outputImpl->getResolutionWidth();
+       __height = outputImpl->getResolutionWidth();
 }
 
 DSDisplayAreaPrivate::~DSDisplayAreaPrivate()
 {}
 
-bool DSDisplayAreaPrivate::setPosition(int x, int y)
-{
-       __x = x;
-       __y = y;
-
-       return true;
-}
-
-bool DSDisplayAreaPrivate::setSize(int width, int height)
-{
-       __width = width;
-       __height = height;
-
-       return true;
-}
-
 int DSDisplayAreaPrivate::getWidth()
 {
        if (__output == nullptr)
index 84543c4..d644cdc 100644 (file)
@@ -17,8 +17,6 @@ public:
        explicit DSDisplayArea(std::shared_ptr<IDSOutput> output);
        virtual ~DSDisplayArea();
 
-       bool setPosition(int x, int y);
-       bool setSize(int width, int height);
        int getWidth();
        int getHeight();
        std::shared_ptr<IDSOutput> getOutput();
index 8022219..b062987 100644 (file)
@@ -23,8 +23,6 @@ public:
        virtual ~DSDisplayAreaPrivate();
 
        static DSDisplayAreaPrivate *getPrivate(DSDisplayArea *q) { return q->__d_func(); }
-       bool setPosition(int x, int y);
-       bool setSize(int width, int height);
        int getWidth();
        int getHeight();
 
index 7fda1a5..da2ba5e 100644 (file)
@@ -29,6 +29,7 @@ TEST_F(DSDisplayAreaTest, NewDSDisplayArea)
                auto output = std::make_shared<DSOutputImpl>(displayDeviceOutput);
                EXPECT_TRUE(output != nullptr);
                EXPECT_TRUE(output->applyResolutionAuto() == true);
+
                auto displayArea = std::make_shared<DSDisplayArea>(output);
        }
 }
@@ -41,10 +42,9 @@ TEST_F(DSDisplayAreaTest, BasicMethods)
                auto output = std::make_shared<DSOutputImpl>(displayDeviceOutput);
                EXPECT_TRUE(output != nullptr);
                EXPECT_TRUE(output->applyResolutionAuto() == true);
+
                auto displayArea = std::make_shared<DSDisplayArea>(output);
-               EXPECT_TRUE(displayArea->setPosition(0, 0) != 0);
-               EXPECT_TRUE(displayArea->setSize(100, 100) != 0);
-               EXPECT_TRUE(displayArea->getHeight() != 0);
-               EXPECT_TRUE(displayArea->getWidth() != 0);
+               EXPECT_TRUE(displayArea->getHeight() == output->getResolutionWidth());
+               EXPECT_TRUE(displayArea->getWidth() == output->getResolutionHeight());
        }
 }