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

Unified Diff: cc/trees/property_tree.cc

Issue 2655233006: cc : Clean up cc clip tree (Closed)
Patch Set: bug number test expectations Created 3 years, 9 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
Index: cc/trees/property_tree.cc
diff --git a/cc/trees/property_tree.cc b/cc/trees/property_tree.cc
index b2ee4daa8170d1eab1bff1599f8802b688bec07e..c1c6e5da7521cc82fcca03d9db1b70e458930445 100644
--- a/cc/trees/property_tree.cc
+++ b/cc/trees/property_tree.cc
@@ -1951,6 +1951,10 @@ void PropertyTrees::SetAnimationScalesForTesting(
bool PropertyTrees::GetToTarget(int transform_id,
int effect_id,
gfx::Transform* to_target) const {
+ if (effect_id == EffectTree::kContentsRootNodeId) {
+ *to_target = transform_tree.ToScreen(transform_id);
+ return true;
+ }
DrawTransforms& transforms = GetDrawTransforms(transform_id, effect_id);
if (transforms.to_valid) {
*to_target = transforms.to_target;
@@ -1969,6 +1973,12 @@ bool PropertyTrees::GetToTarget(int transform_id,
bool PropertyTrees::GetFromTarget(int transform_id,
int effect_id,
gfx::Transform* from_target) const {
+ const TransformNode* node = transform_tree.Node(transform_id);
+ if (node->ancestors_are_invertible &&
+ effect_id == EffectTree::kContentsRootNodeId) {
+ *from_target = transform_tree.FromScreen(transform_id);
+ return true;
+ }
DrawTransforms& transforms = GetDrawTransforms(transform_id, effect_id);
if (transforms.from_valid) {
*from_target = transforms.from_target;
@@ -2004,6 +2014,17 @@ DrawTransformData& PropertyTrees::FetchDrawTransformsDataFromCache(
return data;
}
+ClipRectData* PropertyTrees::FetchClipRectFromCache(int clip_id,
+ int target_id) {
+ ClipNode* clip_node = clip_tree.Node(clip_id);
+ for (auto& data : clip_node->cached_clip_rects) {
+ if (data.target_id == target_id || data.target_id == -1)
+ return &data;
+ }
+ clip_node->cached_clip_rects.push_back(ClipRectData());
+ return &clip_node->cached_clip_rects.back();
+}
+
DrawTransforms& PropertyTrees::GetDrawTransforms(int transform_id,
int effect_id) const {
const EffectNode* effect_node = effect_tree.Node(effect_id);

Powered by Google App Engine
This is Rietveld 408576698