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

Unified Diff: cc/trees/property_tree.cc

Issue 2187403002: cc : Use screen space transform for computing translation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/property_tree.cc
diff --git a/cc/trees/property_tree.cc b/cc/trees/property_tree.cc
index 12e42508beb4fbf3146215d675ecbebf7ff48e3f..ac2a36d9013943556da31eecc3c2fcfcf61e4289 100644
--- a/cc/trees/property_tree.cc
+++ b/cc/trees/property_tree.cc
@@ -161,10 +161,25 @@ bool TransformTree::ComputeTransform(int source_id,
bool TransformTree::ComputeTranslation(int source_id,
int dest_id,
gfx::Transform* transform) const {
- bool success = ComputeTransform(source_id, dest_id, transform);
+ // Since the transform between source and destination is atmost translation,
ajuma 2016/07/28 19:06:14 nit: "at most" (missing space)
jaydasika 2016/07/28 19:12:53 Done.
+ // flattenning will not effect the result and we can use the screen space
ajuma 2016/07/28 19:06:14 s/effect/affect
jaydasika 2016/07/28 19:12:52 Done.
+ // transforms.
+ transform->MakeIdentity();
+ if (source_id == dest_id)
+ return true;
+
+ const TransformNode* dest = Node(dest_id);
+ if (dest->ancestors_are_invertible) {
+ if (source_id != kInvalidNodeId)
+ transform->ConcatTransform(ToScreen(source_id));
+ if (dest_id != kInvalidNodeId)
+ transform->ConcatTransform(FromScreen(dest_id));
+ } else {
+ return false;
+ }
DCHECK(
transform->IsApproximatelyIdentityOrTranslation(SkDoubleToMScalar(1e-4)));
- return success;
+ return true;
}
bool TransformTree::NeedsSourceToParentUpdate(TransformNode* node) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698