#include "gpu/ipc/client/image_decode_accelerator_proxy.h"
#include <memory>
#include <utility>
#include <vector>
#include "base/check_op.h"
#include "base/containers/contains.h"
#include "base/notreached.h"
#include "base/ranges/algorithm.h"
#include "cc/paint/paint_image.h"
#include "gpu/command_buffer/common/constants.h"
#include "gpu/config/gpu_info.h"
#include "gpu/ipc/client/gpu_channel_host.h"
#include "gpu/ipc/common/command_buffer_id.h"
#include "gpu/ipc/common/gpu_channel.mojom.h"
#include "ui/gfx/color_space.h"
#include "ui/gfx/geometry/size.h"
namespace gpu {
namespace {
bool IsSupportedImageSize(
const cc::ImageHeaderMetadata* image_data,
const ImageDecodeAcceleratorSupportedProfile& supported_profile) { … }
bool IsSupportedJpegImage(
const cc::ImageHeaderMetadata* image_data,
const ImageDecodeAcceleratorSupportedProfile& supported_profile) { … }
}
ImageDecodeAcceleratorProxy::ImageDecodeAcceleratorProxy(GpuChannelHost* host,
int32_t route_id)
: … { … }
ImageDecodeAcceleratorProxy::~ImageDecodeAcceleratorProxy() { … }
bool ImageDecodeAcceleratorProxy::IsImageSupported(
const cc::ImageHeaderMetadata* image_metadata) const { … }
bool ImageDecodeAcceleratorProxy::IsJpegDecodeAccelerationSupported() const { … }
bool ImageDecodeAcceleratorProxy::IsWebPDecodeAccelerationSupported() const { … }
SyncToken ImageDecodeAcceleratorProxy::ScheduleImageDecode(
base::span<const uint8_t> encoded_data,
const gfx::Size& output_size,
CommandBufferId raster_decoder_command_buffer_id,
uint32_t transfer_cache_entry_id,
int32_t discardable_handle_shm_id,
uint32_t discardable_handle_shm_offset,
uint64_t discardable_handle_release_count,
const gfx::ColorSpace& target_color_space,
bool needs_mips) { … }
}