Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
include
private
base
SkTPin.h
Go to the documentation of this file.
1
/*
2
* Copyright 2020 Google Inc.
3
*
4
* Use of this source code is governed by a BSD-style license that can be
5
* found in the LICENSE file.
6
*/
7
8
#ifndef SkTPin_DEFINED
9
#define SkTPin_DEFINED
10
11
#include <algorithm>
12
13
/** @return x pinned (clamped) between lo and hi, inclusively.
14
15
Unlike std::clamp(), SkTPin() always returns a value between lo and hi.
16
If x is NaN, SkTPin() returns lo but std::clamp() returns NaN.
17
*/
18
template
<
typename
T>
19
static
constexpr
const
T
&
SkTPin
(
const
T
&
x
,
const
T
& lo,
const
T
& hi) {
20
return
std::max(lo, std::min(
x
, hi));
21
}
22
23
#endif
SkTPin
static constexpr const T & SkTPin(const T &x, const T &lo, const T &hi)
Definition
SkTPin.h:19
x
double x
Definition
mouse-input-test.cc:82
T
#define T
Definition
precompiler.cc:65
Generated on Fri Apr 26 2024 06:16:14 for Flutter Engine by
1.9.8