Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Prev Previous commit
Next Next commit
adjust comments as per review feedback
  • Loading branch information
flar committed Nov 13, 2020
commit 5d7faf2074d026056e247a4742e3a380b24cf308
2 changes: 1 addition & 1 deletion flow/layers/clip_path_layer_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ TEST_F(ClipPathLayerTest, PaintingCulledLayerDies) {
auto layer = std::make_shared<ClipPathLayer>(layer_path, Clip::hardEdge);
layer->Add(mock_layer);

preroll_context()->cull_rect = distant_bounds; // Cull everything
preroll_context()->cull_rect = distant_bounds; // Cull these children

layer->Preroll(preroll_context(), initial_matrix);
EXPECT_EQ(preroll_context()->cull_rect, distant_bounds); // Untouched
Expand Down
2 changes: 1 addition & 1 deletion flow/layers/clip_rect_layer_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ TEST_F(ClipRectLayerTest, PaintingCulledLayerDies) {
auto layer = std::make_shared<ClipRectLayer>(layer_bounds, Clip::hardEdge);
layer->Add(mock_layer);

preroll_context()->cull_rect = distant_bounds; // Cull everything
preroll_context()->cull_rect = distant_bounds; // Cull these children

layer->Preroll(preroll_context(), initial_matrix);
EXPECT_EQ(preroll_context()->cull_rect, distant_bounds); // Untouched
Expand Down
2 changes: 1 addition & 1 deletion flow/layers/clip_rrect_layer_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ TEST_F(ClipRRectLayerTest, PaintingCulledLayerDies) {
auto layer = std::make_shared<ClipRRectLayer>(layer_rrect, Clip::hardEdge);
layer->Add(mock_layer);

preroll_context()->cull_rect = distant_bounds; // Cull everything
preroll_context()->cull_rect = distant_bounds; // Cull these children

layer->Preroll(preroll_context(), initial_matrix);
EXPECT_EQ(preroll_context()->cull_rect, distant_bounds); // Untouched
Expand Down
6 changes: 3 additions & 3 deletions flow/layers/container_layer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ void ContainerLayer::PrerollChildren(PrerollContext* context,
}

void ContainerLayer::PaintChildren(PaintContext& context) const {
// needs_painting(context) is only valid for the PaintContext that
// We can no longer call FML_DCHECK here on the needs_painting(context)
// condition as that test is only valid for the PaintContext that
// is initially handed to a layer's Paint() method. By the time the
// layer calls PaintChildren(), though, it may have modified the
// PaintContext so we can no longer double-check the culling.
// FML_DCHECK(needs_painting(context));
// PaintContext so the test doesn't work in this "context".

// Intentionally not tracing here as there should be no self-time
// and the trace event on this common function has a small overhead.
Expand Down
8 changes: 4 additions & 4 deletions flow/layers/layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ class Layer {
needs_system_composite_ = value;
}

// Returns the unclipped paint bounds in the layer's local coordinate
// system as determined during Preroll(). The bounds should include
// any transform or distortions performed by the layer itself, but not
// any transforms performed by its ancestors.
// Returns the paint bounds in the layer's local coordinate system
// as determined during Preroll(). The bounds should include any
// transform, clip or distortions performed by the layer itself,
// but not any similar modifications inherited from its ancestors.
const SkRect& paint_bounds() const { return paint_bounds_; }

// This must be set by the time Preroll() returns otherwise the layer will
Expand Down