Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
dl_path_effect.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
5#include "flutter/display_list/effects/dl_path_effect.h"
6
7namespace flutter {
8
9static void DlPathEffectDeleter(void* p) {
10 // Some of our target environments would prefer a sized delete,
11 // but other target environments do not have that operator.
12 // Use an unsized delete until we get better agreement in the
13 // environments.
14 // See https://github.com/flutter/flutter/issues/100327
15 ::operator delete(p);
16}
17
18std::shared_ptr<DlPathEffect> DlDashPathEffect::Make(const SkScalar* intervals,
19 int count,
20 SkScalar phase) {
21 size_t needed = sizeof(DlDashPathEffect) + sizeof(SkScalar) * count;
22 void* storage = ::operator new(needed);
23
24 std::shared_ptr<DlDashPathEffect> ret;
25 ret.reset(new (storage) DlDashPathEffect(intervals, count, phase),
27 return std::move(ret);
28}
29
30std::optional<SkRect> DlDashPathEffect::effect_bounds(SkRect& rect) const {
31 // The dashed path will always be a subset of the original.
32 return rect;
33}
34
35} // namespace flutter
int count
static std::shared_ptr< DlPathEffect > Make(const SkScalar intervals[], int count, SkScalar phase)
std::optional< SkRect > effect_bounds(SkRect &rect) const override
const SkScalar * intervals() const
float SkScalar
Definition extension.cpp:12
static void DlPathEffectDeleter(void *p)