| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 } | 433 } |
| 434 | 434 |
| 435 EffectNodeData::EffectNodeData() | 435 EffectNodeData::EffectNodeData() |
| 436 : opacity(1.f), | 436 : opacity(1.f), |
| 437 screen_space_opacity(1.f), | 437 screen_space_opacity(1.f), |
| 438 has_render_surface(false), | 438 has_render_surface(false), |
| 439 has_copy_request(false), | 439 has_copy_request(false), |
| 440 has_background_filters(false), | 440 has_background_filters(false), |
| 441 node_or_ancestor_has_background_filters(false), | 441 node_or_ancestor_has_background_filters(false), |
| 442 to_screen_opacity_is_animated(false), | 442 to_screen_opacity_is_animated(false), |
| 443 to_screen_opacity_can_animate_on_impl(false), |
| 443 hidden_by_backface_visibility(false), | 444 hidden_by_backface_visibility(false), |
| 444 double_sided(false), | 445 double_sided(false), |
| 445 is_drawn(true), | 446 is_drawn(true), |
| 446 has_animated_opacity(false), | 447 has_animated_opacity(false), |
| 447 effect_changed(false), | 448 effect_changed(false), |
| 448 num_copy_requests_in_subtree(0), | 449 num_copy_requests_in_subtree(0), |
| 449 transform_id(0), | 450 transform_id(0), |
| 450 clip_id(0), | 451 clip_id(0), |
| 451 target_id(0) {} | 452 target_id(0) {} |
| 452 | 453 |
| 453 EffectNodeData::EffectNodeData(const EffectNodeData& other) = default; | 454 EffectNodeData::EffectNodeData(const EffectNodeData& other) = default; |
| 454 | 455 |
| 455 bool EffectNodeData::operator==(const EffectNodeData& other) const { | 456 bool EffectNodeData::operator==(const EffectNodeData& other) const { |
| 456 return opacity == other.opacity && | 457 return opacity == other.opacity && |
| 457 screen_space_opacity == other.screen_space_opacity && | 458 screen_space_opacity == other.screen_space_opacity && |
| 458 has_render_surface == other.has_render_surface && | 459 has_render_surface == other.has_render_surface && |
| 459 has_copy_request == other.has_copy_request && | 460 has_copy_request == other.has_copy_request && |
| 460 has_background_filters == other.has_background_filters && | 461 has_background_filters == other.has_background_filters && |
| 461 node_or_ancestor_has_background_filters == | 462 node_or_ancestor_has_background_filters == |
| 462 other.node_or_ancestor_has_background_filters && | 463 other.node_or_ancestor_has_background_filters && |
| 463 to_screen_opacity_is_animated == other.to_screen_opacity_is_animated && | 464 to_screen_opacity_is_animated == other.to_screen_opacity_is_animated && |
| 465 to_screen_opacity_can_animate_on_impl == |
| 466 other.to_screen_opacity_can_animate_on_impl && |
| 464 hidden_by_backface_visibility == other.hidden_by_backface_visibility && | 467 hidden_by_backface_visibility == other.hidden_by_backface_visibility && |
| 465 double_sided == other.double_sided && is_drawn == other.is_drawn && | 468 double_sided == other.double_sided && is_drawn == other.is_drawn && |
| 466 has_animated_opacity == other.has_animated_opacity && | 469 has_animated_opacity == other.has_animated_opacity && |
| 467 effect_changed == other.effect_changed && | 470 effect_changed == other.effect_changed && |
| 468 num_copy_requests_in_subtree == other.num_copy_requests_in_subtree && | 471 num_copy_requests_in_subtree == other.num_copy_requests_in_subtree && |
| 469 transform_id == other.transform_id && clip_id == other.clip_id && | 472 transform_id == other.transform_id && clip_id == other.clip_id && |
| 470 target_id == other.target_id; | 473 target_id == other.target_id; |
| 471 } | 474 } |
| 472 | 475 |
| 473 void EffectNodeData::ToProtobuf(proto::TreeNode* proto) const { | 476 void EffectNodeData::ToProtobuf(proto::TreeNode* proto) const { |
| 474 DCHECK(!proto->has_effect_node_data()); | 477 DCHECK(!proto->has_effect_node_data()); |
| 475 proto::EffectNodeData* data = proto->mutable_effect_node_data(); | 478 proto::EffectNodeData* data = proto->mutable_effect_node_data(); |
| 476 data->set_opacity(opacity); | 479 data->set_opacity(opacity); |
| 477 data->set_screen_space_opacity(screen_space_opacity); | 480 data->set_screen_space_opacity(screen_space_opacity); |
| 478 data->set_has_render_surface(has_render_surface); | 481 data->set_has_render_surface(has_render_surface); |
| 479 data->set_has_copy_request(has_copy_request); | 482 data->set_has_copy_request(has_copy_request); |
| 480 data->set_has_background_filters(has_background_filters); | 483 data->set_has_background_filters(has_background_filters); |
| 481 data->set_node_or_ancestor_has_background_filters( | 484 data->set_node_or_ancestor_has_background_filters( |
| 482 node_or_ancestor_has_background_filters); | 485 node_or_ancestor_has_background_filters); |
| 483 data->set_to_screen_opacity_is_animated(to_screen_opacity_is_animated); | 486 data->set_to_screen_opacity_is_animated(to_screen_opacity_is_animated); |
| 487 data->set_to_screen_opacity_can_animate_on_impl( |
| 488 to_screen_opacity_can_animate_on_impl); |
| 484 data->set_hidden_by_backface_visibility(hidden_by_backface_visibility); | 489 data->set_hidden_by_backface_visibility(hidden_by_backface_visibility); |
| 485 data->set_double_sided(double_sided); | 490 data->set_double_sided(double_sided); |
| 486 data->set_is_drawn(is_drawn); | 491 data->set_is_drawn(is_drawn); |
| 487 data->set_has_animated_opacity(has_animated_opacity); | 492 data->set_has_animated_opacity(has_animated_opacity); |
| 488 data->set_effect_changed(effect_changed); | 493 data->set_effect_changed(effect_changed); |
| 489 data->set_num_copy_requests_in_subtree(num_copy_requests_in_subtree); | 494 data->set_num_copy_requests_in_subtree(num_copy_requests_in_subtree); |
| 490 data->set_transform_id(transform_id); | 495 data->set_transform_id(transform_id); |
| 491 data->set_clip_id(clip_id); | 496 data->set_clip_id(clip_id); |
| 492 data->set_target_id(target_id); | 497 data->set_target_id(target_id); |
| 493 } | 498 } |
| 494 | 499 |
| 495 void EffectNodeData::FromProtobuf(const proto::TreeNode& proto) { | 500 void EffectNodeData::FromProtobuf(const proto::TreeNode& proto) { |
| 496 DCHECK(proto.has_effect_node_data()); | 501 DCHECK(proto.has_effect_node_data()); |
| 497 const proto::EffectNodeData& data = proto.effect_node_data(); | 502 const proto::EffectNodeData& data = proto.effect_node_data(); |
| 498 | 503 |
| 499 opacity = data.opacity(); | 504 opacity = data.opacity(); |
| 500 screen_space_opacity = data.screen_space_opacity(); | 505 screen_space_opacity = data.screen_space_opacity(); |
| 501 has_render_surface = data.has_render_surface(); | 506 has_render_surface = data.has_render_surface(); |
| 502 has_copy_request = data.has_copy_request(); | 507 has_copy_request = data.has_copy_request(); |
| 503 has_background_filters = data.has_background_filters(); | 508 has_background_filters = data.has_background_filters(); |
| 504 node_or_ancestor_has_background_filters = | 509 node_or_ancestor_has_background_filters = |
| 505 data.node_or_ancestor_has_background_filters(); | 510 data.node_or_ancestor_has_background_filters(); |
| 506 to_screen_opacity_is_animated = data.to_screen_opacity_is_animated(); | 511 to_screen_opacity_is_animated = data.to_screen_opacity_is_animated(); |
| 512 to_screen_opacity_can_animate_on_impl = |
| 513 data.to_screen_opacity_can_animate_on_impl(); |
| 507 hidden_by_backface_visibility = data.hidden_by_backface_visibility(); | 514 hidden_by_backface_visibility = data.hidden_by_backface_visibility(); |
| 508 double_sided = data.double_sided(); | 515 double_sided = data.double_sided(); |
| 509 is_drawn = data.is_drawn(); | 516 is_drawn = data.is_drawn(); |
| 510 has_animated_opacity = data.has_animated_opacity(); | 517 has_animated_opacity = data.has_animated_opacity(); |
| 511 effect_changed = data.effect_changed(); | 518 effect_changed = data.effect_changed(); |
| 512 num_copy_requests_in_subtree = data.num_copy_requests_in_subtree(); | 519 num_copy_requests_in_subtree = data.num_copy_requests_in_subtree(); |
| 513 transform_id = data.transform_id(); | 520 transform_id = data.transform_id(); |
| 514 clip_id = data.clip_id(); | 521 clip_id = data.clip_id(); |
| 515 target_id = data.target_id(); | 522 target_id = data.target_id(); |
| 516 } | 523 } |
| (...skipping 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1917 break; | 1924 break; |
| 1918 case ALL_TREES: | 1925 case ALL_TREES: |
| 1919 transform_tree.ResetChangeTracking(); | 1926 transform_tree.ResetChangeTracking(); |
| 1920 effect_tree.ResetChangeTracking(); | 1927 effect_tree.ResetChangeTracking(); |
| 1921 } | 1928 } |
| 1922 changed = false; | 1929 changed = false; |
| 1923 full_tree_damaged = false; | 1930 full_tree_damaged = false; |
| 1924 } | 1931 } |
| 1925 | 1932 |
| 1926 } // namespace cc | 1933 } // namespace cc |
| OLD | NEW |