This commit does the following to fix the crashes.
1. Creates viz::HostFrameSinkManager and viz::FrameSinkManagerImpl
2. Sets up a connection between viz::HostFrameSinkManager and
viz::FrameSinkManagerImpl without using Mojo
3. Makes RWHVEfl a viz::HostFrameSinkClient and registers its
viz::FrameSinkId
Reference: https://review.tizen.org/gerrit/232406/
Change-Id: I6c69ea29a151186f71c55b08818c4036db3c0a4d
Signed-off-by: Chandan Padhi <c.padhi@samsung.com>
#include "mojo/public/cpp/bindings/lib/test_random_mojo_delays.h"
#endif
+#if defined(USE_EFL)
+#include "components/viz/service/display_embedder/server_shared_bitmap_manager.h"
+#include "components/viz/service/frame_sinks/frame_sink_manager_impl.h"
+#endif
+
// One of the linux specific headers defines this as a macro.
#ifdef DestroyAll
#undef DestroyAll
#if !defined(OS_ANDROID)
host_frame_sink_manager_.reset();
+#endif
+
+#if !defined(OS_ANDROID) && !defined(USE_EFL)
compositing_mode_reporter_impl_.reset();
#endif
always_uses_gpu = ShouldStartGpuProcessOnBrowserStartup();
BrowserGpuChannelHostFactory::Initialize(established_gpu_channel);
#elif defined(USE_EFL)
+ shared_bitmap_manager_ = std::make_unique<viz::ServerSharedBitmapManager>();
+ frame_sink_manager_ =
+ std::make_unique<viz::FrameSinkManagerImpl>(shared_bitmap_manager_.get());
+ host_frame_sink_manager_ = std::make_unique<viz::HostFrameSinkManager>();
BrowserGpuChannelHostFactory::Initialize(established_gpu_channel);
+
+ // Directly connect without using Mojo.
+ frame_sink_manager_->SetLocalClient(host_frame_sink_manager_.get());
+ host_frame_sink_manager_->SetLocalManager(frame_sink_manager_.get());
#else
established_gpu_channel = true;
if (parsed_command_line_.HasSwitch(switches::kDisableGpu) ||
namespace viz {
class CompositingModeReporterImpl;
class HostFrameSinkManager;
+#if defined(USE_EFL)
+class FrameSinkManagerImpl;
+class ServerSharedBitmapManager;
+#endif
} // namespace viz
namespace content {
scoped_refptr<SaveFileManager> save_file_manager_;
std::unique_ptr<content::TracingControllerImpl> tracing_controller_;
scoped_refptr<responsiveness::Watcher> responsiveness_watcher_;
+
+#if defined(USE_EFL)
+ std::unique_ptr<viz::ServerSharedBitmapManager> shared_bitmap_manager_;
+ std::unique_ptr<viz::FrameSinkManagerImpl> frame_sink_manager_;
+#endif
+
#if !defined(OS_ANDROID)
std::unique_ptr<viz::HostFrameSinkManager> host_frame_sink_manager_;
+#endif
+#if !defined(OS_ANDROID) && !defined(USE_EFL)
// Reports on the compositing mode in the system for clients to submit
// resources of the right type. This is null if the display compositor
// is not in this process.
#include "ui/compositor/compositor.h" // nogncheck
#endif
+#if defined(USE_EFL)
+#include "content/browser/browser_main_loop.h"
+#endif
+
namespace content {
viz::FrameSinkId AllocateFrameSinkId() {
#if defined(OS_ANDROID)
return CompositorDependenciesAndroid::Get().host_frame_sink_manager();
#elif defined(USE_EFL)
- return nullptr;
+ return BrowserMainLoop::GetInstance()->host_frame_sink_manager();
#else
ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
if (!factory)
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/trace_event/trace_event.h"
+#include "components/viz/host/host_frame_sink_manager.h"
+#include "content/browser/compositor/surface_utils.h"
#include "content/browser/renderer_host/disambiguation_popup_efl.h"
#include "content/browser/renderer_host/display_util.h"
#include "content/browser/renderer_host/edge_effect.h"
device_scale_factor_(1.0f),
magnifier_(false),
is_loading_(false),
+ frame_sink_id_(host()->GetFrameSinkId()),
gesture_recognizer_(std::make_unique<ui::GestureRecognizerImpl>()),
current_orientation_(0),
evas_gl_(NULL),
device_scale_factor_ =
display::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor();
- host_->SetView(this);
+ host()->SetView(this);
static bool scale_factor_initialized = false;
if (!scale_factor_initialized) {
}
gesture_recognizer_->AddGestureEventHelper(this);
+
+ GetHostFrameSinkManager()->RegisterFrameSinkId(
+ frame_sink_id_, this, viz::ReportFirstSurfaceActivation::kNo);
}
void RenderWidgetHostViewEfl::InitAsChild(gfx::NativeView /* parent_view */) {
return handled;
}
+void RenderWidgetHostViewEfl::OnFirstSurfaceActivation(
+ const viz::SurfaceInfo& surface_info) {}
+
+void RenderWidgetHostViewEfl::OnFrameTokenChanged(uint32_t frame_token) {}
+
bool RenderWidgetHostViewEfl::Send(IPC::Message* message) {
return host_->Send(message);
}
}
const viz::FrameSinkId& RenderWidgetHostViewEfl::GetFrameSinkId() const {
- return viz::FrameSinkId();
+ return frame_sink_id_;
}
const viz::LocalSurfaceIdAllocation&
#include "components/viz/common/frame_sinks/copy_output_result.h"
#include "components/viz/common/quads/compositor_frame.h"
#include "components/viz/common/resources/single_release_callback.h"
+#include "components/viz/host/host_frame_sink_client.h"
#include "content/browser/accessibility/browser_accessibility_manager.h"
#include "content/browser/compositor/evasgl_delegated_frame_host.h"
#include "content/browser/renderer_host/evas_event_handler.h"
public ui::GestureConsumer,
public ui::GestureEventHelper,
public base::SupportsWeakPtr<RenderWidgetHostViewEfl>,
+ public viz::HostFrameSinkClient,
public IPC::Sender {
public:
explicit RenderWidgetHostViewEfl(RenderWidgetHost*,
void DispatchGestureEvent(GestureConsumer* raw_input_consumer,
ui::GestureEvent*) override;
+ // viz::HostFrameSinkClient implementation.
+ void OnFirstSurfaceActivation(const viz::SurfaceInfo& surface_info) override;
+ void OnFrameTokenChanged(uint32_t frame_token) override;
+
// IPC::Sender implementation:
bool Send(IPC::Message*) override;
scoped_refptr<EvasEventHandler> evas_event_handler_;
+ const viz::FrameSinkId frame_sink_id_;
+
// Stores the current state of the active pointers targeting this
// object.
ui::MotionEventAura pointer_state_;