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

Unified Diff: cc/trees/draw_property_utils.h

Issue 687873004: Introduce Property Trees (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wip-awoloszyn2
Patch Set: . Created 6 years 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
Index: cc/trees/draw_property_utils.h
diff --git a/cc/trees/draw_property_utils.h b/cc/trees/draw_property_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..668ab2827796f202f67d81f2766a3e7eb792e290
--- /dev/null
+++ b/cc/trees/draw_property_utils.h
@@ -0,0 +1,56 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_TREES_DRAW_PROPERTY_UTILS_H_
+#define CC_TREES_DRAW_PROPERTY_UTILS_H_
+
+#include "cc/base/cc_export.h"
+
+namespace gfx {
+class Rect;
+class Transform;
+} // namespace gfx
+
+namespace cc {
+
+class Layer;
+
+struct ClipNodeData;
+struct TransformNodeData;
+
+template <typename T>
+struct TreeNode;
+
+template <typename T>
+class PropertyTree;
+
+// Computes combined clips for every node in |clip_tree|. This function requires
+// that |transform_tree| has been updated via |ComputeTransforms|.
+// TODO(vollick): ComputeClips and ComputeTransforms will eventually need to be
+// done on both threads.
+void CC_EXPORT
+ComputeClips(PropertyTree<TreeNode<ClipNodeData>>* clip_tree,
+ const PropertyTree<TreeNode<TransformNodeData>>& transform_tree);
+
+// Computes combined (screen space) transforms for every node in the transform
+// tree. This must be done prior to calling |ComputeClips|.
+void CC_EXPORT
+ComputeTransforms(PropertyTree<TreeNode<TransformNodeData>>* transform_tree);
+
+// Computes the visible content rect for every layer under |root_layer|. The
+// visible content rect is the clipped content space rect that will be used for
+// recording.
+void CC_EXPORT ComputeVisibleRectsUsingPropertyTrees(
+ Layer* root_layer,
+ const Layer* page_scale_layer,
+ float page_scale_factor,
+ float device_scale_factor,
+ const gfx::Rect& viewport,
+ const gfx::Transform& device_transform,
+ PropertyTree<TreeNode<TransformNodeData>>* transform_tree,
+ PropertyTree<TreeNode<ClipNodeData>>* clip_tree);
+
+} // namespace cc
+
+#endif // CC_TREES_DRAW_PROPERTY_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698