| Flutter Impeller |

formats.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef FLUTTER_IMPELLER_TOOLKIT_INTEROP_FORMATS_H_
6 #define FLUTTER_IMPELLER_TOOLKIT_INTEROP_FORMATS_H_
7
8 #include <vector>
9
10 #include "flutter/display_list/dl_builder.h"
11 #include "flutter/display_list/dl_color.h"
12 #include "flutter/display_list/geometry/dl_path_builder.h"
13 #include "flutter/txt/src/txt/font_style.h"
14 #include "flutter/txt/src/txt/font_weight.h"
15 #include "flutter/txt/src/txt/paragraph_style.h"
16 #include "impeller/entity/entity.h"
17 #include "impeller/geometry/color.h"
18 #include "impeller/geometry/matrix.h"
19 #include "impeller/geometry/point.h"
20 #include "impeller/geometry/rect.h"
21 #include "impeller/geometry/size.h"
22 #include "impeller/toolkit/interop/impeller.h"
23
24 #include "flutter/third_party/skia/include/core/SkM44.h"
25 #include "flutter/third_party/skia/include/core/SkPath.h"
26 #include "flutter/third_party/skia/include/core/SkRRect.h"
27
28 namespace impeller::interop {
29
30 constexpr std::optional<SkRect> ToSkiaType(const ImpellerRect* rect) {
31 if (!rect) {
32 return std::nullopt;
33 }
34 return SkRect::MakeXYWH(rect->x, rect->y, rect->width, rect->height);
35 }
36
37 constexpr SkPoint ToSkiaType(const Point& point) {
38 return SkPoint::Make(point.x, point.y);
39 }
40
41 constexpr SkColor ToSkiaType(const ImpellerColor& color) {
42 return SkColorSetARGB(color.alpha * 255, //
43 color.red * 255, //
44 color.green * 255, //
45 color.blue * 255 //
46 );
47 }
48
49 constexpr SkVector ToSkiaVector(const Size& point) {
50 return SkVector::Make(point.width, point.height);
51 }
52
53 constexpr SkRect ToSkiaType(const Rect& rect) {
54 return SkRect::MakeXYWH(rect.GetX(), //
55 rect.GetY(), //
56 rect.GetWidth(), //
57 rect.GetHeight() //
58 );
59 }
60
61 constexpr SkPathFillType ToSkiaType(FillType type) {
62 switch (type) {
63 case FillType::kNonZero:
64 return SkPathFillType::kWinding;
65 case FillType::kOdd:
66 return SkPathFillType::kEvenOdd;
67 }
68 return SkPathFillType::kWinding;
69 }
70
71 constexpr SkIRect ToSkiaType(IRect rect) {
72 return SkIRect::MakeXYWH(rect.GetX(), //
73 rect.GetY(), //
74 rect.GetWidth(), //
75 rect.GetHeight() //
76 );
77 }
78
79 template <class SkiaType, class OtherType>
80 std::vector<SkiaType> ToSkiaType(const std::vector<OtherType>& other_vec) {
81 std::vector<SkiaType> skia_vec;
82 skia_vec.reserve(other_vec.size());
83 for (const auto& other : other_vec) {
84 skia_vec.emplace_back(ToSkiaType(other));
85 }
86 return skia_vec;
87 }
88
89 constexpr flutter::DlColor ToDisplayListType(Color color) {
90 return flutter::DlColor::RGBA(color.red, //
91 color.green, //
92 color.blue, //
93 color.alpha //
94 );
95 }
96
97 inline SkMatrix ToSkMatrix(const Matrix& matrix) {
98 return SkM44::ColMajor(matrix.m).asM33();
99 }
100
101 template <class DlType, class OtherType>
102 std::vector<DlType> ToDisplayListType(const std::vector<OtherType>& other_vec) {
103 std::vector<DlType> dl_vec;
104 dl_vec.reserve(other_vec.size());
105 for (const auto& other : other_vec) {
106 dl_vec.emplace_back(ToDisplayListType(other));
107 }
108 return dl_vec;
109 }
110
111 constexpr flutter::DlImageSampling ToDisplayListType(
112 ImpellerTextureSampling sampling) {
113 switch (sampling) {
114 case kImpellerTextureSamplingNearestNeighbor:
115 return flutter::DlImageSampling::kNearestNeighbor;
116 case kImpellerTextureSamplingLinear:
117 return flutter::DlImageSampling::kLinear;
118 }
119 return flutter::DlImageSampling::kLinear;
120 }
121
122 constexpr flutter::DlBlurStyle ToDisplayListType(ImpellerBlurStyle style) {
123 switch (style) {
124 case kImpellerBlurStyleNormal:
125 return flutter::DlBlurStyle::kNormal;
126 case kImpellerBlurStyleSolid:
127 return flutter::DlBlurStyle::kSolid;
128 case kImpellerBlurStyleOuter:
129 return flutter::DlBlurStyle::kOuter;
130 case kImpellerBlurStyleInner:
131 return flutter::DlBlurStyle::kInner;
132 }
133 return flutter::DlBlurStyle::kNormal;
134 }
135
136 constexpr flutter::DlBlendMode ToDisplayListType(BlendMode mode) {
137 using Mode = flutter::DlBlendMode;
138 switch (mode) {
139 case BlendMode::kClear:
140 return Mode::kClear;
141 case BlendMode::kSrc:
142 return Mode::kSrc;
143 case BlendMode::kDst:
144 return Mode::kDst;
145 case BlendMode::kSrcOver:
146 return Mode::kSrcOver;
147 case BlendMode::kDstOver:
148 return Mode::kDstOver;
149 case BlendMode::kSrcIn:
150 return Mode::kSrcIn;
151 case BlendMode::kDstIn:
152 return Mode::kDstIn;
153 case BlendMode::kSrcOut:
154 return Mode::kSrcOut;
155 case BlendMode::kDstOut:
156 return Mode::kDstOut;
157 case BlendMode::kSrcATop:
158 return Mode::kSrcATop;
159 case BlendMode::kDstATop:
160 return Mode::kDstATop;
161 case BlendMode::kXor:
162 return Mode::kXor;
163 case BlendMode::kPlus:
164 return Mode::kPlus;
165 case BlendMode::kModulate:
166 return Mode::kModulate;
167 case BlendMode::kScreen:
168 return Mode::kScreen;
169 case BlendMode::kOverlay:
170 return Mode::kOverlay;
171 case BlendMode::kDarken:
172 return Mode::kDarken;
173 case BlendMode::kLighten:
174 return Mode::kLighten;
175 case BlendMode::kColorDodge:
176 return Mode::kColorDodge;
177 case BlendMode::kColorBurn:
178 return Mode::kColorBurn;
179 case BlendMode::kHardLight:
180 return Mode::kHardLight;
181 case BlendMode::kSoftLight:
182 return Mode::kSoftLight;
183 case BlendMode::kDifference:
184 return Mode::kDifference;
185 case BlendMode::kExclusion:
186 return Mode::kExclusion;
187 case BlendMode::kMultiply:
188 return Mode::kMultiply;
189 case BlendMode::kHue:
190 return Mode::kHue;
191 case BlendMode::kSaturation:
192 return Mode::kSaturation;
193 case BlendMode::kColor:
194 return Mode::kColor;
195 case BlendMode::kLuminosity:
196 return Mode::kLuminosity;
197 }
198 return Mode::kSrcOver;
199 }
200
201 inline SkRRect ToSkiaType(const Rect& rect, const RoundingRadii& radii) {
202 using Corner = SkRRect::Corner;
203 SkVector sk_radii[4];
204 sk_radii[Corner::kUpperLeft_Corner] = ToSkiaVector(radii.top_left);
205 sk_radii[Corner::kUpperRight_Corner] = ToSkiaVector(radii.top_right);
206 sk_radii[Corner::kLowerRight_Corner] = ToSkiaVector(radii.bottom_right);
207 sk_radii[Corner::kLowerLeft_Corner] = ToSkiaVector(radii.bottom_left);
208 SkRRect result;
209 result.setRectRadii(ToSkiaType(rect), sk_radii);
210 return result;
211 }
212
213 constexpr Matrix ToImpellerType(const ImpellerMatrix& m) {
214 return Matrix(m.m[0], m.m[1], m.m[2], m.m[3], //
215 m.m[4], m.m[5], m.m[6], m.m[7], //
216 m.m[8], m.m[9], m.m[10], m.m[11], //
217 m.m[12], m.m[13], m.m[14], m.m[15] //
218 );
219 }
220
221 constexpr void FromImpellerType(const Matrix& from, ImpellerMatrix& to) {
222 to.m[0] = from.m[0];
223 to.m[1] = from.m[1];
224 to.m[2] = from.m[2];
225 to.m[3] = from.m[3];
226 to.m[4] = from.m[4];
227 to.m[5] = from.m[5];
228 to.m[6] = from.m[6];
229 to.m[7] = from.m[7];
230 to.m[8] = from.m[8];
231 to.m[9] = from.m[9];
232 to.m[10] = from.m[10];
233 to.m[11] = from.m[11];
234 to.m[12] = from.m[12];
235 to.m[13] = from.m[13];
236 to.m[14] = from.m[14];
237 to.m[15] = from.m[15];
238 }
239
240 constexpr Size ToImpellerType(const ImpellerSize& size) {
241 return Size{size.width, size.height};
242 }
243
244 constexpr Point ToImpellerType(const ImpellerPoint& point) {
245 return Point{point.x, point.y};
246 }
247
248 constexpr Size ToImpellerSize(const ImpellerPoint& point) {
249 return Size{point.x, point.y};
250 }
251
252 constexpr Rect ToImpellerType(const ImpellerRect& rect) {
253 return Rect::MakeXYWH(rect.x, rect.y, rect.width, rect.height);
254 }
255
256 constexpr flutter::DlTileMode ToDisplayListType(ImpellerTileMode mode) {
257 switch (mode) {
258 case kImpellerTileModeClamp:
259 return flutter::DlTileMode::kClamp;
260 case kImpellerTileModeRepeat:
261 return flutter::DlTileMode::kRepeat;
262 case kImpellerTileModeMirror:
263 return flutter::DlTileMode::kMirror;
264 case kImpellerTileModeDecal:
265 return flutter::DlTileMode::kDecal;
266 }
267 return flutter::DlTileMode::kClamp;
268 }
269
270 constexpr RoundingRadii ToImpellerType(const ImpellerRoundingRadii& radii) {
271 auto result = RoundingRadii{};
272 result.top_left = ToImpellerSize(radii.top_left);
273 result.bottom_left = ToImpellerSize(radii.bottom_left);
274 result.top_right = ToImpellerSize(radii.top_right);
275 result.bottom_right = ToImpellerSize(radii.bottom_right);
276 return result;
277 }
278
279 constexpr FillType ToImpellerType(ImpellerFillType type) {
280 switch (type) {
281 case kImpellerFillTypeNonZero:
282 return FillType::kNonZero;
283 case kImpellerFillTypeOdd:
284 return FillType::kOdd;
285 }
286 return FillType::kNonZero;
287 }
288
289 constexpr flutter::DlClipOp ToImpellerType(ImpellerClipOperation op) {
290 switch (op) {
291 case kImpellerClipOperationDifference:
292 return flutter::DlClipOp::kDifference;
293 case kImpellerClipOperationIntersect:
294 return flutter::DlClipOp::kIntersect;
295 }
296 return flutter::DlClipOp::kDifference;
297 }
298
299 constexpr Color ToImpellerType(const ImpellerColor& color) {
300 Color result;
301 result.red = color.red;
302 result.green = color.green;
303 result.blue = color.blue;
304 result.alpha = color.alpha;
305 return result;
306 }
307
308 constexpr BlendMode ToImpellerType(ImpellerBlendMode mode) {
309 switch (mode) {
310 case kImpellerBlendModeClear:
311 return BlendMode::kClear;
312 case kImpellerBlendModeSource:
313 return BlendMode::kSrc;
314 case kImpellerBlendModeDestination:
315 return BlendMode::kDst;
316 case kImpellerBlendModeSourceOver:
317 return BlendMode::kSrcOver;
318 case kImpellerBlendModeDestinationOver:
319 return BlendMode::kDstOver;
320 case kImpellerBlendModeSourceIn:
321 return BlendMode::kSrcIn;
322 case kImpellerBlendModeDestinationIn:
323 return BlendMode::kDstIn;
324 case kImpellerBlendModeSourceOut:
325 return BlendMode::kSrcOut;
326 case kImpellerBlendModeDestinationOut:
327 return BlendMode::kDstOut;
328 case kImpellerBlendModeSourceATop:
329 return BlendMode::kSrcATop;
330 case kImpellerBlendModeDestinationATop:
331 return BlendMode::kDstATop;
332 case kImpellerBlendModeXor:
333 return BlendMode::kXor;
334 case kImpellerBlendModePlus:
335 return BlendMode::kPlus;
336 case kImpellerBlendModeModulate:
337 return BlendMode::kModulate;
338 case kImpellerBlendModeScreen:
339 return BlendMode::kScreen;
340 case kImpellerBlendModeOverlay:
341 return BlendMode::kOverlay;
342 case kImpellerBlendModeDarken:
343 return BlendMode::kDarken;
344 case kImpellerBlendModeLighten:
345 return BlendMode::kLighten;
346 case kImpellerBlendModeColorDodge:
347 return BlendMode::kColorDodge;
348 case kImpellerBlendModeColorBurn:
349 return BlendMode::kColorBurn;
350 case kImpellerBlendModeHardLight:
351 return BlendMode::kHardLight;
352 case kImpellerBlendModeSoftLight:
353 return BlendMode::kSoftLight;
354 case kImpellerBlendModeDifference:
355 return BlendMode::kDifference;
356 case kImpellerBlendModeExclusion:
357 return BlendMode::kExclusion;
358 case kImpellerBlendModeMultiply:
359 return BlendMode::kMultiply;
360 case kImpellerBlendModeHue:
361 return BlendMode::kHue;
362 case kImpellerBlendModeSaturation:
363 return BlendMode::kSaturation;
364 case kImpellerBlendModeColor:
365 return BlendMode::kColor;
366 case kImpellerBlendModeLuminosity:
367 return BlendMode::kLuminosity;
368 }
369 return BlendMode::kSrcOver;
370 }
371
372 constexpr flutter::DlDrawStyle ToDisplayListType(ImpellerDrawStyle style) {
373 switch (style) {
374 case kImpellerDrawStyleFill:
375 return flutter::DlDrawStyle::kFill;
376 case kImpellerDrawStyleStroke:
377 return flutter::DlDrawStyle::kStroke;
378 case kImpellerDrawStyleStrokeAndFill:
379 return flutter::DlDrawStyle::kStrokeAndFill;
380 }
381 return flutter::DlDrawStyle::kFill;
382 }
383
384 constexpr flutter::DlStrokeCap ToDisplayListType(ImpellerStrokeCap cap) {
385 switch (cap) {
386 case kImpellerStrokeCapButt:
387 return flutter::DlStrokeCap::kButt;
388 case kImpellerStrokeCapRound:
389 return flutter::DlStrokeCap::kRound;
390 case kImpellerStrokeCapSquare:
391 return flutter::DlStrokeCap::kSquare;
392 }
393 return flutter::DlStrokeCap::kButt;
394 }
395
396 constexpr flutter::DlStrokeJoin ToDisplayListType(ImpellerStrokeJoin join) {
397 switch (join) {
398 case kImpellerStrokeJoinMiter:
399 return flutter::DlStrokeJoin::kMiter;
400 case kImpellerStrokeJoinRound:
401 return flutter::DlStrokeJoin::kRound;
402 case kImpellerStrokeJoinBevel:
403 return flutter::DlStrokeJoin::kBevel;
404 }
405 return flutter::DlStrokeJoin::kMiter;
406 }
407
408 constexpr PixelFormat ToImpellerType(ImpellerPixelFormat format) {
409 switch (format) {
410 case kImpellerPixelFormatRGBA8888:
411 return PixelFormat::kR8G8B8A8UNormInt;
412 }
413 return PixelFormat::kR8G8B8A8UNormInt;
414 }
415
416 constexpr ISize ToImpellerType(const ImpellerISize& size) {
417 return ISize::MakeWH(size.width, size.height);
418 }
419
420 constexpr flutter::DlColorSpace ToDisplayListType(
421 ImpellerColorSpace color_space) {
422 switch (color_space) {
423 case kImpellerColorSpaceSRGB:
424 return flutter::DlColorSpace::kSRGB;
425 case kImpellerColorSpaceExtendedSRGB:
426 return flutter::DlColorSpace::kExtendedSRGB;
427 case kImpellerColorSpaceDisplayP3:
428 return flutter::DlColorSpace::kDisplayP3;
429 }
430 return flutter::DlColorSpace::kSRGB;
431 }
432
433 constexpr flutter::DlColor ToDisplayListType(ImpellerColor color) {
434 return flutter::DlColor(color.alpha, //
435 color.red, //
436 color.green, //
437 color.blue, //
438 ToDisplayListType(color.color_space) //
439 );
440 }
441
442 constexpr txt::TextDecorationStyle ToTxtType(
443 ImpellerTextDecorationStyle style) {
444 switch (style) {
445 case kImpellerTextDecorationStyleSolid:
446 return txt::TextDecorationStyle::kSolid;
447 case kImpellerTextDecorationStyleDouble:
448 return txt::TextDecorationStyle::kDouble;
449 case kImpellerTextDecorationStyleDotted:
450 return txt::TextDecorationStyle::kDotted;
451 case kImpellerTextDecorationStyleDashed:
452 return txt::TextDecorationStyle::kDashed;
453 case kImpellerTextDecorationStyleWavy:
454 return txt::TextDecorationStyle::kWavy;
455 }
456 return txt::TextDecorationStyle::kSolid;
457 }
458
459 constexpr txt::FontWeight ToTxtType(ImpellerFontWeight weight) {
460 switch (weight) {
461 case kImpellerFontWeight100:
462 return txt::FontWeight::w100;
463 case kImpellerFontWeight200:
464 return txt::FontWeight::w200;
465 case kImpellerFontWeight300:
466 return txt::FontWeight::w300;
467 case kImpellerFontWeight400:
468 return txt::FontWeight::w400;
469 case kImpellerFontWeight500:
470 return txt::FontWeight::w500;
471 case kImpellerFontWeight600:
472 return txt::FontWeight::w600;
473 case kImpellerFontWeight700:
474 return txt::FontWeight::w700;
475 case kImpellerFontWeight800:
476 return txt::FontWeight::w800;
477 case kImpellerFontWeight900:
478 return txt::FontWeight::w900;
479 }
480 return txt::FontWeight::w400;
481 }
482
483 constexpr txt::FontStyle ToTxtType(ImpellerFontStyle style) {
484 switch (style) {
485 case kImpellerFontStyleNormal:
486 return txt::FontStyle::normal;
487 case kImpellerFontStyleItalic:
488 return txt::FontStyle::italic;
489 }
490 return txt::FontStyle::normal;
491 }
492
493 constexpr txt::TextAlign ToTxtType(ImpellerTextAlignment align) {
494 switch (align) {
495 case kImpellerTextAlignmentLeft:
496 return txt::TextAlign::left;
497 case kImpellerTextAlignmentRight:
498 return txt::TextAlign::right;
499 case kImpellerTextAlignmentCenter:
500 return txt::TextAlign::center;
501 case kImpellerTextAlignmentJustify:
502 return txt::TextAlign::justify;
503 case kImpellerTextAlignmentStart:
504 return txt::TextAlign::start;
505 case kImpellerTextAlignmentEnd:
506 return txt::TextAlign::end;
507 }
508 return txt::TextAlign::left;
509 }
510
511 constexpr txt::TextDirection ToTxtType(ImpellerTextDirection direction) {
512 switch (direction) {
513 case kImpellerTextDirectionRTL:
514 return txt::TextDirection::rtl;
515 case kImpellerTextDirectionLTR:
516 return txt::TextDirection::ltr;
517 }
518 return txt::TextDirection::ltr;
519 }
520
521 } // namespace impeller::interop
522
523 #endif // FLUTTER_IMPELLER_TOOLKIT_INTEROP_FORMATS_H_
type
GLenum type
Definition: blit_command_gles.cc:151
color.h
entity.h
impeller.h
ImpellerFillType
ImpellerFillType
Definition: impeller.h:364
kImpellerFillTypeOdd
@ kImpellerFillTypeOdd
Definition: impeller.h:366
kImpellerFillTypeNonZero
@ kImpellerFillTypeNonZero
Definition: impeller.h:365
ImpellerTextDirection
ImpellerTextDirection
Definition: impeller.h:479
kImpellerTextDirectionLTR
@ kImpellerTextDirectionLTR
Definition: impeller.h:481
kImpellerTextDirectionRTL
@ kImpellerTextDirectionRTL
Definition: impeller.h:480
ImpellerTextureSampling
ImpellerTextureSampling
Definition: impeller.h:428
kImpellerTextureSamplingNearestNeighbor
@ kImpellerTextureSamplingNearestNeighbor
Definition: impeller.h:429
kImpellerTextureSamplingLinear
@ kImpellerTextureSamplingLinear
Definition: impeller.h:430
ImpellerTextDecorationStyle
ImpellerTextDecorationStyle
Definition: impeller.h:491
kImpellerTextDecorationStyleSolid
@ kImpellerTextDecorationStyleSolid
Definition: impeller.h:492
kImpellerTextDecorationStyleWavy
@ kImpellerTextDecorationStyleWavy
Definition: impeller.h:496
kImpellerTextDecorationStyleDouble
@ kImpellerTextDecorationStyleDouble
Definition: impeller.h:493
kImpellerTextDecorationStyleDotted
@ kImpellerTextDecorationStyleDotted
Definition: impeller.h:494
kImpellerTextDecorationStyleDashed
@ kImpellerTextDecorationStyleDashed
Definition: impeller.h:495
ImpellerStrokeJoin
ImpellerStrokeJoin
Definition: impeller.h:418
kImpellerStrokeJoinRound
@ kImpellerStrokeJoinRound
Definition: impeller.h:420
kImpellerStrokeJoinBevel
@ kImpellerStrokeJoinBevel
Definition: impeller.h:421
kImpellerStrokeJoinMiter
@ kImpellerStrokeJoinMiter
Definition: impeller.h:419
ImpellerBlendMode
ImpellerBlendMode
Definition: impeller.h:374
kImpellerBlendModeSaturation
@ kImpellerBlendModeSaturation
Definition: impeller.h:401
kImpellerBlendModeSoftLight
@ kImpellerBlendModeSoftLight
Definition: impeller.h:396
kImpellerBlendModeHardLight
@ kImpellerBlendModeHardLight
Definition: impeller.h:395
kImpellerBlendModeLuminosity
@ kImpellerBlendModeLuminosity
Definition: impeller.h:403
kImpellerBlendModeLighten
@ kImpellerBlendModeLighten
Definition: impeller.h:392
kImpellerBlendModeModulate
@ kImpellerBlendModeModulate
Definition: impeller.h:388
kImpellerBlendModeSourceIn
@ kImpellerBlendModeSourceIn
Definition: impeller.h:380
kImpellerBlendModeDifference
@ kImpellerBlendModeDifference
Definition: impeller.h:397
kImpellerBlendModeClear
@ kImpellerBlendModeClear
Definition: impeller.h:375
kImpellerBlendModeColor
@ kImpellerBlendModeColor
Definition: impeller.h:402
kImpellerBlendModeMultiply
@ kImpellerBlendModeMultiply
Definition: impeller.h:399
kImpellerBlendModeSourceATop
@ kImpellerBlendModeSourceATop
Definition: impeller.h:384
kImpellerBlendModeDestinationOut
@ kImpellerBlendModeDestinationOut
Definition: impeller.h:383
kImpellerBlendModeScreen
@ kImpellerBlendModeScreen
Definition: impeller.h:389
kImpellerBlendModeExclusion
@ kImpellerBlendModeExclusion
Definition: impeller.h:398
kImpellerBlendModeColorBurn
@ kImpellerBlendModeColorBurn
Definition: impeller.h:394
kImpellerBlendModeDarken
@ kImpellerBlendModeDarken
Definition: impeller.h:391
kImpellerBlendModePlus
@ kImpellerBlendModePlus
Definition: impeller.h:387
kImpellerBlendModeOverlay
@ kImpellerBlendModeOverlay
Definition: impeller.h:390
kImpellerBlendModeDestinationIn
@ kImpellerBlendModeDestinationIn
Definition: impeller.h:381
kImpellerBlendModeDestinationATop
@ kImpellerBlendModeDestinationATop
Definition: impeller.h:385
kImpellerBlendModeDestination
@ kImpellerBlendModeDestination
Definition: impeller.h:377
kImpellerBlendModeSourceOver
@ kImpellerBlendModeSourceOver
Definition: impeller.h:378
kImpellerBlendModeXor
@ kImpellerBlendModeXor
Definition: impeller.h:386
kImpellerBlendModeColorDodge
@ kImpellerBlendModeColorDodge
Definition: impeller.h:393
kImpellerBlendModeDestinationOver
@ kImpellerBlendModeDestinationOver
Definition: impeller.h:379
kImpellerBlendModeSource
@ kImpellerBlendModeSource
Definition: impeller.h:376
kImpellerBlendModeSourceOut
@ kImpellerBlendModeSourceOut
Definition: impeller.h:382
kImpellerBlendModeHue
@ kImpellerBlendModeHue
Definition: impeller.h:400
ImpellerFontWeight
ImpellerFontWeight
Definition: impeller.h:453
kImpellerFontWeight400
@ kImpellerFontWeight400
Definition: impeller.h:457
kImpellerFontWeight500
@ kImpellerFontWeight500
Definition: impeller.h:458
kImpellerFontWeight700
@ kImpellerFontWeight700
Definition: impeller.h:460
kImpellerFontWeight200
@ kImpellerFontWeight200
Definition: impeller.h:455
kImpellerFontWeight300
@ kImpellerFontWeight300
Definition: impeller.h:456
kImpellerFontWeight900
@ kImpellerFontWeight900
Definition: impeller.h:462
kImpellerFontWeight800
@ kImpellerFontWeight800
Definition: impeller.h:461
kImpellerFontWeight600
@ kImpellerFontWeight600
Definition: impeller.h:459
kImpellerFontWeight100
@ kImpellerFontWeight100
Definition: impeller.h:454
ImpellerStrokeCap
ImpellerStrokeCap
Definition: impeller.h:412
kImpellerStrokeCapButt
@ kImpellerStrokeCapButt
Definition: impeller.h:413
kImpellerStrokeCapRound
@ kImpellerStrokeCapRound
Definition: impeller.h:414
kImpellerStrokeCapSquare
@ kImpellerStrokeCapSquare
Definition: impeller.h:415
ImpellerDrawStyle
ImpellerDrawStyle
Definition: impeller.h:406
kImpellerDrawStyleStroke
@ kImpellerDrawStyleStroke
Definition: impeller.h:408
kImpellerDrawStyleFill
@ kImpellerDrawStyleFill
Definition: impeller.h:407
kImpellerDrawStyleStrokeAndFill
@ kImpellerDrawStyleStrokeAndFill
Definition: impeller.h:409
ImpellerColorSpace
ImpellerColorSpace
Definition: impeller.h:447
kImpellerColorSpaceExtendedSRGB
@ kImpellerColorSpaceExtendedSRGB
Definition: impeller.h:449
kImpellerColorSpaceSRGB
@ kImpellerColorSpaceSRGB
Definition: impeller.h:448
kImpellerColorSpaceDisplayP3
@ kImpellerColorSpaceDisplayP3
Definition: impeller.h:450
ImpellerTileMode
ImpellerTileMode
Definition: impeller.h:433
kImpellerTileModeMirror
@ kImpellerTileModeMirror
Definition: impeller.h:436
kImpellerTileModeClamp
@ kImpellerTileModeClamp
Definition: impeller.h:434
kImpellerTileModeRepeat
@ kImpellerTileModeRepeat
Definition: impeller.h:435
kImpellerTileModeDecal
@ kImpellerTileModeDecal
Definition: impeller.h:437
ImpellerTextAlignment
ImpellerTextAlignment
Definition: impeller.h:470
kImpellerTextAlignmentJustify
@ kImpellerTextAlignmentJustify
Definition: impeller.h:474
kImpellerTextAlignmentLeft
@ kImpellerTextAlignmentLeft
Definition: impeller.h:471
kImpellerTextAlignmentCenter
@ kImpellerTextAlignmentCenter
Definition: impeller.h:473
kImpellerTextAlignmentRight
@ kImpellerTextAlignmentRight
Definition: impeller.h:472
kImpellerTextAlignmentStart
@ kImpellerTextAlignmentStart
Definition: impeller.h:475
kImpellerTextAlignmentEnd
@ kImpellerTextAlignmentEnd
Definition: impeller.h:476
ImpellerFontStyle
ImpellerFontStyle
Definition: impeller.h:465
kImpellerFontStyleItalic
@ kImpellerFontStyleItalic
Definition: impeller.h:467
kImpellerFontStyleNormal
@ kImpellerFontStyleNormal
Definition: impeller.h:466
ImpellerClipOperation
ImpellerClipOperation
Definition: impeller.h:369
kImpellerClipOperationIntersect
@ kImpellerClipOperationIntersect
Definition: impeller.h:371
kImpellerClipOperationDifference
@ kImpellerClipOperationDifference
Definition: impeller.h:370
ImpellerBlurStyle
ImpellerBlurStyle
Definition: impeller.h:440
kImpellerBlurStyleNormal
@ kImpellerBlurStyleNormal
Definition: impeller.h:441
kImpellerBlurStyleOuter
@ kImpellerBlurStyleOuter
Definition: impeller.h:443
kImpellerBlurStyleInner
@ kImpellerBlurStyleInner
Definition: impeller.h:444
kImpellerBlurStyleSolid
@ kImpellerBlurStyleSolid
Definition: impeller.h:442
ImpellerPixelFormat
ImpellerPixelFormat
Definition: impeller.h:424
kImpellerPixelFormatRGBA8888
@ kImpellerPixelFormatRGBA8888
Definition: impeller.h:425
matrix.h
impeller::interop
Definition: context_gles.cc:12
impeller::interop::ToSkiaVector
constexpr SkVector ToSkiaVector(const Size &point)
Definition: formats.h:49
impeller::interop::ToTxtType
constexpr txt::TextDecorationStyle ToTxtType(ImpellerTextDecorationStyle style)
Definition: formats.h:442
impeller::interop::ToSkMatrix
SkMatrix ToSkMatrix(const Matrix &matrix)
Definition: formats.h:97
impeller::interop::ToImpellerType
constexpr Matrix ToImpellerType(const ImpellerMatrix &m)
Definition: formats.h:213
impeller::interop::ToImpellerSize
constexpr Size ToImpellerSize(const ImpellerPoint &point)
Definition: formats.h:248
impeller::interop::FromImpellerType
constexpr void FromImpellerType(const Matrix &from, ImpellerMatrix &to)
Definition: formats.h:221
impeller::interop::ToDisplayListType
constexpr flutter::DlColor ToDisplayListType(Color color)
Definition: formats.h:89
impeller::interop::ToSkiaType
constexpr std::optional< SkRect > ToSkiaType(const ImpellerRect *rect)
Definition: formats.h:30
impeller::FillType
FillType
Definition: path_source.h:13
impeller::FillType::kOdd
@ kOdd
impeller::FillType::kNonZero
@ kNonZero
impeller::PixelFormat
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
Definition: formats.h:99
impeller::PixelFormat::kR8G8B8A8UNormInt
@ kR8G8B8A8UNormInt
impeller::BlendMode
BlendMode
Definition: color.h:58
impeller::BlendMode::kSrcOut
@ kSrcOut
impeller::BlendMode::kExclusion
@ kExclusion
impeller::BlendMode::kSaturation
@ kSaturation
impeller::BlendMode::kColorBurn
@ kColorBurn
impeller::BlendMode::kPlus
@ kPlus
impeller::BlendMode::kLighten
@ kLighten
impeller::BlendMode::kHue
@ kHue
impeller::BlendMode::kDst
@ kDst
impeller::BlendMode::kDstIn
@ kDstIn
impeller::BlendMode::kModulate
@ kModulate
impeller::BlendMode::kMultiply
@ kMultiply
impeller::BlendMode::kColorDodge
@ kColorDodge
impeller::BlendMode::kScreen
@ kScreen
impeller::BlendMode::kSrcOver
@ kSrcOver
impeller::BlendMode::kXor
@ kXor
impeller::BlendMode::kSrc
@ kSrc
impeller::BlendMode::kLuminosity
@ kLuminosity
impeller::BlendMode::kSoftLight
@ kSoftLight
impeller::BlendMode::kDifference
@ kDifference
impeller::BlendMode::kOverlay
@ kOverlay
impeller::BlendMode::kSrcATop
@ kSrcATop
impeller::BlendMode::kDstATop
@ kDstATop
impeller::BlendMode::kDstOver
@ kDstOver
impeller::BlendMode::kColor
@ kColor
impeller::BlendMode::kHardLight
@ kHardLight
impeller::BlendMode::kDstOut
@ kDstOut
impeller::BlendMode::kDarken
@ kDarken
impeller::BlendMode::kSrcIn
@ kSrcIn
impeller::BlendMode::kClear
@ kClear
point.h
rect.h
size.h
ImpellerColor
Definition: impeller.h:612
ImpellerColor::blue
float blue
Definition: impeller.h:615
ImpellerColor::alpha
float alpha
Definition: impeller.h:616
ImpellerColor::red
float red
Definition: impeller.h:613
ImpellerColor::green
float green
Definition: impeller.h:614
ImpellerColor::color_space
ImpellerColorSpace color_space
Definition: impeller.h:617
ImpellerISize
Definition: impeller.h:519
ImpellerISize::height
int64_t height
Definition: impeller.h:521
ImpellerISize::width
int64_t width
Definition: impeller.h:520
ImpellerMatrix
Definition: impeller.h:539
ImpellerMatrix::m
float m[16]
Definition: impeller.h:540
ImpellerPoint
Definition: impeller.h:509
ImpellerPoint::x
float x
Definition: impeller.h:510
ImpellerPoint::y
float y
Definition: impeller.h:511
ImpellerRect
Definition: impeller.h:502
ImpellerRect::x
float x
Definition: impeller.h:503
ImpellerRect::width
float width
Definition: impeller.h:505
ImpellerRect::height
float height
Definition: impeller.h:506
ImpellerRect::y
float y
Definition: impeller.h:504
ImpellerRoundingRadii
Definition: impeller.h:605
ImpellerRoundingRadii::top_left
ImpellerPoint top_left
Definition: impeller.h:606
ImpellerRoundingRadii::top_right
ImpellerPoint top_right
Definition: impeller.h:608
ImpellerRoundingRadii::bottom_left
ImpellerPoint bottom_left
Definition: impeller.h:607
ImpellerRoundingRadii::bottom_right
ImpellerPoint bottom_right
Definition: impeller.h:609
ImpellerSize
Definition: impeller.h:514
ImpellerSize::height
float height
Definition: impeller.h:516
ImpellerSize::width
float width
Definition: impeller.h:515
impeller::Color
Definition: color.h:124
impeller::Color::blue
Scalar blue
Definition: color.h:138
impeller::Color::alpha
Scalar alpha
Definition: color.h:143
impeller::Color::red
Scalar red
Definition: color.h:128
impeller::Color::green
Scalar green
Definition: color.h:133
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:37
impeller::Matrix::m
Scalar m[16]
Definition: matrix.h:39
impeller::RoundingRadii
Definition: rounding_radii.h:14
impeller::RoundingRadii::top_right
Size top_right
Definition: rounding_radii.h:16
impeller::RoundingRadii::bottom_left
Size bottom_left
Definition: rounding_radii.h:17
impeller::RoundingRadii::bottom_right
Size bottom_right
Definition: rounding_radii.h:18
impeller::RoundingRadii::top_left
Size top_left
Definition: rounding_radii.h:15
impeller::TPoint< Scalar >
impeller::TPoint::y
Type y
Definition: point.h:31
impeller::TPoint::x
Type x
Definition: point.h:30
impeller::TRect< Scalar >
impeller::TRect::GetY
constexpr Type GetY() const
Returns the Y coordinate of the upper left corner, equivalent to |GetOrigin().y|.
Definition: rect.h:341
impeller::TRect::GetHeight
constexpr Type GetHeight() const
Returns the height of the rectangle, equivalent to |GetSize().height|.
Definition: rect.h:351
impeller::TRect::GetX
constexpr Type GetX() const
Returns the X coordinate of the upper left corner, equivalent to |GetOrigin().x|.
Definition: rect.h:337
impeller::TRect< Scalar >::MakeXYWH
constexpr static TRect MakeXYWH(Type x, Type y, Type width, Type height)
Definition: rect.h:136
impeller::TRect::GetWidth
constexpr Type GetWidth() const
Returns the width of the rectangle, equivalent to |GetSize().width|.
Definition: rect.h:345
impeller::TSize< Scalar >
impeller::TSize::height
Type height
Definition: size.h:29
impeller::TSize::width
Type width
Definition: size.h:28
impeller::TSize::MakeWH
static constexpr TSize MakeWH(Type width, Type height)
Definition: size.h:43
start
const size_t start
Definition: tessellator_libtess.cc:62
end
const size_t end
Definition: tessellator_libtess.cc:63