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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 1656213002: Display -webkit-filter objects in any column (instead of only in the first one). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2623
Patch Set: Created 4 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 | « third_party/WebKit/Source/core/paint/PaintLayer.h ('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) 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 428
429 if (globalPaintFlags & GlobalPaintFlattenCompositingLayers) { 429 if (globalPaintFlags & GlobalPaintFlattenCompositingLayers) {
430 TransformationMatrix matrix = *m_transform; 430 TransformationMatrix matrix = *m_transform;
431 makeMatrixRenderable(matrix, false /* flatten 3d */); 431 makeMatrixRenderable(matrix, false /* flatten 3d */);
432 return matrix; 432 return matrix;
433 } 433 }
434 434
435 return *m_transform; 435 return *m_transform;
436 } 436 }
437 437
438 // Convert a bounding box from flow thread coordinates, relative to |layer|, to visual coordinates, relative to |ancestorLayer|. 438 void PaintLayer::convertFromFlowThreadToVisualBoundingBoxInAncestor(const PaintL ayer* ancestorLayer, LayoutRect& rect) const
439 // See http://www.chromium.org/developers/design-documents/multi-column-layout f or more info on these coordinate types.
440 static void convertFromFlowThreadToVisualBoundingBoxInAncestor(const PaintLayer* layer, const PaintLayer* ancestorLayer, LayoutRect& rect)
441 { 439 {
442 PaintLayer* paginationLayer = layer->enclosingPaginationLayer(); 440 PaintLayer* paginationLayer = enclosingPaginationLayer();
443 ASSERT(paginationLayer); 441 ASSERT(paginationLayer);
444 LayoutFlowThread* flowThread = toLayoutFlowThread(paginationLayer->layoutObj ect()); 442 LayoutFlowThread* flowThread = toLayoutFlowThread(paginationLayer->layoutObj ect());
445 443
446 // First make the flow thread rectangle relative to the flow thread, not to |layer|. 444 // First make the flow thread rectangle relative to the flow thread, not to |layer|.
447 LayoutPoint offsetWithinPaginationLayer; 445 LayoutPoint offsetWithinPaginationLayer;
448 layer->convertToLayerCoords(paginationLayer, offsetWithinPaginationLayer); 446 convertToLayerCoords(paginationLayer, offsetWithinPaginationLayer);
449 rect.moveBy(offsetWithinPaginationLayer); 447 rect.moveBy(offsetWithinPaginationLayer);
450 448
451 // Then make the rectangle visual, relative to the fragmentation context. Sp lit our box up into 449 // Then make the rectangle visual, relative to the fragmentation context. Sp lit our box up into
452 // the actual fragment boxes that layout in the columns/pages and unite thos e together to get 450 // the actual fragment boxes that layout in the columns/pages and unite thos e together to get
453 // our true bounding box. 451 // our true bounding box.
454 rect = flowThread->fragmentsBoundingBox(rect); 452 rect = flowThread->fragmentsBoundingBox(rect);
455 453
456 // Finally, make the visual rectangle relative to |ancestorLayer|. 454 // Finally, make the visual rectangle relative to |ancestorLayer|.
457 if (ancestorLayer->enclosingPaginationLayer() != paginationLayer) { 455 if (ancestorLayer->enclosingPaginationLayer() != paginationLayer) {
458 rect.moveBy(paginationLayer->visualOffsetFromAncestor(ancestorLayer)); 456 rect.moveBy(paginationLayer->visualOffsetFromAncestor(ancestorLayer));
(...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after
2147 result.moveBy(offsetFromRoot); 2145 result.moveBy(offsetFromRoot);
2148 return result; 2146 return result;
2149 } 2147 }
2150 2148
2151 LayoutRect PaintLayer::fragmentsBoundingBox(const PaintLayer* ancestorLayer) con st 2149 LayoutRect PaintLayer::fragmentsBoundingBox(const PaintLayer* ancestorLayer) con st
2152 { 2150 {
2153 if (!enclosingPaginationLayer()) 2151 if (!enclosingPaginationLayer())
2154 return physicalBoundingBox(ancestorLayer); 2152 return physicalBoundingBox(ancestorLayer);
2155 2153
2156 LayoutRect result = flippedLogicalBoundingBox(logicalBoundingBox(), layoutOb ject()); 2154 LayoutRect result = flippedLogicalBoundingBox(logicalBoundingBox(), layoutOb ject());
2157 convertFromFlowThreadToVisualBoundingBoxInAncestor(this, ancestorLayer, resu lt); 2155 convertFromFlowThreadToVisualBoundingBoxInAncestor(ancestorLayer, result);
2158 return result; 2156 return result;
2159 } 2157 }
2160 2158
2161 LayoutRect PaintLayer::boundingBoxForCompositingOverlapTest() const 2159 LayoutRect PaintLayer::boundingBoxForCompositingOverlapTest() const
2162 { 2160 {
2163 // Apply NeverIncludeTransformForAncestorLayer, because the geometry map in CompositingInputsUpdater will take care of applying the 2161 // Apply NeverIncludeTransformForAncestorLayer, because the geometry map in CompositingInputsUpdater will take care of applying the
2164 // transform of |this| (== the ancestorLayer argument to boundingBoxForCompo siting). 2162 // transform of |this| (== the ancestorLayer argument to boundingBoxForCompo siting).
2165 return overlapBoundsIncludeChildren() ? boundingBoxForCompositing(this, Neve rIncludeTransformForAncestorLayer) : fragmentsBoundingBox(this); 2163 return overlapBoundsIncludeChildren() ? boundingBoxForCompositing(this, Neve rIncludeTransformForAncestorLayer) : fragmentsBoundingBox(this);
2166 } 2164 }
2167 2165
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
2246 // FIXME: We can optimize the size of the composited layers, by not enla rging 2244 // FIXME: We can optimize the size of the composited layers, by not enla rging
2247 // filtered areas with the outsets if we know that the filter is going t o render in hardware. 2245 // filtered areas with the outsets if we know that the filter is going t o render in hardware.
2248 // https://bugs.webkit.org/show_bug.cgi?id=81239 2246 // https://bugs.webkit.org/show_bug.cgi?id=81239
2249 result.expand(filterOutsets()); 2247 result.expand(filterOutsets());
2250 } 2248 }
2251 2249
2252 if (transform() && paintsWithTransform(GlobalPaintNormalPhase) && (this != a ncestorLayer || options == MaybeIncludeTransformForAncestorLayer)) 2250 if (transform() && paintsWithTransform(GlobalPaintNormalPhase) && (this != a ncestorLayer || options == MaybeIncludeTransformForAncestorLayer))
2253 result = transform()->mapRect(result); 2251 result = transform()->mapRect(result);
2254 2252
2255 if (enclosingPaginationLayer()) { 2253 if (enclosingPaginationLayer()) {
2256 convertFromFlowThreadToVisualBoundingBoxInAncestor(this, ancestorLayer, result); 2254 convertFromFlowThreadToVisualBoundingBoxInAncestor(ancestorLayer, result );
2257 return result; 2255 return result;
2258 } 2256 }
2259 LayoutPoint delta; 2257 LayoutPoint delta;
2260 convertToLayerCoords(ancestorLayer, delta); 2258 convertToLayerCoords(ancestorLayer, delta);
2261 result.moveBy(delta); 2259 result.moveBy(delta);
2262 return result; 2260 return result;
2263 } 2261 }
2264 2262
2265 CompositingState PaintLayer::compositingState() const 2263 CompositingState PaintLayer::compositingState() const
2266 { 2264 {
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
2830 2828
2831 void showLayerTree(const blink::LayoutObject* layoutObject) 2829 void showLayerTree(const blink::LayoutObject* layoutObject)
2832 { 2830 {
2833 if (!layoutObject) { 2831 if (!layoutObject) {
2834 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2832 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2835 return; 2833 return;
2836 } 2834 }
2837 showLayerTree(layoutObject->enclosingLayer()); 2835 showLayerTree(layoutObject->enclosingLayer());
2838 } 2836 }
2839 #endif 2837 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698