Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
HLine_SkAntiHairBlitter Class Reference
Inheritance diagram for HLine_SkAntiHairBlitter:
SkAntiHairBlitter

Public Member Functions

SkFixed drawCap (int x, SkFixed fy, SkFixed slope, int mod64) override
 
SkFixed drawLine (int x, int stopx, SkFixed fy, SkFixed slope) override
 
- Public Member Functions inherited from SkAntiHairBlitter
 SkAntiHairBlitter ()
 
virtual ~SkAntiHairBlitter ()
 
SkBlittergetBlitter () const
 
void setup (SkBlitter *blitter)
 
virtual SkFixed drawCap (int x, SkFixed fy, SkFixed slope, int mod64)=0
 
virtual SkFixed drawLine (int x, int stopx, SkFixed fy, SkFixed slope)=0
 

Detailed Description

Definition at line 125 of file SkScan_Antihair.cpp.

Member Function Documentation

◆ drawCap()

SkFixed HLine_SkAntiHairBlitter::drawCap ( int  x,
SkFixed  fy,
SkFixed  slope,
int  mod64 
)
inlineoverridevirtual

Implements SkAntiHairBlitter.

Definition at line 127 of file SkScan_Antihair.cpp.

127 {
128 fy += SK_Fixed1/2;
129
130 int y = fy >> 16;
131 uint8_t a = (uint8_t)((fy >> 8) & 0xFF);
132
133 // lower line
134 unsigned ma = SmallDot6Scale(a, mod64);
135 if (ma) {
136 call_hline_blitter(this->getBlitter(), x, y, 1, ma);
137 }
138
139 // upper line
140 ma = SmallDot6Scale(255 - a, mod64);
141 if (ma) {
142 call_hline_blitter(this->getBlitter(), x, y - 1, 1, ma);
143 }
144
145 return fy - SK_Fixed1/2;
146 }
#define SK_Fixed1
Definition: SkFixed.h:26
static void call_hline_blitter(SkBlitter *blitter, int x, int y, int count, U8CPU alpha)
static int SmallDot6Scale(int value, int dot6)
SkBlitter * getBlitter() const
struct MyStruct a[10]
double y
double x

◆ drawLine()

SkFixed HLine_SkAntiHairBlitter::drawLine ( int  x,
int  stopx,
SkFixed  fy,
SkFixed  slope 
)
inlineoverridevirtual

Implements SkAntiHairBlitter.

Definition at line 148 of file SkScan_Antihair.cpp.

148 {
149 SkASSERT(x < stopx);
150 int count = stopx - x;
151 fy += SK_Fixed1/2;
152
153 int y = fy >> 16;
154 uint8_t a = (uint8_t)((fy >> 8) & 0xFF);
155
156 // lower line
157 if (a) {
158 call_hline_blitter(this->getBlitter(), x, y, count, a);
159 }
160
161 // upper line
162 a = 255 - a;
163 if (a) {
164 call_hline_blitter(this->getBlitter(), x, y - 1, count, a);
165 }
166
167 return fy - SK_Fixed1/2;
168 }
int count
Definition: FontMgrTest.cpp:50
#define SkASSERT(cond)
Definition: SkAssert.h:116

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