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

Side by Side Diff: Source/core/rendering/compositing/CompositedLayerMapping.cpp

Issue 193663004: The "children transform layer" needs an anchor point (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Need to apply the anchor point to any layer that could be the children transform layer. Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/compositing/child-transform-with-anchor-point-expected.html ('k') | no next file » | 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) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 // Compute the anchor point, which is in the center of the renderer box unless transform-origin is set. 746 // Compute the anchor point, which is in the center of the renderer box unless transform-origin is set.
747 FloatPoint3D anchor( 747 FloatPoint3D anchor(
748 relativeCompositingBounds.width() ? (layerBounds.x() - relativeCompo sitingBounds.x() + transformOrigin.x()) / relativeCompositingBounds.width() : 0 .5f, 748 relativeCompositingBounds.width() ? (layerBounds.x() - relativeCompo sitingBounds.x() + transformOrigin.x()) / relativeCompositingBounds.width() : 0 .5f,
749 relativeCompositingBounds.height() ? (layerBounds.y() - relativeComp ositingBounds.y() + transformOrigin.y()) / relativeCompositingBounds.height() : 0.5f, 749 relativeCompositingBounds.height() ? (layerBounds.y() - relativeComp ositingBounds.y() + transformOrigin.y()) / relativeCompositingBounds.height() : 0.5f,
750 transformOrigin.z()); 750 transformOrigin.z());
751 m_graphicsLayer->setAnchorPoint(anchor); 751 m_graphicsLayer->setAnchorPoint(anchor);
752 } else { 752 } else {
753 m_graphicsLayer->setAnchorPoint(FloatPoint3D(0.5f, 0.5f, 0)); 753 m_graphicsLayer->setAnchorPoint(FloatPoint3D(0.5f, 0.5f, 0));
754 } 754 }
755 755
756 if (GraphicsLayer* childrenTransformLayer = layerForChildrenTransform())
757 childrenTransformLayer->setAnchorPoint(m_graphicsLayer->anchorPoint());
758
756 if (m_foregroundLayer) { 759 if (m_foregroundLayer) {
757 FloatSize foregroundSize = contentsSize; 760 FloatSize foregroundSize = contentsSize;
758 IntSize foregroundOffset = m_graphicsLayer->offsetFromRenderer(); 761 IntSize foregroundOffset = m_graphicsLayer->offsetFromRenderer();
759 if (hasClippingLayer()) { 762 if (hasClippingLayer()) {
760 // If we have a clipping layer (which clips descendants), then the f oreground layer is a child of it, 763 // If we have a clipping layer (which clips descendants), then the f oreground layer is a child of it,
761 // so that it gets correctly sorted with children. In that case, pos ition relative to the clipping layer. 764 // so that it gets correctly sorted with children. In that case, pos ition relative to the clipping layer.
762 foregroundSize = FloatSize(clippingBox.size()); 765 foregroundSize = FloatSize(clippingBox.size());
763 foregroundOffset = toIntSize(clippingBox.location()); 766 foregroundOffset = toIntSize(clippingBox.location());
764 } 767 }
765 768
(...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after
2115 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { 2118 } else if (graphicsLayer == m_scrollingContentsLayer.get()) {
2116 name = "Scrolling Contents Layer"; 2119 name = "Scrolling Contents Layer";
2117 } else { 2120 } else {
2118 ASSERT_NOT_REACHED(); 2121 ASSERT_NOT_REACHED();
2119 } 2122 }
2120 2123
2121 return name; 2124 return name;
2122 } 2125 }
2123 2126
2124 } // namespace WebCore 2127 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/compositing/child-transform-with-anchor-point-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698