#ifndef ASH_FRAME_SINK_UI_RESOURCE_H_
#define ASH_FRAME_SINK_UI_RESOURCE_H_
#include "ash/ash_export.h"
#include "components/viz/common/gpu/raster_context_provider.h"
#include "components/viz/common/resources/resource_id.h"
#include "components/viz/common/resources/shared_image_format.h"
#include "gpu/command_buffer/client/client_shared_image.h"
#include "gpu/command_buffer/common/mailbox.h"
#include "gpu/command_buffer/common/sync_token.h"
#include "ui/gfx/geometry/size.h"
namespace ash {
using UiSourceId = uint32_t;
inline constexpr UiSourceId kInvalidUiSourceId(0u);
class ASH_EXPORT UiResource {
public:
UiResource(scoped_refptr<gpu::SharedImageInterface> sii,
scoped_refptr<gpu::ClientSharedImage> shared_image);
UiResource(const UiResource&) = delete;
UiResource& operator=(const UiResource&) = delete;
virtual ~UiResource();
const scoped_refptr<gpu::ClientSharedImage>& client_shared_image() const {
return client_shared_image_;
}
scoped_refptr<gpu::SharedImageInterface> shared_image_interface;
gpu::SyncToken sync_token;
gfx::Size resource_size;
UiSourceId ui_source_id = kInvalidUiSourceId;
bool is_overlay_candidate = false;
bool damaged = true;
private:
scoped_refptr<gpu::ClientSharedImage> client_shared_image_;
};
}
#endif