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

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

Issue 2822303003: cc : Compute subtree has copy requests before property tree building (Closed)
Patch Set: . Created 3 years, 8 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
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/layers/layer.h" 6 #include "cc/layers/layer.h"
7 #include "cc/trees/effect_node.h" 7 #include "cc/trees/effect_node.h"
8 #include "cc/trees/property_tree.h" 8 #include "cc/trees/property_tree.h"
9 9
10 namespace cc { 10 namespace cc {
11 11
12 EffectNode::EffectNode() 12 EffectNode::EffectNode()
13 : id(EffectTree::kInvalidNodeId), 13 : id(EffectTree::kInvalidNodeId),
14 parent_id(EffectTree::kInvalidNodeId), 14 parent_id(EffectTree::kInvalidNodeId),
15 owning_layer_id(Layer::INVALID_ID), 15 owning_layer_id(Layer::INVALID_ID),
16 opacity(1.f), 16 opacity(1.f),
17 screen_space_opacity(1.f), 17 screen_space_opacity(1.f),
18 blend_mode(SkBlendMode::kSrcOver), 18 blend_mode(SkBlendMode::kSrcOver),
19 has_render_surface(false), 19 has_render_surface(false),
20 has_copy_request(false), 20 has_copy_request(false),
21 hidden_by_backface_visibility(false), 21 hidden_by_backface_visibility(false),
22 double_sided(false), 22 double_sided(false),
23 is_drawn(true), 23 is_drawn(true),
24 subtree_hidden(false), 24 subtree_hidden(false),
25 has_potential_filter_animation(false), 25 has_potential_filter_animation(false),
26 has_potential_opacity_animation(false), 26 has_potential_opacity_animation(false),
27 is_currently_animating_filter(false), 27 is_currently_animating_filter(false),
28 is_currently_animating_opacity(false), 28 is_currently_animating_opacity(false),
29 effect_changed(false), 29 effect_changed(false),
30 num_copy_requests_in_subtree(0), 30 subtree_has_copy_request(0),
31 transform_id(0), 31 transform_id(0),
32 clip_id(0), 32 clip_id(0),
33 target_id(1), 33 target_id(1),
34 mask_layer_id(-1) {} 34 mask_layer_id(-1) {}
35 35
36 EffectNode::EffectNode(const EffectNode& other) = default; 36 EffectNode::EffectNode(const EffectNode& other) = default;
37 37
38 bool EffectNode::operator==(const EffectNode& other) const { 38 bool EffectNode::operator==(const EffectNode& other) const {
39 return id == other.id && parent_id == other.parent_id && 39 return id == other.id && parent_id == other.parent_id &&
40 owning_layer_id == other.owning_layer_id && opacity == other.opacity && 40 owning_layer_id == other.owning_layer_id && opacity == other.opacity &&
(...skipping 10 matching lines...) Expand all
51 double_sided == other.double_sided && is_drawn == other.is_drawn && 51 double_sided == other.double_sided && is_drawn == other.is_drawn &&
52 subtree_hidden == other.subtree_hidden && 52 subtree_hidden == other.subtree_hidden &&
53 has_potential_filter_animation == 53 has_potential_filter_animation ==
54 other.has_potential_filter_animation && 54 other.has_potential_filter_animation &&
55 has_potential_opacity_animation == 55 has_potential_opacity_animation ==
56 other.has_potential_opacity_animation && 56 other.has_potential_opacity_animation &&
57 is_currently_animating_filter == other.is_currently_animating_filter && 57 is_currently_animating_filter == other.is_currently_animating_filter &&
58 is_currently_animating_opacity == 58 is_currently_animating_opacity ==
59 other.is_currently_animating_opacity && 59 other.is_currently_animating_opacity &&
60 effect_changed == other.effect_changed && 60 effect_changed == other.effect_changed &&
61 num_copy_requests_in_subtree == other.num_copy_requests_in_subtree && 61 subtree_has_copy_request == other.subtree_has_copy_request &&
62 transform_id == other.transform_id && clip_id == other.clip_id && 62 transform_id == other.transform_id && clip_id == other.clip_id &&
63 target_id == other.target_id && mask_layer_id == other.mask_layer_id; 63 target_id == other.target_id && mask_layer_id == other.mask_layer_id;
64 } 64 }
65 65
66 void EffectNode::AsValueInto(base::trace_event::TracedValue* value) const { 66 void EffectNode::AsValueInto(base::trace_event::TracedValue* value) const {
67 value->SetInteger("id", id); 67 value->SetInteger("id", id);
68 value->SetInteger("parent_id", parent_id); 68 value->SetInteger("parent_id", parent_id);
69 value->SetInteger("owning_layer_id", owning_layer_id); 69 value->SetInteger("owning_layer_id", owning_layer_id);
70 value->SetDouble("opacity", opacity); 70 value->SetDouble("opacity", opacity);
71 value->SetBoolean("has_render_surface", has_render_surface); 71 value->SetBoolean("has_render_surface", has_render_surface);
72 value->SetBoolean("has_copy_request", has_copy_request); 72 value->SetBoolean("has_copy_request", has_copy_request);
73 value->SetBoolean("double_sided", double_sided); 73 value->SetBoolean("double_sided", double_sided);
74 value->SetBoolean("is_drawn", is_drawn); 74 value->SetBoolean("is_drawn", is_drawn);
75 value->SetBoolean("has_potential_filter_animation", 75 value->SetBoolean("has_potential_filter_animation",
76 has_potential_filter_animation); 76 has_potential_filter_animation);
77 value->SetBoolean("has_potential_opacity_animation", 77 value->SetBoolean("has_potential_opacity_animation",
78 has_potential_opacity_animation); 78 has_potential_opacity_animation);
79 value->SetBoolean("effect_changed", effect_changed); 79 value->SetBoolean("effect_changed", effect_changed);
80 value->SetInteger("num_copy_requests_in_subtree", 80 value->SetInteger("subtree_has_copy_request", subtree_has_copy_request);
81 num_copy_requests_in_subtree);
82 value->SetInteger("transform_id", transform_id); 81 value->SetInteger("transform_id", transform_id);
83 value->SetInteger("clip_id", clip_id); 82 value->SetInteger("clip_id", clip_id);
84 value->SetInteger("target_id", target_id); 83 value->SetInteger("target_id", target_id);
85 value->SetInteger("mask_layer_id", mask_layer_id); 84 value->SetInteger("mask_layer_id", mask_layer_id);
86 } 85 }
87 86
88 } // namespace cc 87 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698