chromium/ui/base/resource/resource_scale_factor.cc

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "ui/base/resource/resource_scale_factor.h"

#include <algorithm>
#include <cmath>
#include <iterator>
#include <limits>
#include <memory>
#include <vector>

#include "base/check.h"
#include "base/check_op.h"
#include "base/containers/contains.h"

namespace ui {

namespace {

std::vector<ResourceScaleFactor>* g_supported_resource_scale_factors =;

const float kResourceScaleFactorScales[] =;
static_assert;

// The difference to fall back to the smaller scale factor rather than the
// larger one. For example, assume 1.20 is requested but only 1.0 and 2.0 are
// supported. In that case, not fall back to 2.0 but 1.0, and then expand
// the image to 1.20.
const float kFallbackToSmallerScaleDiff =;

}  // namespace

float GetScaleForResourceScaleFactor(ResourceScaleFactor scale_factor) {}

void SetSupportedResourceScaleFactors(
    const std::vector<ResourceScaleFactor>& scale_factors) {}

const std::vector<ResourceScaleFactor>& GetSupportedResourceScaleFactors() {}

ResourceScaleFactor GetSupportedResourceScaleFactor(float scale) {}

ResourceScaleFactor GetSupportedResourceScaleFactorForRescale(float scale) {}

ResourceScaleFactor GetMaxSupportedResourceScaleFactor() {}

float GetScaleForMaxSupportedResourceScaleFactor() {}

bool IsScaleFactorSupported(ResourceScaleFactor scale_factor) {}

namespace test {

ScopedSetSupportedResourceScaleFactors::ScopedSetSupportedResourceScaleFactors(
    const std::vector<ResourceScaleFactor>& new_scale_factors) {}

ScopedSetSupportedResourceScaleFactors::
    ~ScopedSetSupportedResourceScaleFactors() {}

}  // namespace test

}  // namespace ui