10namespace skia_conversions {
31 if (
rect ==
nullptr) {
38 auto result = std::vector<Rect>();
76 auto verb = SkPath::Verb::kDone_Verb;
78 verb = iterator.next(
data.points);
91 constexpr auto kPow2 = 1;
92 constexpr auto kQuadCount = 1 + (2 * (1 << kPow2));
94 const auto curve_count =
98 iterator.conicWeight(),
103 for (
int curve_index = 0, point_index = 0;
104 curve_index < curve_count;
105 curve_index++, point_index += 2
121 }
while (verb != SkPath::Verb::kDone_Verb);
124 switch (
path.getFillType()) {
141 auto sk_bounds =
path.getBounds().makeOutset(shift.
x, shift.
y);
143 return builder.TakePath(fill_type);
172 auto result = std::vector<Matrix>();
174 auto form = xform[
i];
177 form.fSCos, form.fSSin, 0, 0,
178 -form.fSSin, form.fSCos, 0, 0,
180 form.fTx, form.fTy, 0, 1
213 std::vector<Color>&
colors,
214 std::vector<float>& stops) {
217 auto* dl_colors = gradient->
colors();
218 auto* dl_stops = gradient->
stops();
219 if (dl_stops[0] != 0.0) {
221 stops.emplace_back(0);
225 stops.emplace_back(
std::clamp(dl_stops[
i], 0.0f, 1.0f));
227 if (dl_stops[gradient->
stop_count() - 1] != 1.0) {
229 stops.emplace_back(1.0);
static const int points[]
static unsigned clamp(SkFixed fx, int max)
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
@ kRGBA_F16_SkColorType
pixel with half floats for red, green, blue, alpha;
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
@ kBGR_101010x_XR_SkColorType
pixel with 10 bits each for blue, green, red; in 32-bit word, extended range
static bool SkScalarNearlyEqual(SkScalar x, SkScalar y, SkScalar tolerance=SK_ScalarNearlyZero)
static int ConvertConicToQuads(const SkPoint &p0, const SkPoint &p1, const SkPoint &p2, SkScalar w, SkPoint pts[], int pow2)
SkVector radii(Corner corner) const
@ kUpperLeft_Corner
index of top-left corner radii
@ kLowerRight_Corner
index of bottom-right corner radii
@ kUpperRight_Corner
index of top-right corner radii
@ kLowerLeft_Corner
index of bottom-left corner radii
const SkRect & getBounds() const
const DlColor * colors() const
const float * stops() const
Path TakePath(FillType fill=FillType::kNonZero)
PathBuilder & SetBounds(Rect bounds)
Set the bounding box that will be used by Path.GetBoundingBox in place of performing the computation.
PathBuilder & AddRoundedRect(Rect rect, RoundingRadii radii)
PathBuilder & SetConvexity(Convexity value)
Paths are lightweight objects that describe a collection of linear, quadratic, or cubic segments....
static SkPath GetPath(SkTextBlob *textBlob)
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
#define FML_DCHECK(condition)
unsigned useCenter Optional< SkMatrix > matrix
sk_sp< SkBlender > blender SkRect rect
PODArray< SkColor > colors
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
std::optional< impeller::PixelFormat > ToPixelFormat(SkColorType type)
Path PathDataFromTextBlob(const sk_sp< SkTextBlob > &blob, Point shift)
std::vector< Point > ToPoints(const SkPoint points[], int count)
Path ToPath(const SkPath &path, Point shift)
void ConvertStops(const flutter::DlGradientColorSourceBase *gradient, std::vector< Color > &colors, std::vector< float > &stops)
Convert display list colors + stops into impeller colors and stops, taking care to ensure that the st...
Point ToPoint(const SkPoint &point)
Size ToSize(const SkPoint &point)
std::vector< Rect > ToRects(const SkRect tex[], int count)
PathBuilder::RoundingRadii ToRoundingRadii(const SkRRect &rrect)
std::vector< Matrix > ToRSXForms(const SkRSXform xform[], int count)
bool IsNearlySimpleRRect(const SkRRect &rr)
Like SkRRect.isSimple, but allows the corners to differ by kEhCloseEnough.
Rect ToRect(const SkRect &rect)
Color ToColor(const flutter::DlColor &color)
constexpr float kEhCloseEnough
A 4x4 matrix using column-major storage.
static constexpr TPoint< Type > MakeXY(Type x, Type y)
static constexpr TRect MakeLTRB(Type left, Type top, Type right, Type bottom)
std::shared_ptr< const fml::Mapping > data