#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/platform/graphics/image_frame_generator.h"
#include <memory>
#include <utility>
#include "base/not_fatal_until.h"
#include "base/synchronization/lock.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/renderer/platform/graphics/image_decoder_wrapper.h"
#include "third_party/blink/renderer/platform/graphics/image_decoding_store.h"
#include "third_party/blink/renderer/platform/image-decoders/image_decoder.h"
#include "third_party/blink/renderer/platform/instrumentation/histogram.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "third_party/skia/include/core/SkData.h"
namespace blink {
SkYUVAInfo::Subsampling SubsamplingToSkiaSubsampling(
cc::YUVSubsampling subsampling) { … }
static bool UpdateYUVAInfoSubsamplingAndWidthBytes(
ImageDecoder* decoder,
SkYUVAInfo::Subsampling* subsampling,
size_t component_width_bytes[SkYUVAInfo::kMaxPlanes]) { … }
ImageFrameGenerator::ImageFrameGenerator(const SkISize& full_size,
bool is_multi_frame,
ColorBehavior color_behavior,
cc::AuxImage aux_image,
Vector<SkISize> supported_sizes)
: … { … }
ImageFrameGenerator::~ImageFrameGenerator() { … }
bool ImageFrameGenerator::DecodeAndScale(
SegmentReader* data,
bool all_data_received,
wtf_size_t index,
const SkPixmap& pixmap,
cc::PaintImage::GeneratorClientId client_id) { … }
bool ImageFrameGenerator::DecodeToYUV(
SegmentReader* data,
wtf_size_t index,
SkColorType color_type,
const SkISize component_sizes[cc::kNumYUVPlanes],
void* planes[cc::kNumYUVPlanes],
const wtf_size_t row_bytes[cc::kNumYUVPlanes],
cc::PaintImage::GeneratorClientId client_id) { … }
void ImageFrameGenerator::SetHasAlpha(wtf_size_t index, bool has_alpha) { … }
void ImageFrameGenerator::RecordWhetherMultiDecoded(
cc::PaintImage::GeneratorClientId client_id) { … }
bool ImageFrameGenerator::HasAlpha(wtf_size_t index) { … }
bool ImageFrameGenerator::GetYUVAInfo(
SegmentReader* data,
const SkYUVAPixmapInfo::SupportedDataTypes& supported_data_types,
SkYUVAPixmapInfo* info) { … }
SkISize ImageFrameGenerator::GetSupportedDecodeSize(
const SkISize& requested_size) const { … }
ImageFrameGenerator::ClientAutoLock::ClientAutoLock(
ImageFrameGenerator* generator,
cc::PaintImage::GeneratorClientId client_id)
: … { … }
ImageFrameGenerator::ClientAutoLock::~ClientAutoLock() { … }
}