From 995da2a3ddef88d18076ec3ee8da6bc4a7109a07 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Thu, 30 Jul 2020 19:15:47 +0900 Subject: [PATCH] DSDisplayArea: get the IDisplayDeviceOutput DSDisplayAreaPrivate gets - IDSDisplayDeviceOutput from DSOutputImpl - IDSDisplayDeivceHWC from IDSDisplayDeviceOutput - IDSBufferQueue from IDSDisplayDeivceHWC Change-Id: Ifb2b7576d425a7639e0441fc52ac110e3a4b4eb6 --- src/DSDisplayArea/DSDisplayArea.cpp | 13 ++++++++++++- src/DSDisplayArea/DSDisplayAreaPrivate.h | 4 ++++ src/DSOutput/DSOutputImpl.cpp | 11 ----------- src/DSOutput/DSOutputImpl.h | 1 - 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/DSDisplayArea/DSDisplayArea.cpp b/src/DSDisplayArea/DSDisplayArea.cpp index ca65a8e..29e0e42 100644 --- a/src/DSDisplayArea/DSDisplayArea.cpp +++ b/src/DSDisplayArea/DSDisplayArea.cpp @@ -58,6 +58,8 @@ DSDisplayAreaPrivate::DSDisplayAreaPrivate(DSDisplayArea *p_ptr, std::shared_ptr : DSObjectPrivate(p_ptr), __p_ptr(p_ptr), __output(output), + __displayDeviceOutput(nullptr), + __displayDeviceHWC(nullptr), __zone(nullptr), __renderEngine(nullptr), __x(0), @@ -66,7 +68,16 @@ DSDisplayAreaPrivate::DSDisplayAreaPrivate(DSDisplayArea *p_ptr, std::shared_ptr __height(0) { auto outputImpl = std::dynamic_pointer_cast(output); // down-casting of std::shared_ptr - auto bufferQueue = outputImpl->getDisplayBufferQueue(); + + __displayDeviceOutput = outputImpl->getDisplayDeviceOutput(); + if (!__displayDeviceOutput) + DSLOG_ERR("DSCanvasPrivate", "__displayDeviceOutput is null."); + + __displayDeviceHWC = __displayDeviceOutput->getHWC(); + if (!__displayDeviceHWC) + DSLOG_ERR("DSCanvasPrivate", "__displayDeviceHWC is null."); + + auto bufferQueue = __displayDeviceHWC->getTargetBufferQueue(); if (!bufferQueue) DSLOG_ERR("DSDisplayAreaPrivate", "bufferQueue is null."); diff --git a/src/DSDisplayArea/DSDisplayAreaPrivate.h b/src/DSDisplayArea/DSDisplayAreaPrivate.h index b112f03..c19910c 100644 --- a/src/DSDisplayArea/DSDisplayAreaPrivate.h +++ b/src/DSDisplayArea/DSDisplayAreaPrivate.h @@ -6,6 +6,8 @@ #include "DSZone.h" #include "IDSRenderEngine.h" #include +#include "IDSDisplayDeviceOutput.h" +#include "IDSDisplayDeviceHWC.h" #include namespace display_server @@ -33,6 +35,8 @@ private: void __onWindowCreated(std::shared_ptr window); std::shared_ptr __output; + std::shared_ptr __displayDeviceOutput; + std::shared_ptr __displayDeviceHWC; std::shared_ptr __zone; std::shared_ptr __renderEngine; int __x, __y; diff --git a/src/DSOutput/DSOutputImpl.cpp b/src/DSOutput/DSOutputImpl.cpp index b97d6d4..b51dbd4 100644 --- a/src/DSOutput/DSOutputImpl.cpp +++ b/src/DSOutput/DSOutputImpl.cpp @@ -55,15 +55,4 @@ std::shared_ptr DSOutputImpl::getDisplayDeviceOutput() return __displayDeviceOutput; } -std::shared_ptr DSOutputImpl::getDisplayBufferQueue() -{ - std::shared_ptr displayDeviceHWC = __displayDeviceOutput->getHWC(); - if (!displayDeviceHWC) { - DSLOG_ERR("DSOutputImpl", "displayDeviceHWC is NULL."); - return nullptr; - } - - return displayDeviceHWC->getTargetBufferQueue(); -} - } // namespace display_server diff --git a/src/DSOutput/DSOutputImpl.h b/src/DSOutput/DSOutputImpl.h index b0792ff..de0eb85 100644 --- a/src/DSOutput/DSOutputImpl.h +++ b/src/DSOutput/DSOutputImpl.h @@ -18,7 +18,6 @@ public: bool applyResolutionAuto() override; std::shared_ptr getDisplayDeviceOutput(); - std::shared_ptr getDisplayBufferQueue(); private: int __resolutionWidth; -- 2.7.4