Move window context 49/225549/3
authorhyunho <hhstark.kang@samsung.com>
Fri, 21 Feb 2020 01:33:07 +0000 (10:33 +0900)
committerhyunho <hhstark.kang@samsung.com>
Fri, 21 Feb 2020 01:42:44 +0000 (10:42 +0900)
Change-Id: Ie75f1a8c4a160bbfb554f82e8c3b7f9f0469af3a
Signed-off-by: hyunho <hhstark.kang@samsung.com>
screen_connector_remote_surface_evas/remote_surface_evas.cc
screen_connector_remote_surface_evas/remote_surface_evas.h
screen_connector_remote_surface_evas/remote_surface_evas_implementation.h

index c305d37..008ec9a 100644 (file)
@@ -24,6 +24,7 @@
 #include "screen_connector_remote_surface_evas/remote_surface_evas_implementation.h"
 #include "screen_connector_remote_surface_evas/image_mock_internal.h"
 #include "screen_connector_remote_surface_evas/util.h"
+#include "screen_connector_remote_surface/window_context.h"
 
 #ifdef LOG_TAG
 #undef LOG_TAG
@@ -39,8 +40,7 @@ RemoteSurfaceEvas::RemoteSurfaceEvas(const std::string& id,
                                      std::shared_ptr<EvasObject> viewerWin,
                                      bool mock)
     : RemoteSurface(id, type, util::GetWlSurface(*viewerWin.get()), mock),
-      impl_(new Impl(this, viewerWin, mock)),
-      win_ctx_(new WindowContext()) {
+      impl_(new Impl(this, viewerWin, mock)) {
 }
 
 RemoteSurfaceEvas::RemoteSurfaceEvas(int rid, const std::string& id,
@@ -48,8 +48,7 @@ RemoteSurfaceEvas::RemoteSurfaceEvas(int rid, const std::string& id,
                                      std::shared_ptr<EvasObject> viewerWin,
                                      bool mock)
     : RemoteSurface(rid, id, type, util::GetWlSurface(*viewerWin.get()), mock),
-      impl_(new Impl(this, viewerWin, mock)),
-      win_ctx_(new WindowContext()) {
+      impl_(new Impl(this, viewerWin, mock)) {
 }
 
 RemoteSurfaceEvas::~RemoteSurfaceEvas() {
@@ -61,7 +60,7 @@ RemoteSurfaceEvas& RemoteSurfaceEvas::operator=(
 
 RemoteSurfaceEvas::Impl::Impl(RemoteSurfaceEvas* parent,
     std::shared_ptr<EvasObject> viewerWin, bool mock)
-    : viewer_win_(viewerWin), parent_(parent), mock_(mock) {
+    : viewer_win_(viewerWin), parent_(parent), mock_(mock), win_ctx_(new WindowContext()) {
 }
 
 void RemoteSurfaceEvas::Impl::OnMouseIn(const EvasObject& obj,
@@ -408,7 +407,7 @@ void RemoteSurfaceEvas::Impl::OnMove(const EvasObject& obj, void *eventInfo) {
   window = ecore_evas_wayland2_window_get(ee);
 
   unsigned int win_id = ecore_wl2_window_id_get(window);
-  if (parent_->IsVisibleArea() && !parent_->win_ctx_->IsFullyObscured(win_id)) {
+  if (parent_->IsVisibleArea() && !parent_->impl_->win_ctx_->IsFullyObscured(win_id)) {
     parent_->SendVisibility(true);
     visibility_ = RemoteSurfaceEvas::UNOBSCURED;
   } else {
@@ -657,12 +656,12 @@ RemoteSurfaceEvas::Visibility RemoteSurfaceEvas::GetVisibility() const {
 
 RemoteSurfaceEvas::Visibility RemoteSurfaceEvas::GetVisibility(
     unsigned int win) {
-  if (!win_ctx_->FindWindow(win)) {
+  if (!impl_->win_ctx_->FindWindow(win)) {
     LOGE("Failed to find window(%u)", win);
     return RemoteSurfaceEvas::UNKNOWN;
   }
 
-  if (win_ctx_->IsFullyObscured(win))
+  if (impl_->win_ctx_->IsFullyObscured(win))
     return RemoteSurfaceEvas::FULLY_OBSCURED;
 
   return RemoteSurfaceEvas::UNOBSCURED;
index 6e2a902..df4a3cf 100644 (file)
@@ -24,7 +24,7 @@
 #include "screen_connector_remote_surface_evas/evas_object.h"
 #include "screen_connector_remote_surface_evas/evas_event_interface.h"
 #include "screen_connector_remote_surface/remote_surface.h"
-#include "screen_connector_remote_surface/window_context.h"
+
 
 namespace screen_connector {
 
@@ -80,7 +80,6 @@ class EXPORT_API RemoteSurfaceEvas : public RemoteSurface, public IEvasEvent {
  private:
   class Impl;
   std::unique_ptr<Impl> impl_;
-  std::unique_ptr<WindowContext> win_ctx_;
 };
 
 }  // namespace screen_connector
index 50314bd..7280aee 100644 (file)
@@ -25,6 +25,7 @@
 #include "screen_connector_remote_surface/remote_surface.h"
 #include "screen_connector_remote_surface_evas/remote_surface_evas.h"
 #include "screen_connector_remote_surface_evas/image_internal.h"
+#include "screen_connector_remote_surface/window_context.h"
 
 namespace screen_connector {
 
@@ -65,6 +66,7 @@ class RemoteSurfaceEvas::Impl : public Image::IEventListener {
   bool auto_visibility_ = true;
   int no_render_timer_ = 0;
   bool mock_;
+  std::unique_ptr<WindowContext> win_ctx_;
 };
 
 }  // namespace screen_connector