Changeset 140702 in webkit
- Timestamp:
- Jan 24, 2013 11:35:17 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r140701 r140702 1 2013-01-24 Max Vujovic <mvujovic@adobe.com> 2 3 [CSS Filters] CSS opacity property clips filter outsets 4 https://bugs.webkit.org/show_bug.cgi?id=106549 5 6 Reviewed by Dirk Schulze. 7 8 Add a reftest to verify that an element's drop shadow filter is not clipped when a CSS 9 opacity property is not applied. 10 11 * css3/filters/css-opacity-with-drop-shadow-expected.html: Added. 12 * css3/filters/css-opacity-with-drop-shadow.html: Added. 13 1 14 2013-01-24 Christophe Dumez <christophe.dumez@intel.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r140700 r140702 1 2013-01-24 Max Vujovic <mvujovic@adobe.com> 2 3 [CSS Filters] CSS opacity property clips filter outsets 4 https://bugs.webkit.org/show_bug.cgi?id=106549 5 6 Reviewed by Dirk Schulze. 7 8 Expand the transparencyClipBox for filter outsets and pass the filter output rect instead of 9 the input rect to beginTransparencyLayers for clipping. Details below. 10 11 Test: css3/filters/css-opacity-with-drop-shadow.html 12 13 * rendering/RenderLayer.cpp: 14 (WebCore): 15 (WebCore::RenderLayer::setFilterBackendNeedsRepaintingInRect): 16 Replace filter outset calcuation with a call to expandRectForFilterOutsets. 17 (WebCore::expandRectForFilterOutsets): 18 New method to factor out repeated filter outset calculation code. 19 (WebCore::transparencyClipBox): 20 After expanding the clip rect for descendants and reflection, expand it for filter 21 outsets, so they don't get clipped when we begin a transparency layer. 22 (WebCore::RenderLayer::paintLayerContents): 23 Pass paintingInfo.paintDirtyRect instead of localPaintingInfo.paintDirtyRect to 24 beginTransparencyLayers for clipping. localPaintingInfo.paintDirtyRect (aka the filter 25 input rect) does not contain filter outsets, so they would get clipped. Now, we pass 26 paintingInfo.paintDirtyRect (the filter output rect), which includes the filter outsets. 27 (WebCore::RenderLayer::calculateLayerBounds): 28 Replace filter outset calcuation with a call to expandRectForFilterOutsets. 29 * rendering/RenderLayer.h: 30 (RenderLayer): 31 1 32 2013-01-24 Ryosuke Niwa <rniwa@webkit.org> 2 33 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r140632 r140702 1363 1363 } 1364 1364 1365 static inline void expandRectForFilterOutsets(LayoutRect& rect, const RenderLayerModelObject* renderer) 1366 { 1367 ASSERT(renderer); 1368 if (!renderer->style()->hasFilterOutsets()) 1369 return; 1370 1371 int topOutset; 1372 int rightOutset; 1373 int bottomOutset; 1374 int leftOutset; 1375 renderer->style()->getFilterOutsets(topOutset, rightOutset, bottomOutset, leftOutset); 1376 rect.move(-leftOutset, -topOutset); 1377 rect.expand(leftOutset + rightOutset, topOutset + bottomOutset); 1378 } 1379 1365 1380 void RenderLayer::setFilterBackendNeedsRepaintingInRect(const LayoutRect& rect, bool immediate) 1366 1381 { … … 1369 1384 1370 1385 LayoutRect rectForRepaint = rect; 1371 1372 #if ENABLE(CSS_FILTERS) 1373 if (renderer()->style()->hasFilterOutsets()) { 1374 int topOutset; 1375 int rightOutset; 1376 int bottomOutset; 1377 int leftOutset; 1378 renderer()->style()->getFilterOutsets(topOutset, rightOutset, bottomOutset, leftOutset); 1379 rectForRepaint.move(-leftOutset, -topOutset); 1380 rectForRepaint.expand(leftOutset + rightOutset, topOutset + bottomOutset); 1381 } 1382 #endif 1386 expandRectForFilterOutsets(rectForRepaint, renderer()); 1383 1387 1384 1388 RenderLayerFilterInfo* filterInfo = this->filterInfo(); … … 1548 1552 LayoutRect clipRect = layer->boundingBox(layer); 1549 1553 expandClipRectForDescendantsAndReflection(clipRect, layer, layer, paintBehavior); 1554 #if ENABLE(CSS_FILTERS) 1555 expandRectForFilterOutsets(clipRect, layer->renderer()); 1556 #endif 1550 1557 return transform.mapRect(clipRect); 1551 1558 } … … 1553 1560 LayoutRect clipRect = layer->boundingBox(rootLayer); 1554 1561 expandClipRectForDescendantsAndReflection(clipRect, layer, rootLayer, paintBehavior); 1562 #if ENABLE(CSS_FILTERS) 1563 expandRectForFilterOutsets(clipRect, layer->renderer()); 1564 #endif 1555 1565 return clipRect; 1556 1566 } … … 3702 3712 // Begin transparency layers lazily now that we know we have to paint something. 3703 3713 if (haveTransparency) 3704 beginTransparencyLayers(transparencyLayerContext, localPaintingInfo.rootLayer, localPaintingInfo.paintDirtyRect, localPaintingInfo.paintBehavior);3714 beginTransparencyLayers(transparencyLayerContext, localPaintingInfo.rootLayer, paintingInfo.paintDirtyRect, localPaintingInfo.paintBehavior); 3705 3715 3706 3716 if (useClipRect) { … … 3729 3739 // Begin transparency layers lazily now that we know we have to paint something. 3730 3740 if (haveTransparency) 3731 beginTransparencyLayers(transparencyLayerContext, localPaintingInfo.rootLayer, localPaintingInfo.paintDirtyRect, localPaintingInfo.paintBehavior);3741 beginTransparencyLayers(transparencyLayerContext, localPaintingInfo.rootLayer, paintingInfo.paintDirtyRect, localPaintingInfo.paintBehavior); 3732 3742 3733 3743 if (useClipRect) { … … 4962 4972 // filtered areas with the outsets if we know that the filter is going to render in hardware. 4963 4973 // https://bugs.webkit.org/show_bug.cgi?id=81239 4964 if ((flags & IncludeLayerFilterOutsets) && renderer->style()->hasFilterOutsets()) { 4965 int topOutset; 4966 int rightOutset; 4967 int bottomOutset; 4968 int leftOutset; 4969 renderer->style()->getFilterOutsets(topOutset, rightOutset, bottomOutset, leftOutset); 4970 unionBounds.move(-leftOutset, -topOutset); 4971 unionBounds.expand(leftOutset + rightOutset, topOutset + bottomOutset); 4972 } 4974 if (flags & IncludeLayerFilterOutsets) 4975 expandRectForFilterOutsets(unionBounds, renderer); 4973 4976 #endif 4974 4977
Note: See TracChangeset
for help on using the changeset viewer.