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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 from_target = ProtoToTransform(proto.from_target()); | 396 from_target = ProtoToTransform(proto.from_target()); |
397 to_target = ProtoToTransform(proto.to_target()); | 397 to_target = ProtoToTransform(proto.to_target()); |
398 from_screen = ProtoToTransform(proto.from_screen()); | 398 from_screen = ProtoToTransform(proto.from_screen()); |
399 to_screen = ProtoToTransform(proto.to_screen()); | 399 to_screen = ProtoToTransform(proto.to_screen()); |
400 target_id = proto.target_id(); | 400 target_id = proto.target_id(); |
401 content_target_id = proto.content_target_id(); | 401 content_target_id = proto.content_target_id(); |
402 } | 402 } |
403 | 403 |
404 ClipNodeData::ClipNodeData() | 404 ClipNodeData::ClipNodeData() |
405 : transform_id(-1), | 405 : transform_id(-1), |
406 target_id(-1), | 406 target_transform_id(-1), |
| 407 target_effect_id(-1), |
407 applies_local_clip(true), | 408 applies_local_clip(true), |
408 layer_clipping_uses_only_local_clip(false), | 409 layer_clipping_uses_only_local_clip(false), |
409 target_is_clipped(false), | 410 target_is_clipped(false), |
410 layers_are_clipped(false), | 411 layers_are_clipped(false), |
411 layers_are_clipped_when_surfaces_disabled(false), | 412 layers_are_clipped_when_surfaces_disabled(false), |
412 resets_clip(false) {} | 413 resets_clip(false) {} |
413 | 414 |
414 ClipNodeData::ClipNodeData(const ClipNodeData& other) = default; | 415 ClipNodeData::ClipNodeData(const ClipNodeData& other) = default; |
415 | 416 |
416 bool ClipNodeData::operator==(const ClipNodeData& other) const { | 417 bool ClipNodeData::operator==(const ClipNodeData& other) const { |
417 return clip == other.clip && | 418 return clip == other.clip && |
418 combined_clip_in_target_space == other.combined_clip_in_target_space && | 419 combined_clip_in_target_space == other.combined_clip_in_target_space && |
419 clip_in_target_space == other.clip_in_target_space && | 420 clip_in_target_space == other.clip_in_target_space && |
420 transform_id == other.transform_id && target_id == other.target_id && | 421 transform_id == other.transform_id && |
| 422 target_transform_id == other.target_transform_id && |
| 423 target_effect_id == other.target_effect_id && |
421 applies_local_clip == other.applies_local_clip && | 424 applies_local_clip == other.applies_local_clip && |
422 layer_clipping_uses_only_local_clip == | 425 layer_clipping_uses_only_local_clip == |
423 other.layer_clipping_uses_only_local_clip && | 426 other.layer_clipping_uses_only_local_clip && |
424 target_is_clipped == other.target_is_clipped && | 427 target_is_clipped == other.target_is_clipped && |
425 layers_are_clipped == other.layers_are_clipped && | 428 layers_are_clipped == other.layers_are_clipped && |
426 layers_are_clipped_when_surfaces_disabled == | 429 layers_are_clipped_when_surfaces_disabled == |
427 other.layers_are_clipped_when_surfaces_disabled && | 430 other.layers_are_clipped_when_surfaces_disabled && |
428 resets_clip == other.resets_clip; | 431 resets_clip == other.resets_clip; |
429 } | 432 } |
430 | 433 |
431 void ClipNodeData::ToProtobuf(proto::TreeNode* proto) const { | 434 void ClipNodeData::ToProtobuf(proto::TreeNode* proto) const { |
432 DCHECK(!proto->has_clip_node_data()); | 435 DCHECK(!proto->has_clip_node_data()); |
433 proto::ClipNodeData* data = proto->mutable_clip_node_data(); | 436 proto::ClipNodeData* data = proto->mutable_clip_node_data(); |
434 | 437 |
435 RectFToProto(clip, data->mutable_clip()); | 438 RectFToProto(clip, data->mutable_clip()); |
436 RectFToProto(combined_clip_in_target_space, | 439 RectFToProto(combined_clip_in_target_space, |
437 data->mutable_combined_clip_in_target_space()); | 440 data->mutable_combined_clip_in_target_space()); |
438 RectFToProto(clip_in_target_space, data->mutable_clip_in_target_space()); | 441 RectFToProto(clip_in_target_space, data->mutable_clip_in_target_space()); |
439 | 442 |
440 data->set_transform_id(transform_id); | 443 data->set_transform_id(transform_id); |
441 data->set_target_id(target_id); | 444 data->set_target_transform_id(target_transform_id); |
| 445 data->set_target_effect_id(target_effect_id); |
442 data->set_applies_local_clip(applies_local_clip); | 446 data->set_applies_local_clip(applies_local_clip); |
443 data->set_layer_clipping_uses_only_local_clip( | 447 data->set_layer_clipping_uses_only_local_clip( |
444 layer_clipping_uses_only_local_clip); | 448 layer_clipping_uses_only_local_clip); |
445 data->set_target_is_clipped(target_is_clipped); | 449 data->set_target_is_clipped(target_is_clipped); |
446 data->set_layers_are_clipped(layers_are_clipped); | 450 data->set_layers_are_clipped(layers_are_clipped); |
447 data->set_layers_are_clipped_when_surfaces_disabled( | 451 data->set_layers_are_clipped_when_surfaces_disabled( |
448 layers_are_clipped_when_surfaces_disabled); | 452 layers_are_clipped_when_surfaces_disabled); |
449 data->set_resets_clip(resets_clip); | 453 data->set_resets_clip(resets_clip); |
450 } | 454 } |
451 | 455 |
452 void ClipNodeData::FromProtobuf(const proto::TreeNode& proto) { | 456 void ClipNodeData::FromProtobuf(const proto::TreeNode& proto) { |
453 DCHECK(proto.has_clip_node_data()); | 457 DCHECK(proto.has_clip_node_data()); |
454 const proto::ClipNodeData& data = proto.clip_node_data(); | 458 const proto::ClipNodeData& data = proto.clip_node_data(); |
455 | 459 |
456 clip = ProtoToRectF(data.clip()); | 460 clip = ProtoToRectF(data.clip()); |
457 combined_clip_in_target_space = | 461 combined_clip_in_target_space = |
458 ProtoToRectF(data.combined_clip_in_target_space()); | 462 ProtoToRectF(data.combined_clip_in_target_space()); |
459 clip_in_target_space = ProtoToRectF(data.clip_in_target_space()); | 463 clip_in_target_space = ProtoToRectF(data.clip_in_target_space()); |
460 | 464 |
461 transform_id = data.transform_id(); | 465 transform_id = data.transform_id(); |
462 target_id = data.target_id(); | 466 target_transform_id = data.target_transform_id(); |
| 467 target_effect_id = data.target_effect_id(); |
463 applies_local_clip = data.applies_local_clip(); | 468 applies_local_clip = data.applies_local_clip(); |
464 layer_clipping_uses_only_local_clip = | 469 layer_clipping_uses_only_local_clip = |
465 data.layer_clipping_uses_only_local_clip(); | 470 data.layer_clipping_uses_only_local_clip(); |
466 target_is_clipped = data.target_is_clipped(); | 471 target_is_clipped = data.target_is_clipped(); |
467 layers_are_clipped = data.layers_are_clipped(); | 472 layers_are_clipped = data.layers_are_clipped(); |
468 layers_are_clipped_when_surfaces_disabled = | 473 layers_are_clipped_when_surfaces_disabled = |
469 data.layers_are_clipped_when_surfaces_disabled(); | 474 data.layers_are_clipped_when_surfaces_disabled(); |
470 resets_clip = data.resets_clip(); | 475 resets_clip = data.resets_clip(); |
471 } | 476 } |
472 | 477 |
473 void ClipNodeData::AsValueInto(base::trace_event::TracedValue* value) const { | 478 void ClipNodeData::AsValueInto(base::trace_event::TracedValue* value) const { |
474 MathUtil::AddToTracedValue("clip", clip, value); | 479 MathUtil::AddToTracedValue("clip", clip, value); |
475 value->SetInteger("transform_id", transform_id); | 480 value->SetInteger("transform_id", transform_id); |
476 value->SetInteger("target_id", target_id); | 481 value->SetInteger("target_transform_id", target_transform_id); |
| 482 value->SetInteger("target_effect_id", target_effect_id); |
477 value->SetBoolean("applies_local_clip", applies_local_clip); | 483 value->SetBoolean("applies_local_clip", applies_local_clip); |
478 value->SetBoolean("layer_clipping_uses_only_local_clip", | 484 value->SetBoolean("layer_clipping_uses_only_local_clip", |
479 layer_clipping_uses_only_local_clip); | 485 layer_clipping_uses_only_local_clip); |
480 value->SetBoolean("target_is_clipped", target_is_clipped); | 486 value->SetBoolean("target_is_clipped", target_is_clipped); |
481 value->SetBoolean("layers_are_clipped", layers_are_clipped); | 487 value->SetBoolean("layers_are_clipped", layers_are_clipped); |
482 value->SetBoolean("layers_are_clipped_when_surfaces_disabled", | 488 value->SetBoolean("layers_are_clipped_when_surfaces_disabled", |
483 layers_are_clipped_when_surfaces_disabled); | 489 layers_are_clipped_when_surfaces_disabled); |
484 value->SetBoolean("resets_clip", resets_clip); | 490 value->SetBoolean("resets_clip", resets_clip); |
485 } | 491 } |
486 | 492 |
(...skipping 1980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2467 cached_data_.property_tree_update_number = 0; | 2473 cached_data_.property_tree_update_number = 0; |
2468 cached_data_.animation_scales = std::vector<AnimationScaleData>( | 2474 cached_data_.animation_scales = std::vector<AnimationScaleData>( |
2469 transform_tree.nodes().size(), AnimationScaleData()); | 2475 transform_tree.nodes().size(), AnimationScaleData()); |
2470 } | 2476 } |
2471 | 2477 |
2472 void PropertyTrees::UpdateCachedNumber() { | 2478 void PropertyTrees::UpdateCachedNumber() { |
2473 cached_data_.property_tree_update_number++; | 2479 cached_data_.property_tree_update_number++; |
2474 } | 2480 } |
2475 | 2481 |
2476 } // namespace cc | 2482 } // namespace cc |
OLD | NEW |