Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
display_list
effects
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
7
namespace
flutter
{
8
9
static
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
18
std::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
),
26
DlPathEffectDeleter
);
27
return
std::move(ret);
28
}
29
30
std::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
count
int count
Definition
FontMgrTest.cpp:50
flutter::DlDashPathEffect
Definition
dl_path_effect.h:61
flutter::DlDashPathEffect::count
int count() const
Definition
dl_path_effect.h:81
flutter::DlDashPathEffect::phase
SkScalar phase() const
Definition
dl_path_effect.h:82
flutter::DlDashPathEffect::Make
static std::shared_ptr< DlPathEffect > Make(const SkScalar intervals[], int count, SkScalar phase)
Definition
dl_path_effect.cc:18
flutter::DlDashPathEffect::effect_bounds
std::optional< SkRect > effect_bounds(SkRect &rect) const override
Definition
dl_path_effect.cc:30
flutter::DlDashPathEffect::intervals
const SkScalar * intervals() const
Definition
dl_path_effect.h:78
SkScalar
float SkScalar
Definition
extension.cpp:12
flutter
Definition
asset_manager.cc:10
flutter::DlPathEffectDeleter
static void DlPathEffectDeleter(void *p)
Definition
dl_path_effect.cc:9
SkRect
Definition
extension.cpp:13
Generated on Fri Apr 26 2024 06:14:02 for Flutter Engine by
1.9.8