Go to the source code of this file.
|
static bool | valid_divs (const int *divs, int count, int start, int end) |
|
static int | count_scalable_pixels (const int32_t *divs, int numDivs, bool firstIsScalable, int start, int end) |
|
static void | set_points (float *dst, int *src, const int *divs, int divCount, int srcFixed, int srcScalable, int srcStart, int srcEnd, float dstStart, float dstEnd, bool isScalable) |
|
◆ count_scalable_pixels()
static int count_scalable_pixels |
( |
const int32_t * |
divs, |
|
|
int |
numDivs, |
|
|
bool |
firstIsScalable, |
|
|
int |
start, |
|
|
int |
end |
|
) |
| |
|
static |
Count the number of pixels that are in "scalable" patches.
Definition at line 55 of file SkLatticeIter.cpp.
56 {
57 if (0 == numDivs) {
58 return firstIsScalable ?
end -
start : 0;
59 }
60
63 if (firstIsScalable) {
66 } else {
69 }
70
71 for (;
i < numDivs;
i += 2) {
72
73
75 int right = (
i + 1 < numDivs) ? divs[
i + 1] :
end;
77 }
78
80}
static bool left(const SkPoint &p0, const SkPoint &p1)
static bool right(const SkPoint &p0, const SkPoint &p1)
◆ set_points()
static void set_points |
( |
float * |
dst, |
|
|
int * |
src, |
|
|
const int * |
divs, |
|
|
int |
divCount, |
|
|
int |
srcFixed, |
|
|
int |
srcScalable, |
|
|
int |
srcStart, |
|
|
int |
srcEnd, |
|
|
float |
dstStart, |
|
|
float |
dstEnd, |
|
|
bool |
isScalable |
|
) |
| |
|
static |
Set points for the src and dst rects on subsequent draw calls.
Definition at line 85 of file SkLatticeIter.cpp.
87 {
88 float dstLen = dstEnd - dstStart;
90 if (srcFixed <= dstLen) {
91
92
93 scale = (dstLen - ((
float) srcFixed)) / ((
float) srcScalable);
94 } else {
95
97 }
98
101 for (
int i = 0;
i < divCount;
i++) {
102 src[
i + 1] = divs[
i];
104 float dstDelta;
105 if (srcFixed <= dstLen) {
106 dstDelta = isScalable ?
scale * srcDelta : srcDelta;
107 } else {
108 dstDelta = isScalable ? 0.0f :
scale * srcDelta;
109 }
111
112
113 isScalable = !isScalable;
114 }
115
116 src[divCount + 1] = srcEnd;
117 dst[divCount + 1] = dstEnd;
118}
◆ valid_divs()
static bool valid_divs |
( |
const int * |
divs, |
|
|
int |
count, |
|
|
int |
start, |
|
|
int |
end |
|
) |
| |
|
static |
Divs must be in increasing order with no duplicates.
Definition at line 20 of file SkLatticeIter.cpp.
20 {
24 return false;
25 }
27 }
28
29 return true;
30}
static float prev(float f)