Flutter Engine
The Flutter Engine
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
SkPackedGlyphID Struct Reference

#include <SkGlyph.h>

Classes

struct  Hash
 

Public Types

enum  {
  kGlyphIDLen = 16u , kSubPixelPosLen = 2u , kSubPixelX = 0u , kGlyphID = kSubPixelPosLen ,
  kSubPixelY = kGlyphIDLen + kSubPixelPosLen , kEndData = kGlyphIDLen + 2 * kSubPixelPosLen , kGlyphIDMask = (1u << kGlyphIDLen) - 1 , kSubPixelPosMask = (1u << kSubPixelPosLen) - 1 ,
  kMaskAll = (1u << kEndData) - 1 , kFixedPointBinaryPointPos = 16u , kFixedPointSubPixelPosBits = kFixedPointBinaryPointPos - kSubPixelPosLen
}
 

Public Member Functions

constexpr SkPackedGlyphID (SkGlyphID glyphID)
 
constexpr SkPackedGlyphID (SkGlyphID glyphID, SkFixed x, SkFixed y)
 
constexpr SkPackedGlyphID (SkGlyphID glyphID, uint32_t x, uint32_t y)
 
 SkPackedGlyphID (SkGlyphID glyphID, SkPoint pt, SkIPoint mask)
 
constexpr SkPackedGlyphID (uint32_t v)
 
constexpr SkPackedGlyphID ()
 
bool operator== (const SkPackedGlyphID &that) const
 
bool operator!= (const SkPackedGlyphID &that) const
 
bool operator< (SkPackedGlyphID that) const
 
SkGlyphID glyphID () const
 
uint32_t value () const
 
SkFixed getSubXFixed () const
 
SkFixed getSubYFixed () const
 
uint32_t hash () const
 
SkString dump () const
 
SkString shortDump () const
 

Static Public Attributes

static constexpr uint32_t kImpossibleID = ~0u
 
static const constexpr SkScalar kSubpixelRound
 
static const constexpr SkIPoint kXYFieldMask
 

Detailed Description

Definition at line 46 of file SkGlyph.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kGlyphIDLen 
kSubPixelPosLen 
kSubPixelX 
kGlyphID 
kSubPixelY 
kEndData 
kGlyphIDMask 
kSubPixelPosMask 
kMaskAll 
kFixedPointBinaryPointPos 
kFixedPointSubPixelPosBits 

Definition at line 48 of file SkGlyph.h.

48 {
49 // Lengths
50 kGlyphIDLen = 16u,
51 kSubPixelPosLen = 2u,
52
53 // Bit positions
54 kSubPixelX = 0u,
58
59 // Masks
60 kGlyphIDMask = (1u << kGlyphIDLen) - 1,
62 kMaskAll = (1u << kEndData) - 1,
63
64 // Location of sub pixel info in a fixed pointer number.
67 };
@ kFixedPointBinaryPointPos
Definition: SkGlyph.h:65
@ kSubPixelPosMask
Definition: SkGlyph.h:61
@ kFixedPointSubPixelPosBits
Definition: SkGlyph.h:66

Constructor & Destructor Documentation

◆ SkPackedGlyphID() [1/6]

constexpr SkPackedGlyphID::SkPackedGlyphID ( SkGlyphID  glyphID)
inlineexplicitconstexpr

Definition at line 81 of file SkGlyph.h.

82 : fID{(uint32_t)glyphID << kGlyphID} { }
SkGlyphID glyphID() const
Definition: SkGlyph.h:106

◆ SkPackedGlyphID() [2/6]

constexpr SkPackedGlyphID::SkPackedGlyphID ( SkGlyphID  glyphID,
SkFixed  x,
SkFixed  y 
)
inlineconstexpr

Definition at line 84 of file SkGlyph.h.

85 : fID {PackIDXY(glyphID, x, y)} { }
double y
double x

◆ SkPackedGlyphID() [3/6]

constexpr SkPackedGlyphID::SkPackedGlyphID ( SkGlyphID  glyphID,
uint32_t  x,
uint32_t  y 
)
inlineconstexpr

Definition at line 87 of file SkGlyph.h.

88 : fID {PackIDSubXSubY(glyphID, x, y)} { }

◆ SkPackedGlyphID() [4/6]

SkPackedGlyphID::SkPackedGlyphID ( SkGlyphID  glyphID,
SkPoint  pt,
SkIPoint  mask 
)
inline

Definition at line 90 of file SkGlyph.h.

91 : fID{PackIDSkPoint(glyphID, pt, mask)} { }

◆ SkPackedGlyphID() [5/6]

constexpr SkPackedGlyphID::SkPackedGlyphID ( uint32_t  v)
inlineexplicitconstexpr

Definition at line 93 of file SkGlyph.h.

93: fID{v & kMaskAll} { }

◆ SkPackedGlyphID() [6/6]

constexpr SkPackedGlyphID::SkPackedGlyphID ( )
inlineconstexpr

Definition at line 94 of file SkGlyph.h.

94: fID{kImpossibleID} {}
static constexpr uint32_t kImpossibleID
Definition: SkGlyph.h:47

Member Function Documentation

◆ dump()

SkString SkPackedGlyphID::dump ( ) const
inline

Definition at line 126 of file SkGlyph.h.

126 {
127 SkString str;
128 str.appendf("glyphID: %d, x: %d, y:%d", glyphID(), getSubXFixed(), getSubYFixed());
129 return str;
130 }
void void void appendf(const char format[],...) SK_PRINTF_LIKE(2
Definition: SkString.cpp:550
SkFixed getSubXFixed() const
Definition: SkGlyph.h:114
SkFixed getSubYFixed() const
Definition: SkGlyph.h:118

◆ getSubXFixed()

SkFixed SkPackedGlyphID::getSubXFixed ( ) const
inline

Definition at line 114 of file SkGlyph.h.

114 {
115 return this->subToFixed(kSubPixelX);
116 }

◆ getSubYFixed()

SkFixed SkPackedGlyphID::getSubYFixed ( ) const
inline

Definition at line 118 of file SkGlyph.h.

118 {
119 return this->subToFixed(kSubPixelY);
120 }

◆ glyphID()

SkGlyphID SkPackedGlyphID::glyphID ( ) const
inline

Definition at line 106 of file SkGlyph.h.

106 {
107 return (fID >> kGlyphID) & kGlyphIDMask;
108 }

◆ hash()

uint32_t SkPackedGlyphID::hash ( ) const
inline

Definition at line 122 of file SkGlyph.h.

122 {
123 return SkChecksum::CheapMix(fID);
124 }
static uint32_t CheapMix(uint32_t hash)
Definition: SkChecksum.h:45

◆ operator!=()

bool SkPackedGlyphID::operator!= ( const SkPackedGlyphID that) const
inline

Definition at line 99 of file SkGlyph.h.

99 {
100 return !(*this == that);
101 }

◆ operator<()

bool SkPackedGlyphID::operator< ( SkPackedGlyphID  that) const
inline

Definition at line 102 of file SkGlyph.h.

102 {
103 return this->fID < that.fID;
104 }

◆ operator==()

bool SkPackedGlyphID::operator== ( const SkPackedGlyphID that) const
inline

Definition at line 96 of file SkGlyph.h.

96 {
97 return fID == that.fID;
98 }

◆ shortDump()

SkString SkPackedGlyphID::shortDump ( ) const
inline

Definition at line 132 of file SkGlyph.h.

132 {
133 SkString str;
134 str.appendf("0x%x|%1u|%1u", this->glyphID(),
135 this->subPixelField(kSubPixelX),
136 this->subPixelField(kSubPixelY));
137 return str;
138 }

◆ value()

uint32_t SkPackedGlyphID::value ( ) const
inline

Definition at line 110 of file SkGlyph.h.

110 {
111 return fID;
112 }

Member Data Documentation

◆ kImpossibleID

constexpr uint32_t SkPackedGlyphID::kImpossibleID = ~0u
inlinestaticconstexpr

Definition at line 47 of file SkGlyph.h.

◆ kSubpixelRound

const constexpr SkScalar SkPackedGlyphID::kSubpixelRound
inlinestaticconstexpr
Initial value:
=

Definition at line 69 of file SkGlyph.h.

◆ kXYFieldMask

const constexpr SkIPoint SkPackedGlyphID::kXYFieldMask
inlinestaticconstexpr
Initial value:

Definition at line 72 of file SkGlyph.h.


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