Flutter Engine
Loading...
Searching...
No Matches
clip_path_layer.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/flow/layers/clip_path_layer.h
"
6
7
namespace
flutter
{
8
9
ClipPathLayer::ClipPathLayer
(
const
DlPath
& clip_path,
Clip
clip_behavior)
10
:
ClipShapeLayer
(clip_path, clip_behavior) {}
11
12
const
DlRect
ClipPathLayer::clip_shape_bounds
()
const
{
13
return
clip_shape
().
GetBounds
();
14
}
15
16
void
ClipPathLayer::ApplyClip
(
LayerStateStack::MutatorContext
& mutator)
const
{
17
bool
is_aa =
clip_behavior
() !=
Clip::kHardEdge
;
18
DlRect
rect;
19
if
(
clip_shape
().IsRect(&rect)) {
20
mutator.
clipRect
(rect, is_aa);
21
}
else
if
(
clip_shape
().IsOval(&rect)) {
22
mutator.
clipRRect
(
DlRoundRect::MakeOval
(rect), is_aa);
23
}
else
{
24
DlRoundRect
rrect;
25
if
(
clip_shape
().IsRoundRect(&rrect)) {
26
mutator.
clipRRect
(rrect, is_aa);
27
}
else
{
28
clip_shape
().
WillRenderSkPath
();
29
mutator.
clipPath
(
clip_shape
(), is_aa);
30
}
31
}
32
}
33
34
}
// namespace flutter
flutter::ClipPathLayer::ApplyClip
void ApplyClip(LayerStateStack::MutatorContext &mutator) const override
Definition
clip_path_layer.cc:16
flutter::ClipPathLayer::clip_shape_bounds
const DlRect clip_shape_bounds() const override
Definition
clip_path_layer.cc:12
flutter::ClipPathLayer::ClipPathLayer
ClipPathLayer(const DlPath &clip_path, Clip clip_behavior=Clip::kAntiAlias)
Definition
clip_path_layer.cc:9
flutter::ClipShapeLayer
Definition
clip_shape_layer.h:15
flutter::ClipShapeLayer< DlPath >::clip_behavior
Clip clip_behavior() const
Definition
clip_shape_layer.h:113
flutter::ClipShapeLayer< DlPath >::clip_shape
const ClipShape & clip_shape() const
Definition
clip_shape_layer.h:112
flutter::DlPath
Definition
dl_path.h:19
flutter::DlPath::GetBounds
DlRect GetBounds() const override
Definition
dl_path.cc:243
flutter::DlPath::WillRenderSkPath
void WillRenderSkPath() const
Definition
dl_path.cc:174
flutter::LayerStateStack::MutatorContext
Definition
layer_state_stack.h:156
flutter::LayerStateStack::MutatorContext::clipPath
void clipPath(const DlPath &path, bool is_aa)
Definition
layer_state_stack.cc:613
flutter::LayerStateStack::MutatorContext::clipRRect
void clipRRect(const DlRoundRect &rrect, bool is_aa)
Definition
layer_state_stack.cc:600
flutter::LayerStateStack::MutatorContext::clipRect
void clipRect(const DlRect &rect, bool is_aa)
Definition
layer_state_stack.cc:594
clip_path_layer.h
flutter
Definition
asset_manager.cc:10
flutter::Clip
Clip
Definition
layer.h:43
flutter::kHardEdge
@ kHardEdge
Definition
layer.h:43
impeller::RoundRect
Definition
round_rect.h:16
impeller::RoundRect::MakeOval
static RoundRect MakeOval(const Rect &rect)
Definition
round_rect.h:23
impeller::TRect< Scalar >
flow
layers
clip_path_layer.cc
Generated on Thu Nov 6 2025 16:11:21 for Flutter Engine by
1.9.8