#ifndef GPU_COMMAND_BUFFER_SERVICE_SHARED_IMAGE_SHARED_IMAGE_REPRESENTATION_H_
#define GPU_COMMAND_BUFFER_SERVICE_SHARED_IMAGE_SHARED_IMAGE_REPRESENTATION_H_
#include <dawn/dawn_proc_table.h>
#include <dawn/webgpu_cpp.h>
#include <memory>
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/raw_ptr_exclusion.h"
#include "base/memory/scoped_refptr.h"
#include "base/types/pass_key.h"
#include "build/build_config.h"
#include "gpu/command_buffer/common/shared_image_usage.h"
#include "gpu/command_buffer/service/shared_image/shared_image_backing.h"
#include "gpu/command_buffer/service/shared_image/shared_image_manager.h"
#include "gpu/gpu_gles2_export.h"
#include "gpu/vulkan/buildflags.h"
#include "skia/buildflags.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/GrDirectContext.h"
#include "third_party/skia/include/gpu/ganesh/SkImageGanesh.h"
#include "third_party/skia/include/gpu/graphite/BackendTexture.h"
#include "third_party/skia/include/private/chromium/GrPromiseImageTexture.h"
#include "ui/gfx/color_space.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/gpu_fence.h"
#if BUILDFLAG(ENABLE_VULKAN)
#include <vulkan/vulkan_core.h>
namespace gpu {
class VulkanDeviceQueue;
class VulkanImage;
class VulkanImplementation;
}
#endif
#if BUILDFLAG(IS_WIN)
#include "ui/gl/dc_layer_overlay_image.h"
#endif
#if BUILDFLAG(IS_APPLE)
#include "ui/gfx/mac/io_surface.h"
#endif
#if BUILDFLAG(IS_ANDROID)
#include "base/android/scoped_hardware_buffer_fence_sync.h"
extern "C" typedef struct AHardwareBuffer AHardwareBuffer;
#endif
#if BUILDFLAG(IS_WIN)
#include <d3d11.h>
#include <wrl/client.h>
#endif
GLenum;
namespace skgpu {
class MutableTextureState;
}
namespace cc {
class PaintOpBuffer;
}
namespace gfx {
class NativePixmap;
}
namespace gpu {
class TextureBase;
namespace gles2 {
class Texture;
class TexturePassthrough;
}
enum class RepresentationAccessMode { … };
class GPU_GLES2_EXPORT SharedImageRepresentation { … };
class SharedImageRepresentationFactoryRef : public SharedImageRepresentation { … };
class GPU_GLES2_EXPORT GLTextureImageRepresentationBase
: public SharedImageRepresentation { … };
class GPU_GLES2_EXPORT GLTextureImageRepresentation
: public GLTextureImageRepresentationBase { … };
class GPU_GLES2_EXPORT GLTexturePassthroughImageRepresentation
: public GLTextureImageRepresentationBase { … };
class GPU_GLES2_EXPORT SkiaImageRepresentation
: public SharedImageRepresentation { … };
class GPU_GLES2_EXPORT SkiaGaneshImageRepresentation
: public SkiaImageRepresentation { … };
class GPU_GLES2_EXPORT SkiaGraphiteImageRepresentation
: public SkiaImageRepresentation { … };
class GPU_GLES2_EXPORT DawnImageRepresentation
: public SharedImageRepresentation { … };
class GPU_GLES2_EXPORT OverlayImageRepresentation
: public SharedImageRepresentation { … };
#if BUILDFLAG(IS_ANDROID)
class GPU_GLES2_EXPORT LegacyOverlayImageRepresentation
: public SharedImageRepresentation {
public:
LegacyOverlayImageRepresentation(SharedImageManager* manager,
SharedImageBacking* backing,
MemoryTypeTracker* tracker)
: SharedImageRepresentation(manager, backing, tracker) {}
virtual void RenderToOverlay() = 0;
virtual void NotifyOverlayPromotion(bool promotion,
const gfx::Rect& bounds) = 0;
};
#endif
class GPU_GLES2_EXPORT MemoryImageRepresentation
: public SharedImageRepresentation { … };
class GPU_GLES2_EXPORT RasterImageRepresentation
: public SharedImageRepresentation { … };
class GPU_GLES2_EXPORT VideoImageRepresentation
: public SharedImageRepresentation { … };
#if BUILDFLAG(ENABLE_VULKAN)
class GPU_GLES2_EXPORT VulkanImageRepresentation
: public SharedImageRepresentation { … };
#endif
}
#endif