#include "components/favicon_base/select_favicon_frames.h"
#include <algorithm>
#include <cmath>
#include <limits>
#include <map>
#include <memory>
#include <set>
#include <utility>
#include "base/containers/contains.h"
#include "components/favicon_base/favicon_util.h"
#include "skia/ext/image_operations.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkImage.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/image/image_skia_rep.h"
#include "ui/gfx/image/image_skia_source.h"
namespace {
size_t BiggestCandidate(const std::vector<gfx::Size>& candidate_sizes) { … }
SkBitmap SampleNearestNeighbor(const SkBitmap& contents, int desired_size) { … }
size_t GetCandidateIndexWithBestScore(
const std::vector<gfx::Size>& candidate_sizes,
int desired_size,
float* output_score) { … }
struct SelectionResult { … };
void GetCandidateIndicesWithBestScores(
const std::vector<gfx::Size>& candidate_sizes,
const std::vector<int>& desired_sizes,
float* match_score,
std::vector<SelectionResult>* results) { … }
SkBitmap GetResizedBitmap(const SkBitmap& source_bitmap,
gfx::Size original_size,
int desired_size_in_pixel) { … }
class FaviconImageSource : public gfx::ImageSkiaSource { … };
}
const float kSelectFaviconFramesInvalidScore = …;
gfx::ImageSkia CreateFaviconImageSkia(
const std::vector<SkBitmap>& bitmaps,
const std::vector<gfx::Size>& original_sizes,
int desired_size_in_dip,
float* score) { … }
void SelectFaviconFrameIndices(const std::vector<gfx::Size>& frame_pixel_sizes,
const std::vector<int>& desired_sizes,
std::vector<size_t>* best_indices,
float* match_score) { … }