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

Commit 3e712c1

Browse files
committed
Fix some function naming style issues.
1 parent f77922c commit 3e712c1

File tree

4 files changed

+25
-21
lines changed

4 files changed

+25
-21
lines changed

flow/layers/container_layer.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ void ContainerLayer::Add(std::shared_ptr<Layer> layer) {
1616
the_layer->set_parent(this);
1717
layers_.push_back(std::move(layer));
1818
if (the_layer->tree_reads_surface()) {
19-
update_child_readback(the_layer);
19+
UpdateChildReadback(the_layer);
2020
}
2121
}
2222

23-
void ContainerLayer::update_child_readback(Layer* layer) {
23+
void ContainerLayer::UpdateChildReadback(Layer* layer) {
2424
if (child_needs_screen_readback_ == layer->tree_reads_surface()) {
2525
return;
2626
}
@@ -36,10 +36,10 @@ void ContainerLayer::update_child_readback(Layer* layer) {
3636
} else {
3737
child_needs_screen_readback_ = true;
3838
}
39-
update_screen_readback();
39+
UpdateTreeReadsSurface();
4040
}
4141

42-
bool ContainerLayer::compute_tree_reads_surface() {
42+
bool ContainerLayer::ComputeTreeReadsSurface() {
4343
return layer_reads_surface() ||
4444
(!renders_to_save_layer_ && child_needs_screen_readback_);
4545
}

flow/layers/container_layer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ class ContainerLayer : public Layer {
2727

2828
// Called when the layer, which must be a child of this container,
2929
// changes its tree_reads_surface() result.
30-
void update_child_readback(Layer* layer);
30+
void UpdateChildReadback(Layer* layer);
3131

3232
protected:
3333
void PrerollChildren(PrerollContext* context,
3434
const SkMatrix& child_matrix,
3535
SkRect* child_paint_bounds);
3636
void PaintChildren(PaintContext& context) const;
3737

38-
virtual bool compute_tree_reads_surface() override;
38+
virtual bool ComputeTreeReadsSurface() override;
3939

4040
#if defined(OS_FUCHSIA)
4141
void UpdateSceneChildren(SceneUpdateContext& context);
@@ -51,7 +51,7 @@ class ContainerLayer : public Layer {
5151
void set_renders_to_save_layer(bool protects) {
5252
if (renders_to_save_layer_ != protects) {
5353
renders_to_save_layer_ = protects;
54-
update_screen_readback();
54+
UpdateTreeReadsSurface();
5555
}
5656
}
5757

@@ -60,7 +60,7 @@ class ContainerLayer : public Layer {
6060
layers_.clear();
6161
if (child_needs_screen_readback_) {
6262
child_needs_screen_readback_ = false;
63-
update_screen_readback();
63+
UpdateTreeReadsSurface();
6464
}
6565
}
6666

flow/layers/layer.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ uint64_t Layer::NextUniqueID() {
2929
return id;
3030
}
3131

32-
bool Layer::compute_tree_reads_surface() {
32+
bool Layer::ComputeTreeReadsSurface() {
3333
return layer_reads_surface_;
3434
}
3535

36-
void Layer::update_screen_readback() {
37-
bool new_tree_reads_surface = compute_tree_reads_surface();
36+
void Layer::UpdateTreeReadsSurface() {
37+
bool new_tree_reads_surface = ComputeTreeReadsSurface();
3838

3939
if (tree_reads_surface_ != new_tree_reads_surface) {
4040
tree_reads_surface_ = new_tree_reads_surface;
4141
if (parent_ != nullptr) {
42-
parent_->update_child_readback(this);
42+
parent_->UpdateChildReadback(this);
4343
}
4444
}
4545
}

flow/layers/layer.h

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -147,22 +147,26 @@ class Layer {
147147

148148
// True iff the layer, or some descendant of the layer, performs an
149149
// operation which depends on (i.e. must read back from) the surface
150-
// on which it is rendered. This value has no setter as it is computed
151-
// from other flags and properties on the layer.
152-
// see Layer::update_screen_readback()
150+
// on which it is rendered in any way beyond the functionality of
151+
// BlendMode. This value has no setter as it is computed from other
152+
// flags and properties on the layer.
153+
//
154+
// see Layer::UpdateTreeReadsSurface()
153155
// see Layer::set_layer_reads_surface()
154156
// see ContainerLayer::set_renders_to_save_layer()
155-
// see ContainerLayer::update_child_readback()
157+
// see ContainerLayer::UpdateChildReadback()
156158
bool tree_reads_surface() { return tree_reads_surface_; }
157159

158160
uint64_t unique_id() const { return unique_id_; }
159161

160162
protected:
161-
virtual bool compute_tree_reads_surface();
163+
// Compute a new value for tree_reads_surface_ from all of the various
164+
// properties of this layer.
165+
virtual bool ComputeTreeReadsSurface();
162166

163-
// Compute a new value for tree_reads_surface_ and propagate it to
164-
// ancestors if it changes.
165-
void update_screen_readback();
167+
// Update the tree_reads_surface_ value and propagate changes to
168+
// ancestors if needed.
169+
void UpdateTreeReadsSurface();
166170

167171
// True iff the layer itself (not a child or other descendant) performs
168172
// an operation which must read back from the surface on which it is
@@ -172,7 +176,7 @@ class Layer {
172176
void set_layer_reads_surface(bool reads) {
173177
if (layer_reads_surface_ != reads) {
174178
layer_reads_surface_ = reads;
175-
update_screen_readback();
179+
UpdateTreeReadsSurface();
176180
}
177181
}
178182

0 commit comments

Comments
 (0)