Flutter Engine
The Flutter Engine
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
8
9namespace gfx {
10
12 return Point(base::ClampFloor(point.x()), base::ClampFloor(point.y()));
13}
14
15Point ToCeiledPoint(const PointF& point) {
16 return Point(base::ClampCeil(point.x()), base::ClampCeil(point.y()));
17}
18
20 return Point(base::ClampRound(point.x()), base::ClampRound(point.y()));
21}
22
23} // namespace gfx
constexpr float x() const
Definition: point_f.h:27
constexpr float y() const
Definition: point_f.h:28
Dst ClampFloor(Src value)
Dst ClampCeil(Src value)
Dst ClampRound(Src value)
Definition: insets.cc:10
Point ToRoundedPoint(const PointF &point)
Point ToCeiledPoint(const PointF &point)
Point ToFlooredPoint(const PointF &point)
TPoint< Scalar > Point
Definition: point.h:322