Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
SkScan.h File Reference
#include "include/core/SkPoint.h"
#include "include/core/SkRect.h"
#include "include/private/base/SkFixed.h"

Go to the source code of this file.

Classes

class  SkScan
 

Typedefs

typedef SkIRect SkXRect
 

Functions

static void XRect_set (SkXRect *xr, const SkIRect &src)
 
static void XRect_set (SkXRect *xr, const SkRect &src)
 
static void XRect_round (const SkXRect &xr, SkIRect *dst)
 
static void XRect_roundOut (const SkXRect &xr, SkIRect *dst)
 

Typedef Documentation

◆ SkXRect

typedef SkIRect SkXRect

Defines a fixed-point rectangle, identical to the integer SkIRect, but its coordinates are treated as SkFixed rather than int32_t.

Definition at line 24 of file SkScan.h.

Function Documentation

◆ XRect_round()

static void XRect_round ( const SkXRect xr,
SkIRect dst 
)
inlinestatic

Round the SkXRect coordinates, and store the result in the SkIRect.

Definition at line 118 of file SkScan.h.

118 {
119 dst->fLeft = SkFixedRoundToInt(xr.fLeft);
120 dst->fTop = SkFixedRoundToInt(xr.fTop);
121 dst->fRight = SkFixedRoundToInt(xr.fRight);
122 dst->fBottom = SkFixedRoundToInt(xr.fBottom);
123}
#define SkFixedRoundToInt(x)
Definition SkFixed.h:76
dst
Definition cp.py:12
int32_t fBottom
larger y-axis bounds
Definition SkRect.h:36
int32_t fTop
smaller y-axis bounds
Definition SkRect.h:34
int32_t fLeft
smaller x-axis bounds
Definition SkRect.h:33
int32_t fRight
larger x-axis bounds
Definition SkRect.h:35

◆ XRect_roundOut()

static void XRect_roundOut ( const SkXRect xr,
SkIRect dst 
)
inlinestatic

Round the SkXRect coordinates out (i.e. use floor for left/top, and ceiling for right/bottom), and store the result in the SkIRect.

Definition at line 128 of file SkScan.h.

128 {
129 dst->fLeft = SkFixedFloorToInt(xr.fLeft);
130 dst->fTop = SkFixedFloorToInt(xr.fTop);
131 dst->fRight = SkFixedCeilToInt(xr.fRight);
132 dst->fBottom = SkFixedCeilToInt(xr.fBottom);
133}
#define SkFixedCeilToInt(x)
Definition SkFixed.h:77
#define SkFixedFloorToInt(x)
Definition SkFixed.h:78

◆ XRect_set() [1/2]

static void XRect_set ( SkXRect xr,
const SkIRect src 
)
inlinestatic

Assign an SkXRect from a SkIRect, by promoting the src rect's coordinates from int to SkFixed. Does not check for overflow if the src coordinates exceed 32K

Definition at line 98 of file SkScan.h.

98 {
99 xr->fLeft = SkIntToFixed(src.fLeft);
100 xr->fTop = SkIntToFixed(src.fTop);
101 xr->fRight = SkIntToFixed(src.fRight);
102 xr->fBottom = SkIntToFixed(src.fBottom);
103}
#define SkIntToFixed(n)
Definition SkFixed.h:73

◆ XRect_set() [2/2]

static void XRect_set ( SkXRect xr,
const SkRect src 
)
inlinestatic

Assign an SkXRect from a SkRect, by promoting the src rect's coordinates from SkScalar to SkFixed. Does not check for overflow if the src coordinates exceed 32K

Definition at line 109 of file SkScan.h.

109 {
110 xr->fLeft = SkScalarToFixed(src.fLeft);
111 xr->fTop = SkScalarToFixed(src.fTop);
112 xr->fRight = SkScalarToFixed(src.fRight);
113 xr->fBottom = SkScalarToFixed(src.fBottom);
114}
#define SkScalarToFixed(x)
Definition SkFixed.h:125