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

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

Issue 2781483006: cc : Compute render surface is_clipped outside 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 surface_is_clipped(false),
21 has_copy_request(false), 20 has_copy_request(false),
22 hidden_by_backface_visibility(false), 21 hidden_by_backface_visibility(false),
23 double_sided(false), 22 double_sided(false),
24 is_drawn(true), 23 is_drawn(true),
25 subtree_hidden(false), 24 subtree_hidden(false),
26 has_potential_filter_animation(false), 25 has_potential_filter_animation(false),
27 has_potential_opacity_animation(false), 26 has_potential_opacity_animation(false),
28 is_currently_animating_filter(false), 27 is_currently_animating_filter(false),
29 is_currently_animating_opacity(false), 28 is_currently_animating_opacity(false),
30 effect_changed(false), 29 effect_changed(false),
31 num_copy_requests_in_subtree(0), 30 num_copy_requests_in_subtree(0),
32 has_unclipped_descendants(false),
33 transform_id(0), 31 transform_id(0),
34 clip_id(0), 32 clip_id(0),
35 target_id(1), 33 target_id(1),
36 mask_layer_id(-1) {} 34 mask_layer_id(-1) {}
37 35
38 EffectNode::EffectNode(const EffectNode& other) = default; 36 EffectNode::EffectNode(const EffectNode& other) = default;
39 37
40 bool EffectNode::operator==(const EffectNode& other) const { 38 bool EffectNode::operator==(const EffectNode& other) const {
41 return id == other.id && parent_id == other.parent_id && 39 return id == other.id && parent_id == other.parent_id &&
42 owning_layer_id == other.owning_layer_id && opacity == other.opacity && 40 owning_layer_id == other.owning_layer_id && opacity == other.opacity &&
43 screen_space_opacity == other.screen_space_opacity && 41 screen_space_opacity == other.screen_space_opacity &&
44 has_render_surface == other.has_render_surface && 42 has_render_surface == other.has_render_surface &&
45 surface_is_clipped == other.surface_is_clipped &&
46 has_copy_request == other.has_copy_request && 43 has_copy_request == other.has_copy_request &&
47 filters == other.filters && 44 filters == other.filters &&
48 background_filters == other.background_filters && 45 background_filters == other.background_filters &&
49 filters_origin == other.filters_origin && 46 filters_origin == other.filters_origin &&
50 blend_mode == other.blend_mode && 47 blend_mode == other.blend_mode &&
51 surface_contents_scale == other.surface_contents_scale && 48 surface_contents_scale == other.surface_contents_scale &&
52 unscaled_mask_target_size == other.unscaled_mask_target_size && 49 unscaled_mask_target_size == other.unscaled_mask_target_size &&
53 hidden_by_backface_visibility == other.hidden_by_backface_visibility && 50 hidden_by_backface_visibility == other.hidden_by_backface_visibility &&
54 double_sided == other.double_sided && is_drawn == other.is_drawn && 51 double_sided == other.double_sided && is_drawn == other.is_drawn &&
55 subtree_hidden == other.subtree_hidden && 52 subtree_hidden == other.subtree_hidden &&
56 has_potential_filter_animation == 53 has_potential_filter_animation ==
57 other.has_potential_filter_animation && 54 other.has_potential_filter_animation &&
58 has_potential_opacity_animation == 55 has_potential_opacity_animation ==
59 other.has_potential_opacity_animation && 56 other.has_potential_opacity_animation &&
60 is_currently_animating_filter == other.is_currently_animating_filter && 57 is_currently_animating_filter == other.is_currently_animating_filter &&
61 is_currently_animating_opacity == 58 is_currently_animating_opacity ==
62 other.is_currently_animating_opacity && 59 other.is_currently_animating_opacity &&
63 effect_changed == other.effect_changed && 60 effect_changed == other.effect_changed &&
64 num_copy_requests_in_subtree == other.num_copy_requests_in_subtree && 61 num_copy_requests_in_subtree == other.num_copy_requests_in_subtree &&
65 transform_id == other.transform_id && clip_id == other.clip_id && 62 transform_id == other.transform_id && clip_id == other.clip_id &&
66 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;
67 } 64 }
68 65
69 void EffectNode::AsValueInto(base::trace_event::TracedValue* value) const { 66 void EffectNode::AsValueInto(base::trace_event::TracedValue* value) const {
70 value->SetInteger("id", id); 67 value->SetInteger("id", id);
71 value->SetInteger("parent_id", parent_id); 68 value->SetInteger("parent_id", parent_id);
72 value->SetInteger("owning_layer_id", owning_layer_id); 69 value->SetInteger("owning_layer_id", owning_layer_id);
73 value->SetDouble("opacity", opacity); 70 value->SetDouble("opacity", opacity);
74 value->SetBoolean("has_render_surface", has_render_surface); 71 value->SetBoolean("has_render_surface", has_render_surface);
75 value->SetBoolean("surface_is_clipped", surface_is_clipped);
76 value->SetBoolean("has_copy_request", has_copy_request); 72 value->SetBoolean("has_copy_request", has_copy_request);
77 value->SetBoolean("double_sided", double_sided); 73 value->SetBoolean("double_sided", double_sided);
78 value->SetBoolean("is_drawn", is_drawn); 74 value->SetBoolean("is_drawn", is_drawn);
79 value->SetBoolean("has_potential_filter_animation", 75 value->SetBoolean("has_potential_filter_animation",
80 has_potential_filter_animation); 76 has_potential_filter_animation);
81 value->SetBoolean("has_potential_opacity_animation", 77 value->SetBoolean("has_potential_opacity_animation",
82 has_potential_opacity_animation); 78 has_potential_opacity_animation);
83 value->SetBoolean("effect_changed", effect_changed); 79 value->SetBoolean("effect_changed", effect_changed);
84 value->SetInteger("num_copy_requests_in_subtree", 80 value->SetInteger("num_copy_requests_in_subtree",
85 num_copy_requests_in_subtree); 81 num_copy_requests_in_subtree);
86 value->SetInteger("transform_id", transform_id); 82 value->SetInteger("transform_id", transform_id);
87 value->SetInteger("clip_id", clip_id); 83 value->SetInteger("clip_id", clip_id);
88 value->SetInteger("target_id", target_id); 84 value->SetInteger("target_id", target_id);
89 value->SetInteger("mask_layer_id", mask_layer_id); 85 value->SetInteger("mask_layer_id", mask_layer_id);
90 } 86 }
91 87
92 } // namespace cc 88 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698