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

Unified Diff: cc/trees/property_tree.h

Issue 2032213002: cc: Put to_target and to_screen behind an accessor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/draw_property_utils.cc ('k') | cc/trees/property_tree.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/property_tree.h
diff --git a/cc/trees/property_tree.h b/cc/trees/property_tree.h
index 4264a1c6962fb911ae170753e3f01bf2751dce09..ac977a37108f01256c2c1bb082724819b506d945 100644
--- a/cc/trees/property_tree.h
+++ b/cc/trees/property_tree.h
@@ -31,7 +31,8 @@ class EffectNodeData;
class PropertyTree;
class PropertyTrees;
class ScrollNodeData;
-class TranformNodeData;
+class TransformNodeData;
+class TransformCachedNodeData;
class TransformTreeData;
class TreeNode;
}
@@ -94,17 +95,6 @@ struct CC_EXPORT TransformNodeData {
gfx::Transform to_parent;
- gfx::Transform to_target;
- gfx::Transform from_target;
-
- gfx::Transform to_screen;
- gfx::Transform from_screen;
-
- int target_id;
- // This id is used for all content that draws into a render surface associated
- // with this transform node.
- int content_target_id;
-
// This is the node with respect to which source_offset is defined. This will
// not be needed once layerization moves to cc, but is needed in order to
// efficiently update the transform tree for changes to position in the layer
@@ -213,6 +203,26 @@ struct CC_EXPORT TransformNodeData {
void AsValueInto(base::trace_event::TracedValue* value) const;
};
+struct CC_EXPORT TransformCachedNodeData {
+ TransformCachedNodeData();
+ TransformCachedNodeData(const TransformCachedNodeData& other);
+ ~TransformCachedNodeData();
+
+ gfx::Transform from_target;
+ gfx::Transform to_target;
+ gfx::Transform from_screen;
+ gfx::Transform to_screen;
+ int target_id;
+ // This id is used for all content that draws into a render surface associated
+ // with this transform node.
+ int content_target_id;
+
+ bool operator==(const TransformCachedNodeData& other) const;
+
+ void ToProtobuf(proto::TransformCachedNodeData* proto) const;
+ void FromProtobuf(const proto::TransformCachedNodeData& proto);
+};
+
typedef TreeNode<TransformNodeData> TransformNode;
struct CC_EXPORT ClipNodeData {
@@ -406,6 +416,8 @@ class CC_EXPORT TransformTree final : public PropertyTree<TransformNode> {
bool operator==(const TransformTree& other) const;
+ int Insert(const TransformNode& tree_node, int parent_id);
+
void clear();
// Computes the change of basis transform from node |source_id| to |dest_id|.
@@ -505,6 +517,28 @@ class CC_EXPORT TransformTree final : public PropertyTree<TransformNode> {
return nodes_affected_by_outer_viewport_bounds_delta_;
}
+ const gfx::Transform& FromTarget(int node_id) const;
+ void SetFromTarget(int node_id, const gfx::Transform& transform);
+
+ const gfx::Transform& ToTarget(int node_id) const;
+ void SetToTarget(int node_id, const gfx::Transform& transform);
+
+ const gfx::Transform& FromScreen(int node_id) const;
+ void SetFromScreen(int node_id, const gfx::Transform& transform);
+
+ const gfx::Transform& ToScreen(int node_id) const;
+ void SetToScreen(int node_id, const gfx::Transform& transform);
+
+ int TargetId(int node_id) const;
+ void SetTargetId(int node_id, int target_id);
+
+ int ContentTargetId(int node_id) const;
+ void SetContentTargetId(int node_id, int content_target_id);
+
+ const std::vector<TransformCachedNodeData>& cached_data() const {
+ return cached_data_;
+ }
+
gfx::Transform ToScreenSpaceTransformWithoutSublayerScale(int id) const;
void ToProtobuf(proto::PropertyTree* proto) const;
@@ -555,6 +589,7 @@ class CC_EXPORT TransformTree final : public PropertyTree<TransformNode> {
float device_transform_scale_factor_;
std::vector<int> nodes_affected_by_inner_viewport_bounds_delta_;
std::vector<int> nodes_affected_by_outer_viewport_bounds_delta_;
+ std::vector<TransformCachedNodeData> cached_data_;
};
class CC_EXPORT ClipTree final : public PropertyTree<ClipNode> {
« no previous file with comments | « cc/trees/draw_property_utils.cc ('k') | cc/trees/property_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698