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

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

Issue 663923002: Rename hasTransform() to hasTransformRelatedProperty, since the meaning is the latter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed Created 6 years, 2 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
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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 void CompositedLayerMapping::updateOpacity(const RenderStyle* style) 256 void CompositedLayerMapping::updateOpacity(const RenderStyle* style)
257 { 257 {
258 m_graphicsLayer->setOpacity(compositingOpacity(style->opacity())); 258 m_graphicsLayer->setOpacity(compositingOpacity(style->opacity()));
259 } 259 }
260 260
261 void CompositedLayerMapping::updateTransform(const RenderStyle* style) 261 void CompositedLayerMapping::updateTransform(const RenderStyle* style)
262 { 262 {
263 // FIXME: This could use m_owningLayer.transform(), but that currently has t ransform-origin 263 // FIXME: This could use m_owningLayer.transform(), but that currently has t ransform-origin
264 // baked into it, and we don't want that. 264 // baked into it, and we don't want that.
265 TransformationMatrix t; 265 TransformationMatrix t;
266 if (m_owningLayer.hasTransform()) { 266 if (m_owningLayer.hasTransformRelatedProperty()) {
267 style->applyTransform(t, toRenderBox(renderer())->pixelSnappedBorderBoxR ect().size(), RenderStyle::ExcludeTransformOrigin); 267 style->applyTransform(t, toRenderBox(renderer())->pixelSnappedBorderBoxR ect().size(), RenderStyle::ExcludeTransformOrigin);
268 makeMatrixRenderable(t, compositor()->hasAcceleratedCompositing()); 268 makeMatrixRenderable(t, compositor()->hasAcceleratedCompositing());
269 } 269 }
270 270
271 m_graphicsLayer->setTransform(t); 271 m_graphicsLayer->setTransform(t);
272 } 272 }
273 273
274 void CompositedLayerMapping::updateFilters(const RenderStyle* style) 274 void CompositedLayerMapping::updateFilters(const RenderStyle* style)
275 { 275 {
276 m_graphicsLayer->setFilters(owningLayer().computeFilterOperations(style)); 276 m_graphicsLayer->setFilters(owningLayer().computeFilterOperations(style));
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 if (m_maskLayer->size() != m_graphicsLayer->size()) { 841 if (m_maskLayer->size() != m_graphicsLayer->size()) {
842 m_maskLayer->setSize(m_graphicsLayer->size()); 842 m_maskLayer->setSize(m_graphicsLayer->size());
843 m_maskLayer->setNeedsDisplay(); 843 m_maskLayer->setNeedsDisplay();
844 } 844 }
845 m_maskLayer->setPosition(FloatPoint()); 845 m_maskLayer->setPosition(FloatPoint());
846 m_maskLayer->setOffsetFromRenderer(m_graphicsLayer->offsetFromRenderer()); 846 m_maskLayer->setOffsetFromRenderer(m_graphicsLayer->offsetFromRenderer());
847 } 847 }
848 848
849 void CompositedLayerMapping::updateTransformGeometry(const IntPoint& snappedOffs etFromCompositedAncestor, const IntRect& relativeCompositingBounds) 849 void CompositedLayerMapping::updateTransformGeometry(const IntPoint& snappedOffs etFromCompositedAncestor, const IntRect& relativeCompositingBounds)
850 { 850 {
851 if (m_owningLayer.hasTransform()) { 851 if (m_owningLayer.hasTransformRelatedProperty()) {
852 const LayoutRect borderBox = toRenderBox(renderer())->borderBoxRect(); 852 const LayoutRect borderBox = toRenderBox(renderer())->borderBoxRect();
853 853
854 // Get layout bounds in the coords of compositingContainer to match rela tiveCompositingBounds. 854 // Get layout bounds in the coords of compositingContainer to match rela tiveCompositingBounds.
855 IntRect layerBounds = pixelSnappedIntRect(toLayoutPoint(m_owningLayer.su bpixelAccumulation()), borderBox.size()); 855 IntRect layerBounds = pixelSnappedIntRect(toLayoutPoint(m_owningLayer.su bpixelAccumulation()), borderBox.size());
856 layerBounds.moveBy(snappedOffsetFromCompositedAncestor); 856 layerBounds.moveBy(snappedOffsetFromCompositedAncestor);
857 857
858 // Update properties that depend on layer dimensions 858 // Update properties that depend on layer dimensions
859 FloatPoint3D transformOrigin = computeTransformOrigin(IntRect(IntPoint() , layerBounds.size())); 859 FloatPoint3D transformOrigin = computeTransformOrigin(IntRect(IntPoint() , layerBounds.size()));
860 860
861 // |transformOrigin| is in the local space of this layer. layerBounds - relativeCompositingBounds converts to the space of the 861 // |transformOrigin| is in the local space of this layer. layerBounds - relativeCompositingBounds converts to the space of the
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 // Register fixed position layers and their containers with the scrolling co ordinator. 1002 // Register fixed position layers and their containers with the scrolling co ordinator.
1003 ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLayer(m _owningLayer); 1003 ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLayer(m _owningLayer);
1004 if (!scrollingCoordinator) 1004 if (!scrollingCoordinator)
1005 return; 1005 return;
1006 1006
1007 scrollingCoordinator->updateLayerPositionConstraint(&m_owningLayer); 1007 scrollingCoordinator->updateLayerPositionConstraint(&m_owningLayer);
1008 1008
1009 // Page scale is applied as a transform on the root render view layer. Becau se the scroll 1009 // Page scale is applied as a transform on the root render view layer. Becau se the scroll
1010 // layer is further up in the hierarchy, we need to avoid marking the root r ender view 1010 // layer is further up in the hierarchy, we need to avoid marking the root r ender view
1011 // layer as a container. 1011 // layer as a container.
1012 bool isContainer = m_owningLayer.hasTransform() && !m_owningLayer.isRootLaye r(); 1012 bool isContainer = m_owningLayer.hasTransformRelatedProperty() && !m_owningL ayer.isRootLayer();
1013 // FIXME: we should make certain that childForSuperLayers will never be the m_squashingContainmentLayer here 1013 // FIXME: we should make certain that childForSuperLayers will never be the m_squashingContainmentLayer here
1014 scrollingCoordinator->setLayerIsContainerForFixedPositionLayers(childForSupe rlayers(), isContainer); 1014 scrollingCoordinator->setLayerIsContainerForFixedPositionLayers(childForSupe rlayers(), isContainer);
1015 } 1015 }
1016 1016
1017 void CompositedLayerMapping::updateInternalHierarchy() 1017 void CompositedLayerMapping::updateInternalHierarchy()
1018 { 1018 {
1019 // m_foregroundLayer has to be inserted in the correct order with child laye rs, 1019 // m_foregroundLayer has to be inserted in the correct order with child laye rs,
1020 // so it's not inserted here. 1020 // so it's not inserted here.
1021 if (m_ancestorClippingLayer) 1021 if (m_ancestorClippingLayer)
1022 m_ancestorClippingLayer->removeAllChildren(); 1022 m_ancestorClippingLayer->removeAllChildren();
(...skipping 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after
2373 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { 2373 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) {
2374 name = "Scrolling Block Selection Layer"; 2374 name = "Scrolling Block Selection Layer";
2375 } else { 2375 } else {
2376 ASSERT_NOT_REACHED(); 2376 ASSERT_NOT_REACHED();
2377 } 2377 }
2378 2378
2379 return name; 2379 return name;
2380 } 2380 }
2381 2381
2382 } // namespace blink 2382 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderView.cpp ('k') | Source/core/rendering/compositing/CompositingInputsUpdater.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698