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

Unified Diff: ui/compositor/layer.cc

Issue 11418040: gfx::Transform API clean-up (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 1 month 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 | « ui/compositor/debug_utils.cc ('k') | ui/compositor/layer_animation_element_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer.cc
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index ff65b17e809b7afe595f05d6e3e252c83f256b1e..00d0c5ae26ba0f2cae90b9dbaeadff22fb9c3dae 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -601,10 +601,12 @@ bool Layer::GetTransformRelativeTo(const Layer* ancestor,
gfx::Transform* transform) const {
const Layer* p = this;
for (; p && p != ancestor; p = p->parent()) {
+ gfx::Transform translation;
+ translation.Translate(static_cast<float>(p->bounds().x()),
+ static_cast<float>(p->bounds().y()));
if (!p->transform().IsIdentity())
transform->ConcatTransform(p->transform());
- transform->ConcatTranslate(static_cast<float>(p->bounds().x()),
- static_cast<float>(p->bounds().y()));
+ transform->ConcatTransform(translation);
}
return p == ancestor;
}
@@ -766,7 +768,9 @@ void Layer::RecomputeTransform() {
0, 1.0f / device_scale_factor_, 0,
0, 0, 1);
transform.ConcatTransform(transform_);
- transform.ConcatTranslate(bounds_.x(), bounds_.y());
+ gfx::Transform translate;
+ translate.Translate(bounds_.x(), bounds_.y());
+ transform.ConcatTransform(translate);
transform.ConcatTransform(scale_translate);
cc_layer_->setTransform(WebKit::WebTransformationMatrix(transform));
}
« no previous file with comments | « ui/compositor/debug_utils.cc ('k') | ui/compositor/layer_animation_element_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698