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

Side by Side Diff: sky/engine/core/rendering/RenderObject.cpp

Issue 958463002: Cleanup transform-related methods in RenderLayer. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: improve test Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « sky/engine/core/rendering/RenderObject.h ('k') | sky/engine/core/rendering/RenderView.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after
1420 // so check the layer's transform directly. 1420 // so check the layer's transform directly.
1421 return (hasLayer() && toRenderBox(this)->layer()->transform()) || (container Object && containerObject->style()->hasPerspective()); 1421 return (hasLayer() && toRenderBox(this)->layer()->transform()) || (container Object && containerObject->style()->hasPerspective());
1422 } 1422 }
1423 1423
1424 void RenderObject::getTransformFromContainer(const RenderObject* containerObject , const LayoutSize& offsetInContainer, TransformationMatrix& transform) const 1424 void RenderObject::getTransformFromContainer(const RenderObject* containerObject , const LayoutSize& offsetInContainer, TransformationMatrix& transform) const
1425 { 1425 {
1426 transform.makeIdentity(); 1426 transform.makeIdentity();
1427 transform.translate(offsetInContainer.width().toFloat(), offsetInContainer.h eight().toFloat()); 1427 transform.translate(offsetInContainer.width().toFloat(), offsetInContainer.h eight().toFloat());
1428 RenderLayer* layer = hasLayer() ? toRenderBox(this)->layer() : 0; 1428 RenderLayer* layer = hasLayer() ? toRenderBox(this)->layer() : 0;
1429 if (layer && layer->transform()) 1429 if (layer && layer->transform())
1430 transform.multiply(layer->currentTransform()); 1430 transform.multiply(*layer->transform());
1431 1431
1432 if (containerObject && containerObject->hasLayer() && containerObject->style ()->hasPerspective()) { 1432 if (containerObject && containerObject->hasLayer() && containerObject->style ()->hasPerspective()) {
1433 // Perpsective on the container affects us, so we have to factor it in h ere. 1433 // Perpsective on the container affects us, so we have to factor it in h ere.
1434 ASSERT(containerObject->hasLayer()); 1434 ASSERT(containerObject->hasLayer());
1435 FloatPoint perspectiveOrigin = toRenderBox(containerObject)->layer()->pe rspectiveOrigin(); 1435 FloatPoint perspectiveOrigin = toRenderBox(containerObject)->layer()->pe rspectiveOrigin();
1436 1436
1437 TransformationMatrix perspectiveMatrix; 1437 TransformationMatrix perspectiveMatrix;
1438 perspectiveMatrix.applyPerspective(containerObject->style()->perspective ()); 1438 perspectiveMatrix.applyPerspective(containerObject->style()->perspective ());
1439 1439
1440 transform.translateRight3d(-perspectiveOrigin.x(), -perspectiveOrigin.y( ), 0); 1440 transform.translateRight3d(-perspectiveOrigin.x(), -perspectiveOrigin.y( ), 0);
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
1972 { 1972 {
1973 if (object1) { 1973 if (object1) {
1974 const blink::RenderObject* root = object1; 1974 const blink::RenderObject* root = object1;
1975 while (root->parent()) 1975 while (root->parent())
1976 root = root->parent(); 1976 root = root->parent();
1977 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 1977 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
1978 } 1978 }
1979 } 1979 }
1980 1980
1981 #endif 1981 #endif
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderObject.h ('k') | sky/engine/core/rendering/RenderView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698