29 if (
context->IsSubtreeDirty()) {
30 for (
auto& layer : layers_) {
37 const auto& prev_layers = old_layer->layers_;
40 int new_children_top = 0;
41 int old_children_top = 0;
44 int new_children_bottom = layers_.size() - 1;
45 int old_children_bottom = prev_layers.size() - 1;
47 while ((old_children_top <= old_children_bottom) &&
48 (new_children_top <= new_children_bottom)) {
50 context, prev_layers[old_children_top].get())) {
57 while ((old_children_top <= old_children_bottom) &&
58 (new_children_top <= new_children_bottom)) {
60 context, prev_layers[old_children_bottom].get())) {
63 --new_children_bottom;
64 --old_children_bottom;
68 for (
int i = old_children_top;
i <= old_children_bottom; ++
i) {
69 auto layer = prev_layers[
i];
73 for (
int i = 0; i < static_cast<int>(layers_.size()); ++
i) {
74 if (i < new_children_top || i > new_children_bottom) {
76 i < new_children_top ?
i : prev_layers.size() - (layers_.size() -
i);
77 auto layer = layers_[
i];
78 auto prev_layer = prev_layers[i_prev];
79 auto paint_region =
context->GetOldLayerPaintRegion(prev_layer.get());
80 if (layer == prev_layer && !paint_region.has_readback() &&
81 !paint_region.has_texture()) {
88 context->AddExistingPaintRegion(paint_region);
93 layer->PreservePaintRegion(
context);
95 layer->Diff(
context, prev_layer.get());
100 auto layer = layers_[
i];
123 DlRect* child_paint_bounds) {
129 bool child_has_platform_view =
false;
130 bool child_has_texture_layer =
false;
133 for (
auto& layer : layers_) {
137 context->has_platform_view =
false;
138 context->has_texture_layer =
false;
142 context->renderable_state_flags = 0;
146 all_renderable_state_flags &=
context->renderable_state_flags;
151 all_renderable_state_flags = 0;
155 child_has_platform_view =
156 child_has_platform_view ||
context->has_platform_view;
157 child_has_texture_layer =
158 child_has_texture_layer ||
context->has_texture_layer;
161 context->has_platform_view = child_has_platform_view;
162 context->has_texture_layer = child_has_texture_layer;
163 context->renderable_state_flags = all_renderable_state_flags;