#include "gpu/command_buffer/service/shared_image/dawn_fallback_image_representation.h"
#include <dawn/native/DawnNative.h>
#include "base/bits.h"
#include "base/synchronization/atomic_flag.h"
#include "base/threading/platform_thread.h"
#include "components/viz/common/resources/shared_image_format_utils.h"
#include "gpu/command_buffer/common/shared_image_usage.h"
#include "gpu/command_buffer/service/shared_image/shared_image_format_service_utils.h"
#include "gpu/config/gpu_finch_features.h"
#include "ui/gfx/geometry/skia_conversions.h"
namespace gpu {
DawnFallbackImageRepresentation::DawnFallbackImageRepresentation(
SharedImageManager* manager,
SharedImageBacking* backing,
MemoryTypeTracker* tracker,
wgpu::Device device,
wgpu::TextureFormat wgpu_format,
std::vector<wgpu::TextureFormat> view_formats)
: … { … }
DawnFallbackImageRepresentation::~DawnFallbackImageRepresentation() = default;
bool DawnFallbackImageRepresentation::ComputeStagingBufferParams(
int plane_index,
uint32_t* bytes_per_row,
size_t* bytes_per_plane) const { … }
bool DawnFallbackImageRepresentation::AllocateStagingBuffers(
wgpu::BufferUsage usage,
bool map_at_creation,
std::vector<StagingBuffer>* buffers) { … }
SkPixmap DawnFallbackImageRepresentation::MappedStagingBufferToPixmap(
const StagingBuffer& staging_buffer,
int plane_index,
bool writable) { … }
bool DawnFallbackImageRepresentation::ReadbackFromBacking() { … }
bool DawnFallbackImageRepresentation::UploadToBacking() { … }
wgpu::Texture DawnFallbackImageRepresentation::BeginAccess(
wgpu::TextureUsage wgpu_texture_usage,
wgpu::TextureUsage internal_usage) { … }
void DawnFallbackImageRepresentation::EndAccess() { … }
}