| 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/proto/gfx_conversions.h" | 6 #include "cc/proto/gfx_conversions.h" |
| 7 #include "cc/proto/property_tree.pb.h" | 7 #include "cc/proto/property_tree.pb.h" |
| 8 #include "cc/proto/skia_conversions.h" | 8 #include "cc/proto/skia_conversions.h" |
| 9 #include "cc/trees/effect_node.h" | 9 #include "cc/trees/effect_node.h" |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 bool EffectNode::operator==(const EffectNode& other) const { | 43 bool EffectNode::operator==(const EffectNode& other) const { |
| 44 return id == other.id && parent_id == other.parent_id && | 44 return id == other.id && parent_id == other.parent_id && |
| 45 owner_id == other.owner_id && opacity == other.opacity && | 45 owner_id == other.owner_id && opacity == other.opacity && |
| 46 screen_space_opacity == other.screen_space_opacity && | 46 screen_space_opacity == other.screen_space_opacity && |
| 47 has_render_surface == other.has_render_surface && | 47 has_render_surface == other.has_render_surface && |
| 48 has_copy_request == other.has_copy_request && | 48 has_copy_request == other.has_copy_request && |
| 49 filters == other.filters && | 49 filters == other.filters && |
| 50 background_filters == other.background_filters && | 50 background_filters == other.background_filters && |
| 51 blend_mode == other.blend_mode && | 51 blend_mode == other.blend_mode && |
| 52 surface_contents_scale == other.surface_contents_scale && | 52 surface_contents_scale == other.surface_contents_scale && |
| 53 unscaled_mask_target_size == other.unscaled_mask_target_size && |
| 53 hidden_by_backface_visibility == other.hidden_by_backface_visibility && | 54 hidden_by_backface_visibility == other.hidden_by_backface_visibility && |
| 54 double_sided == other.double_sided && is_drawn == other.is_drawn && | 55 double_sided == other.double_sided && is_drawn == other.is_drawn && |
| 55 subtree_hidden == other.subtree_hidden && | 56 subtree_hidden == other.subtree_hidden && |
| 56 has_potential_filter_animation == | 57 has_potential_filter_animation == |
| 57 other.has_potential_filter_animation && | 58 other.has_potential_filter_animation && |
| 58 has_potential_opacity_animation == | 59 has_potential_opacity_animation == |
| 59 other.has_potential_opacity_animation && | 60 other.has_potential_opacity_animation && |
| 60 is_currently_animating_filter == other.is_currently_animating_filter && | 61 is_currently_animating_filter == other.is_currently_animating_filter && |
| 61 is_currently_animating_opacity == | 62 is_currently_animating_opacity == |
| 62 other.is_currently_animating_opacity && | 63 other.is_currently_animating_opacity && |
| (...skipping 28 matching lines...) Expand all Loading... |
| 91 data->set_effect_changed(effect_changed); | 92 data->set_effect_changed(effect_changed); |
| 92 data->set_num_copy_requests_in_subtree(num_copy_requests_in_subtree); | 93 data->set_num_copy_requests_in_subtree(num_copy_requests_in_subtree); |
| 93 data->set_transform_id(transform_id); | 94 data->set_transform_id(transform_id); |
| 94 data->set_clip_id(clip_id); | 95 data->set_clip_id(clip_id); |
| 95 data->set_target_id(target_id); | 96 data->set_target_id(target_id); |
| 96 data->set_mask_layer_id(mask_layer_id); | 97 data->set_mask_layer_id(mask_layer_id); |
| 97 data->set_replica_layer_id(replica_layer_id); | 98 data->set_replica_layer_id(replica_layer_id); |
| 98 data->set_replica_mask_layer_id(replica_mask_layer_id); | 99 data->set_replica_mask_layer_id(replica_mask_layer_id); |
| 99 Vector2dFToProto(surface_contents_scale, | 100 Vector2dFToProto(surface_contents_scale, |
| 100 data->mutable_surface_contents_scale()); | 101 data->mutable_surface_contents_scale()); |
| 102 SizeToProto(unscaled_mask_target_size, |
| 103 data->mutable_unscaled_mask_target_size()); |
| 101 } | 104 } |
| 102 | 105 |
| 103 void EffectNode::FromProtobuf(const proto::TreeNode& proto) { | 106 void EffectNode::FromProtobuf(const proto::TreeNode& proto) { |
| 104 id = proto.id(); | 107 id = proto.id(); |
| 105 parent_id = proto.parent_id(); | 108 parent_id = proto.parent_id(); |
| 106 owner_id = proto.owner_id(); | 109 owner_id = proto.owner_id(); |
| 107 | 110 |
| 108 DCHECK(proto.has_effect_node_data()); | 111 DCHECK(proto.has_effect_node_data()); |
| 109 const proto::EffectNodeData& data = proto.effect_node_data(); | 112 const proto::EffectNodeData& data = proto.effect_node_data(); |
| 110 | 113 |
| 111 opacity = data.opacity(); | 114 opacity = data.opacity(); |
| 112 screen_space_opacity = data.screen_space_opacity(); | 115 screen_space_opacity = data.screen_space_opacity(); |
| 113 blend_mode = SkXfermodeModeFromProto(data.blend_mode()); | 116 blend_mode = SkXfermodeModeFromProto(data.blend_mode()); |
| 117 unscaled_mask_target_size = ProtoToSize(data.unscaled_mask_target_size()); |
| 114 has_render_surface = data.has_render_surface(); | 118 has_render_surface = data.has_render_surface(); |
| 115 has_copy_request = data.has_copy_request(); | 119 has_copy_request = data.has_copy_request(); |
| 116 hidden_by_backface_visibility = data.hidden_by_backface_visibility(); | 120 hidden_by_backface_visibility = data.hidden_by_backface_visibility(); |
| 117 double_sided = data.double_sided(); | 121 double_sided = data.double_sided(); |
| 118 is_drawn = data.is_drawn(); | 122 is_drawn = data.is_drawn(); |
| 119 subtree_hidden = data.subtree_hidden(); | 123 subtree_hidden = data.subtree_hidden(); |
| 120 has_potential_filter_animation = data.has_potential_filter_animation(); | 124 has_potential_filter_animation = data.has_potential_filter_animation(); |
| 121 has_potential_opacity_animation = data.has_potential_opacity_animation(); | 125 has_potential_opacity_animation = data.has_potential_opacity_animation(); |
| 122 is_currently_animating_filter = data.is_currently_animating_filter(); | 126 is_currently_animating_filter = data.is_currently_animating_filter(); |
| 123 is_currently_animating_opacity = data.is_currently_animating_opacity(); | 127 is_currently_animating_opacity = data.is_currently_animating_opacity(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 150 num_copy_requests_in_subtree); | 154 num_copy_requests_in_subtree); |
| 151 value->SetInteger("transform_id", transform_id); | 155 value->SetInteger("transform_id", transform_id); |
| 152 value->SetInteger("clip_id", clip_id); | 156 value->SetInteger("clip_id", clip_id); |
| 153 value->SetInteger("target_id", target_id); | 157 value->SetInteger("target_id", target_id); |
| 154 value->SetInteger("mask_layer_id", mask_layer_id); | 158 value->SetInteger("mask_layer_id", mask_layer_id); |
| 155 value->SetInteger("replica_layer_id", replica_layer_id); | 159 value->SetInteger("replica_layer_id", replica_layer_id); |
| 156 value->SetInteger("replica_mask_layer_id", replica_mask_layer_id); | 160 value->SetInteger("replica_mask_layer_id", replica_mask_layer_id); |
| 157 } | 161 } |
| 158 | 162 |
| 159 } // namespace cc | 163 } // namespace cc |
| OLD | NEW |