// Called when a CompositorFrame with a new frame token is provided.
virtual void OnFrameTokenChanged(uint32_t frame_token,
base::TimeTicks activation_time) = 0;
-#if BUILDFLAG(IS_EFL)
- virtual void NotifySwap(const uint32_t texture_id) {}
-#endif
protected:
virtual ~HostFrameSinkClient() {}
HostFrameSinkManager::FrameSinkData& HostFrameSinkManager::FrameSinkData::
operator=(FrameSinkData&& other) = default;
-#if BUILDFLAG(IS_EFL)
-void HostFrameSinkManager::NotifySwap(const uint32_t texture_id,
- const FrameSinkId& frame_sink_id) {
- auto iter = frame_sink_data_map_.find(frame_sink_id);
- if (iter != frame_sink_data_map_.end()) {
- const FrameSinkData& data = iter->second;
- if (data.client)
- data.client->NotifySwap(texture_id);
- }
-}
-#endif
-
} // namespace viz
const bool enable_sync_window_destruction_;
-#if BUILDFLAG(IS_EFL)
- void NotifySwap(const uint32_t texture_id,
- const FrameSinkId& frame_sink_id) override;
-#endif
-
// Connections to/from FrameSinkManagerImpl.
mojo::Remote<mojom::FrameSinkManager> frame_sink_manager_remote_;
// This will point to |frame_sink_manager_remote_| if using mojo or it may
UpdateThrottlingRecursively(id, base::TimeDelta());
}
-#if BUILDFLAG(IS_EFL)
-void FrameSinkManagerImpl::NotifySwap(const uint32_t texture_id,
- const FrameSinkId& id) {
- for (auto child : GetChildrenByParent(id))
- client_->NotifySwap(texture_id, child);
-}
-#endif
-
} // namespace viz
bool VerifySandboxedThreadIds(
base::flat_set<base::PlatformThreadId> thread_ids);
-#if BUILDFLAG(IS_EFL)
- void NotifySwap(const uint32_t texture_id, const FrameSinkId& id);
-#endif
-
private:
friend class FrameSinkManagerTest;
#if BUILDFLAG(IS_EFL)
void RootCompositorFrameSinkImpl::NotifySwap(const uint32_t texture_id) {
- support_->frame_sink_manager()->NotifySwap(texture_id,
- support_->frame_sink_id());
+ if (display_client_)
+ display_client_->NotifySwap(texture_id);
}
#endif
}
#endif
+#if BUILDFLAG(IS_EFL)
+ void NotifySwap(const uint32_t texture_id) override {
+ compositor_->NotifySwap(texture_id);
+ }
+#endif
+
private:
[[maybe_unused]] const raw_ptr<ui::Compositor> compositor_;
};
client_->OnFrameTokenChanged(frame_token, activation_time);
}
-#if BUILDFLAG(IS_EFL)
-void DelegatedFrameHost::NotifySwap(const uint32_t texture_id) {
- client_->NotifySwap(texture_id);
-}
-#endif
-
// CommitPending without a target for TakeFallbackContentFrom. Since we cannot
// guarantee that Navigation will complete, evict our surfaces which are from
// a previous Navigation.
virtual void InvalidateLocalSurfaceIdOnEviction() = 0;
virtual std::vector<viz::SurfaceId> CollectSurfaceIdsForEviction() = 0;
virtual bool ShouldShowStaleContentOnEviction() = 0;
-#if BUILDFLAG(IS_EFL)
- virtual void NotifySwap(const uint32_t texture_id) {}
-#endif
};
// The DelegatedFrameHost is used to host all of the RenderWidgetHostView state
void OnFrameTokenChanged(uint32_t frame_token,
base::TimeTicks activation_time) override;
-#if BUILDFLAG(IS_EFL)
- void NotifySwap(const uint32_t texture_id) override;
-#endif
-
// Public interface exposed to RenderWidgetHostView.
// kOccluded means the native window for the host was
return render_widget_host_view_->ShouldShowStaleContentOnEviction();
}
-#if BUILDFLAG(IS_EFL)
-void DelegatedFrameHostClientAura::NotifySwap(const uint32_t texture_id) {
- render_widget_host_view_->NotifySwap(texture_id);
-}
-#endif
-
} // namespace content
void InvalidateLocalSurfaceIdOnEviction() override;
std::vector<viz::SurfaceId> CollectSurfaceIdsForEviction() override;
bool ShouldShowStaleContentOnEviction() override;
-#if BUILDFLAG(IS_EFL)
- void NotifySwap(const uint32_t texture_id) override;
-#endif
private:
raw_ptr<RenderWidgetHostViewAura> render_widget_host_view_;
offscreen_helper_->BackgroundColorReceived(callback_id, bg_color);
}
-void RenderWidgetHostViewAura::NotifySwap(const uint32_t texture_id) {
- if (offscreen_helper_)
- offscreen_helper_->NotifySwap(texture_id);
-}
-
void RenderWidgetHostViewAura::DidGetContentSnapshot(const SkBitmap& bitmap,
int request_id) {
if (offscreen_helper_)
RWHVAuraOffscreenHelperEfl* offscreen_helper() {
return offscreen_helper_.get();
}
- void NotifySwap(const uint32_t texture_id);
void DidGetContentSnapshot(const SkBitmap& bitmap, int request_id) override;
void DidHandleKeyEvent(blink::WebInputEvent::Type input_event,
bool processed) override;
enabled_features += [ "enable_cast_overlay_strategy" ]
}
if (use_efl) {
- enabled_features += [ "use_efl" ]
+ enabled_features += [ "is_efl" ]
}
cpp_typemaps = [
[EnableIf=is_android]
SetPreferredRefreshRate(float refresh_rate);
+
+ [EnableIf=is_efl]
+ NotifySwap(uint32 texture_id);
};
// when a surface of the provided |frame_sink_id| activates.
OnFrameTokenChanged(FrameSinkId frame_sink_id, uint32 frame_token,
mojo_base.mojom.TimeTicks activation_time);
-
- [EnableIf=use_efl]
- NotifySwap(uint32 texture_id, FrameSinkId frame_sink_id);
};
#include "content/browser/web_contents/web_contents_view_aura.h"
#include "content/public/browser/render_widget_host_helper.h"
#include "content/public/browser/web_contents_delegate.h"
+#include "ecore_x_wayland_wrapper.h"
#include "gpu/command_buffer/service/texture_base.h"
#include "skia/ext/image_operations.h"
#include "tizen/system_info.h"
#include <Ecore_Evas.h>
#include <Ecore_Input.h>
#include <Elementary.h>
-#include "ecore_x_wayland_wrapper.h"
#include "base/callback.h"
#include "base/containers/id_map.h"
--- /dev/null
+// Copyright 2023 Samsung Electronics. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/compositor/compositor_observer_efl.h"
+
+#include "content/browser/renderer_host/render_widget_host_view_aura.h"
+#include "content/public/browser/web_contents.h"
+#include "ui/compositor/compositor.h"
+
+namespace ui {
+
+CompositorObserverEfl::CompositorObserverEfl(ui::Compositor* compositor,
+ content::WebContents* web_contents)
+ : compositor_(compositor), web_contents_(web_contents) {
+ compositor_->AddObserver(this);
+}
+
+CompositorObserverEfl::~CompositorObserverEfl() {
+ if (compositor_)
+ compositor_->RemoveObserver(this);
+}
+
+void CompositorObserverEfl::NotifySwap(const uint32_t texture_id) {
+ auto* rwhva = static_cast<content::RenderWidgetHostViewAura*>(
+ web_contents_->GetRenderWidgetHostView());
+ if (!rwhva || !rwhva->offscreen_helper())
+ return;
+
+ rwhva->offscreen_helper()->NotifySwap(texture_id);
+}
+
+void CompositorObserverEfl::OnCompositingShuttingDown(
+ ui::Compositor* compositor) {
+ DCHECK_EQ(compositor, compositor_);
+ compositor_->RemoveObserver(this);
+ compositor_ = nullptr;
+}
+} // namespace ui
--- /dev/null
+// Copyright 2023 Samsung Electronics. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_COMPOSITOR_COMPOSITOR_OBSERVER_EFL_H_
+#define UI_COMPOSITOR_COMPOSITOR_OBSERVER_EFL_H_
+
+#include "ui/compositor/compositor_export.h"
+#include "ui/compositor/compositor_observer.h"
+
+namespace content {
+class WebContents;
+} // namespace content
+
+namespace ui {
+
+class Compositor;
+
+class COMPOSITOR_EXPORT CompositorObserverEfl : public CompositorObserver {
+ public:
+ CompositorObserverEfl(Compositor* compositor,
+ content::WebContents* web_contents);
+
+ CompositorObserverEfl(const CompositorObserverEfl&) = delete;
+ CompositorObserverEfl& operator=(const CompositorObserverEfl&) = delete;
+
+ ~CompositorObserverEfl() override;
+
+ ui::Compositor* compositor() { return compositor_; }
+
+ private:
+ // ui::CompositorObserver implementation:
+ void NotifySwap(const uint32_t texture_id) override;
+ void OnCompositingShuttingDown(Compositor* compositor) override;
+
+ Compositor* compositor_;
+ content::WebContents* web_contents_;
+};
+
+} // namespace ui
+
+#endif // UI_COMPOSITOR_COMPOSITOR_OBSERVER_EFL_H_
external_ui_accessiblility_platform_sources = [
"//tizen_src/chromium_impl/ui/accessibility/platform/ax_platform_node_efl.cc",
"//tizen_src/chromium_impl/ui/accessibility/platform/ax_platform_node_efl.h",
-]
\ No newline at end of file
+]
+
+external_ui_compositor_sources = [
+ "//tizen_src/chromium_impl/ui/compositor/compositor_observer_efl.cc",
+ "//tizen_src/chromium_impl/ui/compositor/compositor_observer_efl.h",
+]
#include "ui/aura/window.h"
#include "ui/base/clipboard/clipboard_helper_efl.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/compositor/compositor_observer_efl.h"
#include "ui/display/screen.h"
#include "ui/events/event_switches.h"
#include "ui/gfx/geometry/dip_util.h"
context_menu_.reset();
mhtml_callback_map_.Clear();
+ compositor_observer_.reset();
+
// Release manually those scoped pointers to
// make sure they are released in correct order
web_contents_.reset();
std::make_unique<aura::test::TestFocusClient>(host_->window());
window_parenting_client_ =
std::make_unique<aura::test::TestWindowParentingClient>(host_->window());
+ compositor_observer_ = std::make_unique<ui::CompositorObserverEfl>(
+ host_->compositor(), web_contents_.get());
aura::Window* content = web_contents_->GetNativeView();
aura::Window* parent = host_->window();
std::unique_ptr<aura::WindowTreeHost> host_;
std::unique_ptr<aura::client::FocusClient> focus_client_;
std::unique_ptr<aura::client::WindowParentingClient> window_parenting_client_;
+ std::unique_ptr<ui::CompositorObserver> compositor_observer_;
content::DateTimeChooserEfl* date_time_chooser_ = nullptr;
#if defined(TIZEN_ATK_SUPPORT)
import("//build/config/ui.gni")
import("//testing/test.gni")
+if (use_efl) {
+ import("//tizen_src/chromium_impl/ui/ui_efl.gni")
+}
+
component("compositor") {
sources = [
"animation_throughput_reporter.cc",
]
}
+ if (use_efl) {
+ sources += external_ui_compositor_sources
+ }
+
defines = [ "COMPOSITOR_IMPLEMENTATION" ]
public_deps = [ "//cc" ]
}
#endif
+#if BUILDFLAG(IS_EFL)
+void Compositor::NotifySwap(const uint32_t texture_id) {
+ for (auto& observer : observer_list_)
+ observer.NotifySwap(texture_id);
+}
+#endif
+
void Compositor::SetOutputIsSecure(bool output_is_secure) {
output_is_secure_ = output_is_secure;
if (display_private_)
void OnCompleteSwapWithNewSize(const gfx::Size& size);
#endif
+#if BUILDFLAG(IS_EFL)
+ void NotifySwap(const uint32_t texture_id);
+#endif
+
bool IsLocked() { return lock_manager_.IsLocked(); }
void SetOutputIsSecure(bool output_is_secure);
const gfx::Size& size) {}
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+#if BUILDFLAG(IS_EFL)
+ virtual void NotifySwap(const uint32_t texture_id) {}
+#endif
+
// Called at the top of the compositor's destructor, to give observers a
// chance to remove themselves.
virtual void OnCompositingShuttingDown(Compositor* compositor) {}