| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/trace_event/trace_event_argument.h" | 5 #include "base/trace_event/trace_event_argument.h" |
| 6 #include "cc/base/math_util.h" | 6 #include "cc/base/math_util.h" |
| 7 #include "cc/proto/cc_conversions.h" | 7 #include "cc/proto/cc_conversions.h" |
| 8 #include "cc/proto/gfx_conversions.h" | 8 #include "cc/proto/gfx_conversions.h" |
| 9 #include "cc/trees/clip_node.h" | 9 #include "cc/trees/clip_node.h" |
| 10 | 10 |
| 11 namespace cc { | 11 namespace cc { |
| 12 | 12 |
| 13 ClipNode::ClipNode() | 13 ClipNode::ClipNode() |
| 14 : id(-1), | 14 : id(-1), |
| 15 parent_id(-1), | 15 parent_id(-1), |
| 16 owner_id(-1), | 16 owner_id(-1), |
| 17 clip_type(ClipType::NONE), | 17 clip_type(ClipType::NONE), |
| 18 transform_id(-1), | 18 transform_id(-1), |
| 19 target_transform_id(-1), | 19 target_transform_id(-1), |
| 20 target_effect_id(-1), | 20 target_effect_id(-1), |
| 21 layer_clipping_uses_only_local_clip(false), | 21 layer_clipping_uses_only_local_clip(false), |
| 22 target_is_clipped(false), | |
| 23 layers_are_clipped(false), | 22 layers_are_clipped(false), |
| 24 layers_are_clipped_when_surfaces_disabled(false), | 23 layers_are_clipped_when_surfaces_disabled(false), |
| 25 resets_clip(false) {} | 24 resets_clip(false) {} |
| 26 | 25 |
| 27 ClipNode::ClipNode(const ClipNode& other) = default; | 26 ClipNode::ClipNode(const ClipNode& other) = default; |
| 28 | 27 |
| 29 bool ClipNode::operator==(const ClipNode& other) const { | 28 bool ClipNode::operator==(const ClipNode& other) const { |
| 30 return id == other.id && parent_id == other.parent_id && | 29 return id == other.id && parent_id == other.parent_id && |
| 31 owner_id == other.owner_id && clip_type == other.clip_type && | 30 owner_id == other.owner_id && clip_type == other.clip_type && |
| 32 clip == other.clip && | 31 clip == other.clip && |
| 33 combined_clip_in_target_space == other.combined_clip_in_target_space && | 32 combined_clip_in_target_space == other.combined_clip_in_target_space && |
| 34 clip_in_target_space == other.clip_in_target_space && | 33 clip_in_target_space == other.clip_in_target_space && |
| 35 transform_id == other.transform_id && | 34 transform_id == other.transform_id && |
| 36 target_transform_id == other.target_transform_id && | 35 target_transform_id == other.target_transform_id && |
| 37 target_effect_id == other.target_effect_id && | 36 target_effect_id == other.target_effect_id && |
| 38 layer_clipping_uses_only_local_clip == | 37 layer_clipping_uses_only_local_clip == |
| 39 other.layer_clipping_uses_only_local_clip && | 38 other.layer_clipping_uses_only_local_clip && |
| 40 target_is_clipped == other.target_is_clipped && | |
| 41 layers_are_clipped == other.layers_are_clipped && | 39 layers_are_clipped == other.layers_are_clipped && |
| 42 layers_are_clipped_when_surfaces_disabled == | 40 layers_are_clipped_when_surfaces_disabled == |
| 43 other.layers_are_clipped_when_surfaces_disabled && | 41 other.layers_are_clipped_when_surfaces_disabled && |
| 44 resets_clip == other.resets_clip; | 42 resets_clip == other.resets_clip; |
| 45 } | 43 } |
| 46 | 44 |
| 47 void ClipNode::AsValueInto(base::trace_event::TracedValue* value) const { | 45 void ClipNode::AsValueInto(base::trace_event::TracedValue* value) const { |
| 48 value->SetInteger("id", id); | 46 value->SetInteger("id", id); |
| 49 value->SetInteger("parent_id", parent_id); | 47 value->SetInteger("parent_id", parent_id); |
| 50 value->SetInteger("owner_id", owner_id); | 48 value->SetInteger("owner_id", owner_id); |
| 51 value->SetInteger("clip_type", static_cast<int>(clip_type)); | 49 value->SetInteger("clip_type", static_cast<int>(clip_type)); |
| 52 MathUtil::AddToTracedValue("clip", clip, value); | 50 MathUtil::AddToTracedValue("clip", clip, value); |
| 53 value->SetInteger("transform_id", transform_id); | 51 value->SetInteger("transform_id", transform_id); |
| 54 value->SetInteger("target_transform_id", target_transform_id); | 52 value->SetInteger("target_transform_id", target_transform_id); |
| 55 value->SetInteger("target_effect_id", target_effect_id); | 53 value->SetInteger("target_effect_id", target_effect_id); |
| 56 value->SetBoolean("layer_clipping_uses_only_local_clip", | 54 value->SetBoolean("layer_clipping_uses_only_local_clip", |
| 57 layer_clipping_uses_only_local_clip); | 55 layer_clipping_uses_only_local_clip); |
| 58 value->SetBoolean("target_is_clipped", target_is_clipped); | |
| 59 value->SetBoolean("layers_are_clipped", layers_are_clipped); | 56 value->SetBoolean("layers_are_clipped", layers_are_clipped); |
| 60 value->SetBoolean("layers_are_clipped_when_surfaces_disabled", | 57 value->SetBoolean("layers_are_clipped_when_surfaces_disabled", |
| 61 layers_are_clipped_when_surfaces_disabled); | 58 layers_are_clipped_when_surfaces_disabled); |
| 62 value->SetBoolean("resets_clip", resets_clip); | 59 value->SetBoolean("resets_clip", resets_clip); |
| 63 } | 60 } |
| 64 | 61 |
| 65 } // namespace cc | 62 } // namespace cc |
| OLD | NEW |