forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 2
/
dl_op_flags.cc
32 lines (28 loc) · 1.15 KB
/
dl_op_flags.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/display_list/dl_op_flags.h"
#include "flutter/display_list/effects/dl_path_effect.h"
namespace flutter {
const DisplayListSpecialGeometryFlags DisplayListAttributeFlags::WithPathEffect(
const DlPathEffect* effect,
bool is_stroked) const {
if (is_geometric() && effect) {
switch (effect->type()) {
case DlPathEffectType::kDash: {
// Dashing has no effect on filled geometry.
if (is_stroked) {
// A dash effect has a very simple impact. It cannot introduce any
// miter joins that weren't already present in the original path
// and it does not grow the bounds of the path, but it can add
// end caps to areas that might not have had them before so all
// we need to do is to indicate the potential for diagonal
// end caps and move on.
return special_flags_.with(kMayHaveCaps_ | kMayHaveDiagonalCaps_);
}
}
}
}
return special_flags_;
}
} // namespace flutter