Flutter Engine
The Flutter Engine
third_party
accessibility
gfx
geometry
size_conversions.cc
Go to the documentation of this file.
1
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#include "
size_conversions.h
"
6
7
#include "
base/numerics/safe_conversions.h
"
8
9
namespace
gfx
{
10
11
Size
ToFlooredSize
(
const
SizeF
&
size
) {
12
return
Size
(
base::ClampFloor
(
size
.width()),
base::ClampFloor
(
size
.height()));
13
}
14
15
Size
ToCeiledSize
(
const
SizeF
&
size
) {
16
return
Size
(
base::ClampCeil
(
size
.width()),
base::ClampCeil
(
size
.height()));
17
}
18
19
Size
ToRoundedSize
(
const
SizeF
&
size
) {
20
return
Size
(
base::ClampRound
(
size
.width()),
base::ClampRound
(
size
.height()));
21
}
22
23
}
// namespace gfx
gfx::SizeF
Definition:
size_f.h:18
gfx::Size
Definition:
size.h:26
base::ClampFloor
Dst ClampFloor(Src value)
Definition:
safe_conversions.h:366
base::ClampCeil
Dst ClampCeil(Src value)
Definition:
safe_conversions.h:373
base::ClampRound
Dst ClampRound(Src value)
Definition:
safe_conversions.h:380
gfx
Definition:
insets.cc:10
gfx::ToFlooredSize
Size ToFlooredSize(const SizeF &size)
Definition:
size_conversions.cc:11
gfx::ToCeiledSize
Size ToCeiledSize(const SizeF &size)
Definition:
size_conversions.cc:15
gfx::size
constexpr size_t size(const T(&array)[N]) noexcept
Definition:
rect_unittest.cc:21
gfx::ToRoundedSize
Size ToRoundedSize(const SizeF &size)
Definition:
size_conversions.cc:19
impeller::Size
TSize< Scalar > Size
Definition:
size.h:137
safe_conversions.h
size_conversions.h
Generated on Sun Jun 23 2024 21:55:21 for Flutter Engine by
1.9.4