Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
SkRasterClip.cpp File Reference
#include "src/core/SkRasterClip.h"
#include "include/core/SkBlendMode.h"
#include "include/core/SkClipOp.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPath.h"
#include "include/core/SkScalar.h"
#include "include/private/base/SkDebug.h"
#include "src/core/SkRegionPriv.h"

Go to the source code of this file.

Functions

static bool nearly_integral (SkScalar x)
 

Function Documentation

◆ nearly_integral()

static bool nearly_integral ( SkScalar  x)
static

Our antialiasing currently has a granularity of 1/4 of a pixel along each axis. Thus we can treat an axis coordinate as an integer if it differs from its nearest int by < half of that value (1/8 in this case).

Definition at line 144 of file SkRasterClip.cpp.

144 {
145 static const SkScalar domain = SK_Scalar1 / 4;
146 static const SkScalar halfDomain = domain / 2;
147
148 x += halfDomain;
149 return x - SkScalarFloorToScalar(x) < domain;
150}
#define SkScalarFloorToScalar(x)
Definition SkScalar.h:30
#define SK_Scalar1
Definition SkScalar.h:18
float SkScalar
Definition extension.cpp:12
double x