Flutter Engine
The Flutter Engine
third_party
skia
src
base
SkHalf.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2014 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
#include "
src/base/SkHalf.h
"
9
10
#include "
include/private/base/SkFloatingPoint.h
"
11
#include "
src/base/SkVx.h
"
12
13
// NOTE: These are defined within the CPP compilation unit so that they are not inlined everywhere
14
// and increase code size. Performance critical code is likely already using skvx directly, and
15
// they will be inlined where performance vs. code size is worth it.
16
SkHalf
SkFloatToHalf
(
float
f
) {
17
if
(std::isnan(
f
)) {
18
return
SK_HalfNaN
;
19
}
else
{
20
return
to_half
(
skvx::Vec<1,float>
(
f
))[0];
21
}
22
}
23
24
float
SkHalfToFloat
(
SkHalf
h
) {
25
return
from_half
(
skvx::Vec<1,uint16_t>
(
h
))[0];
26
}
SkFloatingPoint.h
SkHalfToFloat
float SkHalfToFloat(SkHalf h)
Definition:
SkHalf.cpp:24
SkFloatToHalf
SkHalf SkFloatToHalf(float f)
Definition:
SkHalf.cpp:16
SkHalf.h
SkHalf
uint16_t SkHalf
Definition:
SkHalf.h:16
SK_HalfNaN
static constexpr uint16_t SK_HalfNaN
Definition:
SkHalf.h:18
SkVx.h
skcms_private::f
float f
Definition:
skcms_Transform.h:121
skvx::from_half
SIN Vec< N, float > from_half(const Vec< N, uint16_t > &x)
Definition:
SkVx.h:790
skvx::to_half
SIN Vec< N, uint16_t > to_half(const Vec< N, float > &x)
Definition:
SkVx.h:750
h
SkScalar h
Definition:
pictureshadertile.cpp:30
skvx::Vec
Definition:
SkVx.h:83
Generated on Sun Jun 23 2024 21:56:09 for Flutter Engine by
1.9.4