Flutter Engine
The Flutter Engine
third_party
accessibility
gfx
geometry
point_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 "
point_conversions.h
"
6
7
#include "
base/numerics/safe_conversions.h
"
8
9
namespace
gfx
{
10
11
Point
ToFlooredPoint
(
const
PointF
& point) {
12
return
Point
(
base::ClampFloor
(point.
x
()),
base::ClampFloor
(point.
y
()));
13
}
14
15
Point
ToCeiledPoint
(
const
PointF
& point) {
16
return
Point
(
base::ClampCeil
(point.
x
()),
base::ClampCeil
(point.
y
()));
17
}
18
19
Point
ToRoundedPoint
(
const
PointF
& point) {
20
return
Point
(
base::ClampRound
(point.
x
()),
base::ClampRound
(point.
y
()));
21
}
22
23
}
// namespace gfx
gfx::PointF
Definition:
point_f.h:19
gfx::PointF::x
constexpr float x() const
Definition:
point_f.h:27
gfx::PointF::y
constexpr float y() const
Definition:
point_f.h:28
gfx::Point
Definition:
point.h:27
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::ToRoundedPoint
Point ToRoundedPoint(const PointF &point)
Definition:
point_conversions.cc:19
gfx::ToCeiledPoint
Point ToCeiledPoint(const PointF &point)
Definition:
point_conversions.cc:15
gfx::ToFlooredPoint
Point ToFlooredPoint(const PointF &point)
Definition:
point_conversions.cc:11
impeller::Point
TPoint< Scalar > Point
Definition:
point.h:322
point_conversions.h
safe_conversions.h
Generated on Sun Jun 23 2024 21:55:21 for Flutter Engine by
1.9.4