Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
SkSafeRange Class Reference

#include <SkSafeRange.h>

Public Member Functions

 operator bool () const
 
bool ok () const
 
template<typename T >
T checkLE (uint64_t value, T max)
 
int checkGE (int value, int min)
 

Detailed Description

Definition at line 19 of file SkSafeRange.h.

Member Function Documentation

◆ checkGE()

int SkSafeRange::checkGE ( int  value,
int  min 
)
inline

Definition at line 37 of file SkSafeRange.h.

37 {
38 if (value < min) {
39 fOK = false;
40 value = min;
41 }
42 return value;
43 }
uint8_t value
static float min(float r, float g, float b)
Definition: hsl.cpp:48

◆ checkLE()

template<typename T >
T SkSafeRange::checkLE ( uint64_t  value,
T  max 
)
inline

Definition at line 28 of file SkSafeRange.h.

28 {
29 SkASSERT(static_cast<int64_t>(max) >= 0);
30 if (value > static_cast<uint64_t>(max)) {
31 fOK = false;
32 value = 0;
33 }
34 return static_cast<T>(value);
35 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
static float max(float r, float g, float b)
Definition: hsl.cpp:49
#define T
Definition: precompiler.cc:65

◆ ok()

bool SkSafeRange::ok ( ) const
inline

Definition at line 23 of file SkSafeRange.h.

23{ return fOK; }

◆ operator bool()

SkSafeRange::operator bool ( ) const
inlineexplicit

Definition at line 21 of file SkSafeRange.h.

21{ return fOK; }

The documentation for this class was generated from the following file: