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

Side by Side Diff: Source/core/paint/DeprecatedPaintLayer.cpp

Issue 1316163002: Make the LayoutRect->FloatRect constructor explicit. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after
1564 { 1564 {
1565 RefPtr<HitTestingTransformState> transformState; 1565 RefPtr<HitTestingTransformState> transformState;
1566 LayoutPoint offset; 1566 LayoutPoint offset;
1567 if (containerTransformState) { 1567 if (containerTransformState) {
1568 // If we're already computing transform state, then it's relative to the container (which we know is non-null). 1568 // If we're already computing transform state, then it's relative to the container (which we know is non-null).
1569 transformState = HitTestingTransformState::create(*containerTransformSta te); 1569 transformState = HitTestingTransformState::create(*containerTransformSta te);
1570 convertToLayerCoords(containerLayer, offset); 1570 convertToLayerCoords(containerLayer, offset);
1571 } else { 1571 } else {
1572 // If this is the first time we need to make transform state, then base it off of hitTestLocation, 1572 // If this is the first time we need to make transform state, then base it off of hitTestLocation,
1573 // which is relative to rootLayer. 1573 // which is relative to rootLayer.
1574 transformState = HitTestingTransformState::create(hitTestLocation.transf ormedPoint(), hitTestLocation.transformedRect(), FloatQuad(hitTestRect)); 1574 transformState = HitTestingTransformState::create(hitTestLocation.transf ormedPoint(), hitTestLocation.transformedRect(), FloatQuad(FloatRect(hitTestRect )));
1575 convertToLayerCoords(rootLayer, offset); 1575 convertToLayerCoords(rootLayer, offset);
1576 } 1576 }
1577 offset.moveBy(translationOffset); 1577 offset.moveBy(translationOffset);
1578 1578
1579 LayoutObject* containerLayoutObject = containerLayer ? containerLayer->layou tObject() : 0; 1579 LayoutObject* containerLayoutObject = containerLayer ? containerLayer->layou tObject() : 0;
1580 if (layoutObject()->shouldUseTransformFromContainer(containerLayoutObject)) { 1580 if (layoutObject()->shouldUseTransformFromContainer(containerLayoutObject)) {
1581 TransformationMatrix containerTransform; 1581 TransformationMatrix containerTransform;
1582 layoutObject()->getTransformFromContainer(containerLayoutObject, toLayou tSize(offset), containerTransform); 1582 layoutObject()->getTransformFromContainer(containerLayoutObject, toLayou tSize(offset), containerTransform);
1583 transformState->applyTransform(containerTransform, HitTestingTransformSt ate::AccumulateTransform); 1583 transformState->applyTransform(containerTransform, HitTestingTransformSt ate::AccumulateTransform);
1584 } else { 1584 } else {
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
2168 if (isRootLayer()) 2168 if (isRootLayer())
2169 return LayoutRect(m_layoutObject->view()->unscaledDocumentRect()); 2169 return LayoutRect(m_layoutObject->view()->unscaledDocumentRect());
2170 2170
2171 // The layer created for the LayoutFlowThread is just a helper for painting and hit-testing, 2171 // The layer created for the LayoutFlowThread is just a helper for painting and hit-testing,
2172 // and should not contribute to the bounding box. The LayoutMultiColumnSets will contribute 2172 // and should not contribute to the bounding box. The LayoutMultiColumnSets will contribute
2173 // the correct size for the layout content of the multicol container. 2173 // the correct size for the layout content of the multicol container.
2174 if (layoutObject()->isLayoutFlowThread()) 2174 if (layoutObject()->isLayoutFlowThread())
2175 return LayoutRect(); 2175 return LayoutRect();
2176 2176
2177 LayoutRect result = clipper().localClipRect(); 2177 LayoutRect result = clipper().localClipRect();
2178 if (result == LayoutRect::infiniteIntRect()) { 2178 // TODO(chrishtr): avoid converting to IntRect and back.
2179 if (result == LayoutRect(LayoutRect::infiniteIntRect())) {
2179 LayoutPoint origin; 2180 LayoutPoint origin;
2180 result = physicalBoundingBox(ancestorLayer, &origin); 2181 result = physicalBoundingBox(ancestorLayer, &origin);
2181 2182
2182 const_cast<DeprecatedPaintLayer*>(this)->stackingNode()->updateLayerList sIfNeeded(); 2183 const_cast<DeprecatedPaintLayer*>(this)->stackingNode()->updateLayerList sIfNeeded();
2183 2184
2184 // Reflections are implemented with Layers that hang off of the reflecte d layer. However, 2185 // Reflections are implemented with Layers that hang off of the reflecte d layer. However,
2185 // the reflection layer subtree does not include the subtree of the pare nt Layer, so 2186 // the reflection layer subtree does not include the subtree of the pare nt Layer, so
2186 // a recursive computation of stacking children yields no results. This breaks cases when there are stacking 2187 // a recursive computation of stacking children yields no results. This breaks cases when there are stacking
2187 // children of the parent, that need to be included in reflected composi ted bounds. 2188 // children of the parent, that need to be included in reflected composi ted bounds.
2188 // Fix this by including composited bounds of stacking children of the r eflected Layer. 2189 // Fix this by including composited bounds of stacking children of the r eflected Layer.
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
2681 2682
2682 void showLayerTree(const blink::LayoutObject* layoutObject) 2683 void showLayerTree(const blink::LayoutObject* layoutObject)
2683 { 2684 {
2684 if (!layoutObject) { 2685 if (!layoutObject) {
2685 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2686 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2686 return; 2687 return;
2687 } 2688 }
2688 showLayerTree(layoutObject->enclosingLayer()); 2689 showLayerTree(layoutObject->enclosingLayer());
2689 } 2690 }
2690 #endif 2691 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698