Flutter Engine
The Flutter Engine
Namespaces | Functions
SkDraw_text.cpp File Reference
#include "include/core/SkBitmap.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkPoint.h"
#include "include/core/SkRect.h"
#include "include/core/SkRegion.h"
#include "include/private/base/SkDebug.h"
#include "include/private/base/SkTo.h"
#include "src/base/SkArenaAlloc.h"
#include "src/base/SkZip.h"
#include "src/core/SkAAClip.h"
#include "src/core/SkBlitter.h"
#include "src/core/SkDraw.h"
#include "src/core/SkGlyph.h"
#include "src/core/SkGlyphRunPainter.h"
#include "src/core/SkMask.h"
#include "src/core/SkRasterClip.h"
#include "src/core/SkSurfacePriv.h"
#include <cstdint>
#include <climits>

Go to the source code of this file.

Namespaces

namespace  sktext
 

Functions

static bool check_glyph_position (SkPoint position)
 

Function Documentation

◆ check_glyph_position()

static bool check_glyph_position ( SkPoint  position)
static

Definition at line 41 of file SkDraw_text.cpp.

41 {
42 // Prevent glyphs from being drawn outside of or straddling the edge of device space.
43 // Comparisons written a little weirdly so that NaN coordinates are treated safely.
44 auto gt = [](float a, int b) { return !(a <= (float)b); };
45 auto lt = [](float a, int b) { return !(a >= (float)b); };
46 return !(gt(position.fX, INT_MAX - (INT16_MAX + SkTo<int>(UINT16_MAX))) ||
47 lt(position.fX, INT_MIN - (INT16_MIN + 0 /*UINT16_MIN*/)) ||
48 gt(position.fY, INT_MAX - (INT16_MAX + SkTo<int>(UINT16_MAX))) ||
49 lt(position.fY, INT_MIN - (INT16_MIN + 0 /*UINT16_MIN*/)));
50}
static bool b
struct MyStruct a[10]
float fX
x-axis value
Definition: SkPoint_impl.h:164
float fY
y-axis value
Definition: SkPoint_impl.h:165