Flutter Impeller
path.cc
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 
6 
7 #include "third_party/skia/include/core/SkRect.h"
8 
9 namespace impeller::interop {
10 
11 Path::Path(const SkPath& path) : path_(SkPathBuilder(path)) {}
12 
13 Path::~Path() = default;
14 
15 SkPath Path::GetPath() const {
16  return path_.snapshot();
17 }
18 
20  const auto bounds = path_.computeFiniteBounds().value_or(SkRect());
21  return ImpellerRect{
22  .x = bounds.x(),
23  .y = bounds.y(),
24  .width = bounds.width(),
25  .height = bounds.height(),
26  };
27 }
28 
29 } // namespace impeller::interop
ImpellerRect GetBounds() const
Definition: path.cc:19
SkPath GetPath() const
Definition: path.cc:15
Path(const SkPath &path)
Definition: path.cc:11