Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: cc/trees/effect_node.cc

Issue 2148383005: cc: Use sublayer scale from effect tree (2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/trees/effect_node.h ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/trees/effect_node.h" 8 #include "cc/trees/effect_node.h"
9 9
10 namespace cc { 10 namespace cc {
(...skipping 25 matching lines...) Expand all
36 36
37 EffectNode::EffectNode(const EffectNode& other) = default; 37 EffectNode::EffectNode(const EffectNode& other) = default;
38 38
39 bool EffectNode::operator==(const EffectNode& other) const { 39 bool EffectNode::operator==(const EffectNode& other) const {
40 return id == other.id && parent_id == other.parent_id && 40 return id == other.id && parent_id == other.parent_id &&
41 owner_id == other.owner_id && opacity == other.opacity && 41 owner_id == other.owner_id && opacity == other.opacity &&
42 screen_space_opacity == other.screen_space_opacity && 42 screen_space_opacity == other.screen_space_opacity &&
43 has_render_surface == other.has_render_surface && 43 has_render_surface == other.has_render_surface &&
44 has_copy_request == other.has_copy_request && 44 has_copy_request == other.has_copy_request &&
45 background_filters == other.background_filters && 45 background_filters == other.background_filters &&
46 sublayer_scale == other.sublayer_scale && 46 surface_contents_scale == other.surface_contents_scale &&
47 hidden_by_backface_visibility == other.hidden_by_backface_visibility && 47 hidden_by_backface_visibility == other.hidden_by_backface_visibility &&
48 double_sided == other.double_sided && is_drawn == other.is_drawn && 48 double_sided == other.double_sided && is_drawn == other.is_drawn &&
49 subtree_hidden == other.subtree_hidden && 49 subtree_hidden == other.subtree_hidden &&
50 has_potential_opacity_animation == 50 has_potential_opacity_animation ==
51 other.has_potential_opacity_animation && 51 other.has_potential_opacity_animation &&
52 is_currently_animating_opacity == 52 is_currently_animating_opacity ==
53 other.is_currently_animating_opacity && 53 other.is_currently_animating_opacity &&
54 effect_changed == other.effect_changed && 54 effect_changed == other.effect_changed &&
55 num_copy_requests_in_subtree == other.num_copy_requests_in_subtree && 55 num_copy_requests_in_subtree == other.num_copy_requests_in_subtree &&
56 transform_id == other.transform_id && clip_id == other.clip_id && 56 transform_id == other.transform_id && clip_id == other.clip_id &&
(...skipping 20 matching lines...) Expand all
77 data->set_has_potential_opacity_animation(has_potential_opacity_animation); 77 data->set_has_potential_opacity_animation(has_potential_opacity_animation);
78 data->set_is_currently_animating_opacity(is_currently_animating_opacity); 78 data->set_is_currently_animating_opacity(is_currently_animating_opacity);
79 data->set_effect_changed(effect_changed); 79 data->set_effect_changed(effect_changed);
80 data->set_num_copy_requests_in_subtree(num_copy_requests_in_subtree); 80 data->set_num_copy_requests_in_subtree(num_copy_requests_in_subtree);
81 data->set_transform_id(transform_id); 81 data->set_transform_id(transform_id);
82 data->set_clip_id(clip_id); 82 data->set_clip_id(clip_id);
83 data->set_target_id(target_id); 83 data->set_target_id(target_id);
84 data->set_mask_layer_id(mask_layer_id); 84 data->set_mask_layer_id(mask_layer_id);
85 data->set_replica_layer_id(replica_layer_id); 85 data->set_replica_layer_id(replica_layer_id);
86 data->set_replica_mask_layer_id(replica_mask_layer_id); 86 data->set_replica_mask_layer_id(replica_mask_layer_id);
87 Vector2dFToProto(sublayer_scale, data->mutable_sublayer_scale()); 87 Vector2dFToProto(surface_contents_scale,
88 data->mutable_surface_contents_scale());
88 } 89 }
89 90
90 void EffectNode::FromProtobuf(const proto::TreeNode& proto) { 91 void EffectNode::FromProtobuf(const proto::TreeNode& proto) {
91 id = proto.id(); 92 id = proto.id();
92 parent_id = proto.parent_id(); 93 parent_id = proto.parent_id();
93 owner_id = proto.owner_id(); 94 owner_id = proto.owner_id();
94 95
95 DCHECK(proto.has_effect_node_data()); 96 DCHECK(proto.has_effect_node_data());
96 const proto::EffectNodeData& data = proto.effect_node_data(); 97 const proto::EffectNodeData& data = proto.effect_node_data();
97 98
98 opacity = data.opacity(); 99 opacity = data.opacity();
99 screen_space_opacity = data.screen_space_opacity(); 100 screen_space_opacity = data.screen_space_opacity();
100 has_render_surface = data.has_render_surface(); 101 has_render_surface = data.has_render_surface();
101 has_copy_request = data.has_copy_request(); 102 has_copy_request = data.has_copy_request();
102 hidden_by_backface_visibility = data.hidden_by_backface_visibility(); 103 hidden_by_backface_visibility = data.hidden_by_backface_visibility();
103 double_sided = data.double_sided(); 104 double_sided = data.double_sided();
104 is_drawn = data.is_drawn(); 105 is_drawn = data.is_drawn();
105 subtree_hidden = data.subtree_hidden(); 106 subtree_hidden = data.subtree_hidden();
106 has_potential_opacity_animation = data.has_potential_opacity_animation(); 107 has_potential_opacity_animation = data.has_potential_opacity_animation();
107 is_currently_animating_opacity = data.is_currently_animating_opacity(); 108 is_currently_animating_opacity = data.is_currently_animating_opacity();
108 effect_changed = data.effect_changed(); 109 effect_changed = data.effect_changed();
109 num_copy_requests_in_subtree = data.num_copy_requests_in_subtree(); 110 num_copy_requests_in_subtree = data.num_copy_requests_in_subtree();
110 transform_id = data.transform_id(); 111 transform_id = data.transform_id();
111 clip_id = data.clip_id(); 112 clip_id = data.clip_id();
112 target_id = data.target_id(); 113 target_id = data.target_id();
113 mask_layer_id = data.mask_layer_id(); 114 mask_layer_id = data.mask_layer_id();
114 replica_layer_id = data.replica_layer_id(); 115 replica_layer_id = data.replica_layer_id();
115 replica_mask_layer_id = data.replica_mask_layer_id(); 116 replica_mask_layer_id = data.replica_mask_layer_id();
116 sublayer_scale = ProtoToVector2dF(data.sublayer_scale()); 117 surface_contents_scale = ProtoToVector2dF(data.surface_contents_scale());
117 } 118 }
118 119
119 void EffectNode::AsValueInto(base::trace_event::TracedValue* value) const { 120 void EffectNode::AsValueInto(base::trace_event::TracedValue* value) const {
120 value->SetInteger("id", id); 121 value->SetInteger("id", id);
121 value->SetInteger("parent_id", parent_id); 122 value->SetInteger("parent_id", parent_id);
122 value->SetInteger("owner_id", owner_id); 123 value->SetInteger("owner_id", owner_id);
123 value->SetDouble("opacity", opacity); 124 value->SetDouble("opacity", opacity);
124 value->SetBoolean("has_render_surface", has_render_surface); 125 value->SetBoolean("has_render_surface", has_render_surface);
125 value->SetBoolean("has_copy_request", has_copy_request); 126 value->SetBoolean("has_copy_request", has_copy_request);
126 value->SetBoolean("double_sided", double_sided); 127 value->SetBoolean("double_sided", double_sided);
127 value->SetBoolean("is_drawn", is_drawn); 128 value->SetBoolean("is_drawn", is_drawn);
128 value->SetBoolean("has_potential_opacity_animation", 129 value->SetBoolean("has_potential_opacity_animation",
129 has_potential_opacity_animation); 130 has_potential_opacity_animation);
130 value->SetBoolean("effect_changed", effect_changed); 131 value->SetBoolean("effect_changed", effect_changed);
131 value->SetInteger("num_copy_requests_in_subtree", 132 value->SetInteger("num_copy_requests_in_subtree",
132 num_copy_requests_in_subtree); 133 num_copy_requests_in_subtree);
133 value->SetInteger("transform_id", transform_id); 134 value->SetInteger("transform_id", transform_id);
134 value->SetInteger("clip_id", clip_id); 135 value->SetInteger("clip_id", clip_id);
135 value->SetInteger("target_id", target_id); 136 value->SetInteger("target_id", target_id);
136 value->SetInteger("mask_layer_id", mask_layer_id); 137 value->SetInteger("mask_layer_id", mask_layer_id);
137 value->SetInteger("replica_layer_id", replica_layer_id); 138 value->SetInteger("replica_layer_id", replica_layer_id);
138 value->SetInteger("replica_mask_layer_id", replica_mask_layer_id); 139 value->SetInteger("replica_mask_layer_id", replica_mask_layer_id);
139 } 140 }
140 141
141 } // namespace cc 142 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/effect_node.h ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698