Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
SkTo.h File Reference
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkTFitsIn.h"
#include <cstddef>
#include <cstdint>

Go to the source code of this file.

Functions

template<typename D , typename S >
constexpr D SkTo (S s)
 
template<typename S >
constexpr int8_t SkToS8 (S x)
 
template<typename S >
constexpr uint8_t SkToU8 (S x)
 
template<typename S >
constexpr int16_t SkToS16 (S x)
 
template<typename S >
constexpr uint16_t SkToU16 (S x)
 
template<typename S >
constexpr int32_t SkToS32 (S x)
 
template<typename S >
constexpr uint32_t SkToU32 (S x)
 
template<typename S >
constexpr int64_t SkToS64 (S x)
 
template<typename S >
constexpr uint64_t SkToU64 (S x)
 
template<typename S >
constexpr int SkToInt (S x)
 
template<typename S >
constexpr unsigned SkToUInt (S x)
 
template<typename S >
constexpr size_t SkToSizeT (S x)
 
template<typename T >
static constexpr bool SkToBool (const T &x)
 

Function Documentation

◆ SkTo()

template<typename D , typename S >
constexpr D SkTo ( s)
constexpr

Definition at line 16 of file SkTo.h.

16 {
17 return SkASSERT(SkTFitsIn<D>(s)),
18 static_cast<D>(s);
19}
#define SkASSERT(cond)
Definition SkAssert.h:116
struct MyStruct s

◆ SkToBool()

template<typename T >
static constexpr bool SkToBool ( const T x)
staticconstexpr
Returns
false or true based on the condition

Definition at line 35 of file SkTo.h.

35 {
36 return (bool)x;
37}
double x

◆ SkToInt()

template<typename S >
constexpr int SkToInt ( x)
constexpr

Definition at line 29 of file SkTo.h.

29{ return SkTo<int>(x); }

◆ SkToS16()

template<typename S >
constexpr int16_t SkToS16 ( x)
constexpr

Definition at line 23 of file SkTo.h.

23{ return SkTo<int16_t>(x); }

◆ SkToS32()

template<typename S >
constexpr int32_t SkToS32 ( x)
constexpr

Definition at line 25 of file SkTo.h.

25{ return SkTo<int32_t>(x); }

◆ SkToS64()

template<typename S >
constexpr int64_t SkToS64 ( x)
constexpr

Definition at line 27 of file SkTo.h.

27{ return SkTo<int64_t>(x); }

◆ SkToS8()

template<typename S >
constexpr int8_t SkToS8 ( x)
constexpr

Definition at line 21 of file SkTo.h.

21{ return SkTo<int8_t>(x); }

◆ SkToSizeT()

template<typename S >
constexpr size_t SkToSizeT ( x)
constexpr

Definition at line 31 of file SkTo.h.

31{ return SkTo<size_t>(x); }

◆ SkToU16()

template<typename S >
constexpr uint16_t SkToU16 ( x)
constexpr

Definition at line 24 of file SkTo.h.

24{ return SkTo<uint16_t>(x); }

◆ SkToU32()

template<typename S >
constexpr uint32_t SkToU32 ( x)
constexpr

Definition at line 26 of file SkTo.h.

26{ return SkTo<uint32_t>(x); }

◆ SkToU64()

template<typename S >
constexpr uint64_t SkToU64 ( x)
constexpr

Definition at line 28 of file SkTo.h.

28{ return SkTo<uint64_t>(x); }

◆ SkToU8()

template<typename S >
constexpr uint8_t SkToU8 ( x)
constexpr

Definition at line 22 of file SkTo.h.

22{ return SkTo<uint8_t>(x); }

◆ SkToUInt()

template<typename S >
constexpr unsigned SkToUInt ( x)
constexpr

Definition at line 30 of file SkTo.h.

30{ return SkTo<unsigned>(x); }