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