Flutter Engine
The Flutter Engine
Macros | Functions
SkEmbossMask.cpp File Reference
#include "src/effects/SkEmbossMask.h"
#include "include/core/SkRect.h"
#include "include/core/SkScalar.h"
#include "include/core/SkTypes.h"
#include "include/private/base/SkFixed.h"
#include "include/private/base/SkTo.h"
#include "src/base/SkMathPriv.h"
#include "src/core/SkMask.h"
#include <algorithm>
#include <cstddef>
#include <cstdint>

Go to the source code of this file.

Macros

#define kDelta   32
 

Functions

static int nonzero_to_one (int x)
 
static int neq_to_one (int x, int max)
 
static int neq_to_mask (int x, int max)
 
static unsigned div255 (unsigned x)
 

Macro Definition Documentation

◆ kDelta

#define kDelta   32

Definition at line 53 of file SkEmbossMask.cpp.

Function Documentation

◆ div255()

static unsigned div255 ( unsigned  x)
inlinestatic

Definition at line 48 of file SkEmbossMask.cpp.

48 {
49 SkASSERT(x <= (255*255));
50 return x * ((1 << 24) / 255) >> 24;
51}
#define SkASSERT(cond)
Definition: SkAssert.h:116
double x

◆ neq_to_mask()

static int neq_to_mask ( int  x,
int  max 
)
inlinestatic

Definition at line 39 of file SkEmbossMask.cpp.

39 {
40#if 0
41 return -(x != max);
42#else
43 SkASSERT(x >= 0 && x <= max);
44 return (x - max) >> 31;
45#endif
46}
static float max(float r, float g, float b)
Definition: hsl.cpp:49

◆ neq_to_one()

static int neq_to_one ( int  x,
int  max 
)
inlinestatic

Definition at line 30 of file SkEmbossMask.cpp.

30 {
31#if 0
32 return x != max;
33#else
34 SkASSERT(x >= 0 && x <= max);
35 return ((unsigned)(x - max)) >> 31;
36#endif
37}

◆ nonzero_to_one()

static int nonzero_to_one ( int  x)
inlinestatic

Definition at line 22 of file SkEmbossMask.cpp.

22 {
23#if 0
24 return x != 0;
25#else
26 return ((unsigned)(x | -x)) >> 31;
27#endif
28}