Go to the source code of this file.
|
static bool | texture_to_matrix (const VertState &state, const SkPoint verts[], const SkPoint texs[], SkMatrix *matrix) |
|
static SkPMColor4f * | convert_colors (const SkColor src[], int count, SkColorSpace *deviceCS, SkArenaAlloc *alloc, bool skipColorXform) |
|
static bool | compute_is_opaque (const SkColor colors[], int count) |
|
static void | fill_triangle_2 (const VertState &state, SkBlitter *blitter, const SkRasterClip &rc, const SkPoint dev2[]) |
|
static void | fill_triangle_3 (const VertState &state, SkBlitter *blitter, const SkRasterClip &rc, const SkPoint3 dev3[]) |
|
static void | fill_triangle (const VertState &state, SkBlitter *blitter, const SkRasterClip &rc, const SkPoint dev2[], const SkPoint3 dev3[]) |
|
◆ compute_is_opaque()
static bool compute_is_opaque |
( |
const SkColor |
colors[], |
|
|
int |
count |
|
) |
| |
|
static |
Definition at line 90 of file SkDraw_vertices.cpp.
90 {
91 uint32_t c = ~0;
94 }
96}
#define SkColorGetA(color)
PODArray< SkColor > colors
◆ convert_colors()
Definition at line 73 of file SkDraw_vertices.cpp.
77 {
79
80
81 auto dstCS = skipColorXform ? nullptr :
sk_ref_sp(deviceCS);
88}
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
@ kRGBA_F32_SkColorType
pixel using C float for red, green, blue, alpha; in 128-bit word
bool SkConvertPixels(const SkImageInfo &dstInfo, void *dstPixels, size_t dstRB, const SkImageInfo &srcInfo, const void *srcPixels, size_t srcRB)
sk_sp< T > sk_ref_sp(T *obj)
T * makeArray(size_t count)
static sk_sp< SkColorSpace > MakeSRGB()
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
◆ fill_triangle()
Definition at line 178 of file SkDraw_vertices.cpp.
179 {
180 if (dev3) {
182 } else {
184 }
185}
static void fill_triangle_3(const VertState &state, SkBlitter *blitter, const SkRasterClip &rc, const SkPoint3 dev3[])
static void fill_triangle_2(const VertState &state, SkBlitter *blitter, const SkRasterClip &rc, const SkPoint dev2[])
◆ fill_triangle_2()
Definition at line 98 of file SkDraw_vertices.cpp.
99 {
102 };
104}
static void FillTriangle(const SkPoint pts[], const SkRasterClip &, SkBlitter *)
◆ fill_triangle_3()
Definition at line 107 of file SkDraw_vertices.cpp.
108 {
109
110
111 auto computeT = [](
float curr,
float next) {
112
114 float t = curr / (curr -
next);
116 return t;
117 };
118
120 return curr + t * (
next - curr);
121 };
122
123 constexpr float tol = 0.05f;
124
125
127
128
129
131 };
132
133
134
135
136 auto clipTriangle = [&](
SkPoint dst[],
const int idx[3],
const SkPoint3 pts[]) ->
int {
139
140 for (
int i = 0;
i < 3; ++
i) {
142 int next = idx[(
i + 1) % 3];
143 if (pts[curr].fZ > tol) {
144 *outP++ = pts[curr];
145 if (pts[
next].fZ <= tol) {
146 *outP++ =
clip(pts[curr], pts[
next]);
147 }
148 } else {
149 if (pts[
next].fZ > tol) {
150 *outP++ =
clip(pts[curr], pts[
next]);
151 }
152 }
153 }
154
155 const int count = SkTo<int>(outP - outPoints);
160 }
162 };
163
166 if (int n = clipTriangle(tmp, idx, dev3)) {
167
170 if (n == 4) {
171 tmp[1] = tmp[2];
172 tmp[2] = tmp[3];
174 }
175 }
176}
SkPoint lerp(const SkPoint &a, const SkPoint &b, float t)
static float next(float f)
static constexpr int kMaxClippedTrianglePointCount
static constexpr float sk_ieee_float_divide(float numer, float denom)
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
◆ texture_to_matrix()
Definition at line 51 of file SkDraw_vertices.cpp.
52 {
54
62}
unsigned useCenter Optional< SkMatrix > matrix
◆ kMaxClippedTrianglePointCount
constexpr int kMaxClippedTrianglePointCount = 4 |
|
staticconstexpr |