#ifndef ASH_FAST_INK_VIEW_TREE_HOST_ROOT_VIEW_H_
#define ASH_FAST_INK_VIEW_TREE_HOST_ROOT_VIEW_H_
#include <memory>
#include <vector>
#include "ash/ash_export.h"
#include "ash/frame_sink/frame_sink_host.h"
#include "base/memory/weak_ptr.h"
#include "ui/views/widget/root_view.h"
namespace views {
class Widget;
}
namespace viz {
class CompositorFrame;
}
namespace gfx {
class Size;
class Rect;
}
namespace ash {
class ViewTreeHostRootViewFrameFactory;
class ASH_EXPORT ViewTreeHostRootView : public views::internal::RootView,
public ash::FrameSinkHost {
public:
explicit ViewTreeHostRootView(views::Widget* widget);
ViewTreeHostRootView(const ViewTreeHostRootView&) = delete;
ViewTreeHostRootView& operator=(const ViewTreeHostRootView&) = delete;
~ViewTreeHostRootView() override;
void SchedulePaintInRect(const gfx::Rect& damage_rect);
bool GetIsOverlayCandidate();
void SetIsOverlayCandidate(bool is_overlay_candidate);
std::unique_ptr<viz::CompositorFrame> CreateCompositorFrame(
const viz::BeginFrameAck& begin_frame_ack,
UiResourceManager& resource_manager,
bool auto_update,
const gfx::Size& last_submitted_frame_size,
float last_submitted_frame_dsf) override;
private:
bool is_overlay_candidate_ = true;
std::unique_ptr<ViewTreeHostRootViewFrameFactory> frame_factory_;
base::WeakPtrFactory<ViewTreeHostRootView> weak_ptr_factory_{this};
};
}
#endif