Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 38312ca

Browse files
committed
fix comments
1 parent d86d108 commit 38312ca

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

flow/layers/shader_mask_layer.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77

88
namespace flutter {
99

10-
ShaderMaskLayer::ShaderMaskLayer(std::shared_ptr<DlColorSource> shader,
10+
ShaderMaskLayer::ShaderMaskLayer(std::shared_ptr<DlColorSource> color_source,
1111
const SkRect& mask_rect,
1212
DlBlendMode blend_mode)
1313
: CacheableContainerLayer(
1414
RasterCacheUtil::kMinimumRendersBeforeCachingFilterLayer),
15-
shader_(std::move(shader)),
15+
color_source_(std::move(color_source)),
1616
mask_rect_(mask_rect),
1717
blend_mode_(blend_mode) {}
1818

@@ -21,8 +21,8 @@ void ShaderMaskLayer::Diff(DiffContext* context, const Layer* old_layer) {
2121
auto* prev = static_cast<const ShaderMaskLayer*>(old_layer);
2222
if (!context->IsSubtreeDirty()) {
2323
FML_DCHECK(prev);
24-
if (shader_ != prev->shader_ || mask_rect_ != prev->mask_rect_ ||
25-
blend_mode_ != prev->blend_mode_) {
24+
if (color_source_ != prev->color_source_ ||
25+
mask_rect_ != prev->mask_rect_ || blend_mode_ != prev->blend_mode_) {
2626
context->MarkSubtreeDirty(context->GetOldLayerPaintRegion(old_layer));
2727
}
2828
}
@@ -63,8 +63,8 @@ void ShaderMaskLayer::Paint(PaintContext& context) const {
6363

6464
DlPaint dl_paint;
6565
dl_paint.setBlendMode(blend_mode_);
66-
if (shader_) {
67-
dl_paint.setColorSource(shader_.get());
66+
if (color_source_) {
67+
dl_paint.setColorSource(color_source_.get());
6868
}
6969
context.leaf_nodes_builder->translate(mask_rect_.left(), mask_rect_.top());
7070
context.leaf_nodes_builder->drawRect(shader_rect, dl_paint);
@@ -75,8 +75,8 @@ void ShaderMaskLayer::Paint(PaintContext& context) const {
7575
PaintChildren(context);
7676
SkPaint paint;
7777
paint.setBlendMode(ToSk(blend_mode_));
78-
if (shader_) {
79-
paint.setShader(shader_->skia_object());
78+
if (color_source_) {
79+
paint.setShader(color_source_->skia_object());
8080
}
8181
context.leaf_nodes_canvas->translate(mask_rect_.left(), mask_rect_.top());
8282
context.leaf_nodes_canvas->drawRect(shader_rect, paint);

flow/layers/shader_mask_layer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace flutter {
1212

1313
class ShaderMaskLayer : public CacheableContainerLayer {
1414
public:
15-
ShaderMaskLayer(std::shared_ptr<DlColorSource> shader,
15+
ShaderMaskLayer(std::shared_ptr<DlColorSource> color_source,
1616
const SkRect& mask_rect,
1717
DlBlendMode blend_mode);
1818

@@ -23,7 +23,7 @@ class ShaderMaskLayer : public CacheableContainerLayer {
2323
void Paint(PaintContext& context) const override;
2424

2525
private:
26-
std::shared_ptr<DlColorSource> shader_;
26+
std::shared_ptr<DlColorSource> color_source_;
2727
SkRect mask_rect_;
2828
DlBlendMode blend_mode_;
2929

flow/layers/shader_mask_layer_unittests.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,7 @@ TEST_F(ShaderMaskLayerTest, OpacityInheritance) {
378378
expected_builder.saveLayer(&child_path.getBounds(), &sl_paint);
379379
{
380380
/* child layer paint */ {
381-
expected_builder.drawPath(child_path,
382-
DlPaint().setColor(0xFF000000));
381+
expected_builder.drawPath(child_path, DlPaint());
383382
}
384383
expected_builder.translate(mask_rect.fLeft, mask_rect.fTop);
385384
expected_builder.drawRect(

0 commit comments

Comments
 (0)