#include "services/data_decoder/public/cpp/decode_image.h"
#include <utility>
#include "base/debug/dump_without_crashing.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/metrics/histogram_functions.h"
#include "base/time/time.h"
#include "base/timer/elapsed_timer.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "services/data_decoder/public/cpp/data_decoder.h"
#include "skia/ext/skia_utils_base.h"
#include "third_party/skia/include/core/SkBitmap.h"
namespace data_decoder {
namespace {
void OnDecodeImage(mojo::Remote<mojom::ImageDecoder> decoder,
DecodeImageCallback callback,
const std::string& uma_name_prefix,
base::ElapsedTimer timer,
base::TimeDelta image_decoding_time,
const SkBitmap& bitmap) { … }
void OnDecodeImages(mojo::Remote<mojom::ImageDecoder> decoder,
mojom::ImageDecoder::DecodeAnimationCallback callback,
std::vector<mojom::AnimationFramePtr> bitmaps) { … }
void DecodeImageUsingServiceProcess(DataDecoder* data_decoder,
base::span<const uint8_t> encoded_bytes,
mojom::ImageCodec codec,
bool shrink_to_fit,
uint64_t max_size_in_bytes,
const gfx::Size& desired_image_frame_size,
DecodeImageCallback callback,
const std::string& uma_name_prefix,
base::ElapsedTimer timer) { … }
}
void DecodeImageIsolated(base::span<const uint8_t> encoded_bytes,
mojom::ImageCodec codec,
bool shrink_to_fit,
uint64_t max_size_in_bytes,
const gfx::Size& desired_image_frame_size,
DecodeImageCallback callback) { … }
void DecodeImage(DataDecoder* data_decoder,
base::span<const uint8_t> encoded_bytes,
mojom::ImageCodec codec,
bool shrink_to_fit,
uint64_t max_size_in_bytes,
const gfx::Size& desired_image_frame_size,
DecodeImageCallback callback) { … }
void DecodeAnimationIsolated(
base::span<const uint8_t> encoded_bytes,
bool shrink_to_fit,
uint64_t max_size_in_bytes,
mojom::ImageDecoder::DecodeAnimationCallback callback) { … }
void DecodeAnimation(DataDecoder* data_decoder,
base::span<const uint8_t> encoded_bytes,
bool shrink_to_fit,
uint64_t max_size_in_bytes,
mojom::ImageDecoder::DecodeAnimationCallback callback) { … }
}