summaryrefslogtreecommitdiffstats
path: root/ui/base/resource/scale_factor.cc
blob: dceffaec424331060710e4b3ecf9cb82edfb376f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

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

#include "base/macros.h"

namespace ui {

namespace {

const float kScaleFactorScales[] = {1.0f, 1.0f, 1.25f, 1.33f, 1.4f, 1.5f, 1.8f,
                                    2.0f, 2.5f, 3.0f};
static_assert(NUM_SCALE_FACTORS == arraysize(kScaleFactorScales),
              "kScaleFactorScales has incorrect size");

}  // namespace

float GetScaleForScaleFactor(ScaleFactor scale_factor) {
  return kScaleFactorScales[scale_factor];
}

}  // namespace ui