Changeset 112644 in webkit
- Timestamp:
- Mar 29, 2012 10:07:06 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r112629 r112644 1 2012-03-29 Alexandru Chiculita <achicu@adobe.com> 2 3 [CSS Filters] Trigger a repaint on elements with changed filter 4 https://bugs.webkit.org/show_bug.cgi?id=82521 5 6 Reviewed by Dean Jackson. 7 8 Repaint was not triggered when the filter property was changed. I've added two 9 tests, one for software and one for composited mode. Both tests are triggering 10 all the possible scenarios of changing the filter property. 11 12 * css3/filters/filter-change-repaint-composited-expected.png: Added. 13 * css3/filters/filter-change-repaint-composited-expected.txt: Added. 14 * css3/filters/filter-change-repaint-composited.html: Added. 15 * css3/filters/filter-change-repaint-expected.png: Added. 16 * css3/filters/filter-change-repaint-expected.txt: Added. 17 * css3/filters/filter-change-repaint.html: Added. 18 * platform/chromium/test_expectations.txt: Disabled the new tests on Chromium. They need rebaselining. 19 1 20 2012-03-29 Bear Travis <betravis@adobe.com> 2 21 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r112625 r112644 3180 3180 BUGWK71392 WIN : css3/filters/custom = FAIL 3181 3181 3182 // Need rebaselining for Chromium 3183 BUGWK82521 SKIP : css3/filters/filter-change-repaint-composited.html = FAIL 3184 BUGWK82521 SKIP : css3/filters/filter-change-repaint.html = FAIL 3185 3182 3186 // <style scoped> not yet enabled. 3183 3187 BUGWK49142 SKIP : fast/css/style-scoped = PASS -
trunk/Source/WebCore/ChangeLog
r112642 r112644 1 2012-03-29 Alexandru Chiculita <achicu@adobe.com> 2 3 [CSS Filters] Trigger a repaint on elements with changed filter 4 https://bugs.webkit.org/show_bug.cgi?id=82521 5 6 Reviewed by Dean Jackson. 7 8 I've added ContextSensitivePropertyFilter and changed RenderStyle::diff to use it when 9 the filter property is changed. In RenderObject::adjustStyleDifference the appropriate StyleDifferenceRepaintLayer 10 or StyleDifferenceRecompositeLayer is used depending on whether the layer is painting filters in software or in hardware 11 (composited). 12 13 Tests: css3/filters/filter-change-repaint-composited.html 14 css3/filters/filter-change-repaint.html 15 16 * css/CSSStyleSelector.cpp: 17 (WebCore::CSSStyleSelector::createFilterOperations): None was treated as an invalid value. 18 * platform/graphics/ca/mac/PlatformCALayerMac.mm: Shadows were remaining behind. Fixed that. 19 (PlatformCALayer::setFilters): 20 * rendering/RenderBoxModelObject.cpp: 21 (WebCore::RenderBoxModelObject::styleWillChange): Repaint the layer when there is a layout change and a filter change. 22 * rendering/RenderLayer.cpp: 23 (WebCore::RenderLayer::styleChanged): Making sure that the backing store is repainted when filters fallback to hardware. 24 * rendering/RenderObject.cpp: 25 (WebCore::RenderObject::adjustStyleDifference): 26 * rendering/style/RenderStyle.cpp: 27 (WebCore::RenderStyle::diff): 28 * rendering/style/RenderStyleConstants.h: 29 1 30 2012-03-29 Koji Ishii <kojiishi@gmail.com> 2 31 -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r112629 r112644 5525 5525 bool CSSStyleSelector::createFilterOperations(CSSValue* inValue, RenderStyle* style, RenderStyle* rootStyle, FilterOperations& outOperations) 5526 5526 { 5527 if (!inValue || !inValue->isValueList()) { 5528 outOperations.clear(); 5529 return false; 5530 } 5527 ASSERT(outOperations.isEmpty()); 5528 5529 if (!inValue) 5530 return false; 5531 5532 if (inValue->isPrimitiveValue()) { 5533 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(inValue); 5534 if (primitiveValue->getIdent() == CSSValueNone) 5535 return true; 5536 } 5537 5538 if (!inValue->isValueList()) 5539 return false; 5531 5540 5532 5541 float zoomFactor = style ? style->effectiveZoom() : 1; -
trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
r111471 r112644 710 710 { 711 711 if (!filters.size()) { 712 [m_layer.get() setFilters:0]; 712 BEGIN_BLOCK_OBJC_EXCEPTIONS 713 [m_layer.get() setFilters:nil]; 714 [m_layer.get() setShadowOffset:CGSizeZero]; 715 [m_layer.get() setShadowColor:nil]; 716 [m_layer.get() setShadowRadius:0]; 717 [m_layer.get() setShadowOpacity:0]; 718 END_BLOCK_OBJC_EXCEPTIONS 713 719 return; 714 720 } -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r112301 r112644 27 27 #include "RenderBoxModelObject.h" 28 28 29 #include "FilterOperations.h" 29 30 #include "GraphicsContext.h" 30 31 #include "HTMLFrameOwnerElement.h" … … 330 331 || oldStyle->hasClip() != newStyle->hasClip() 331 332 || oldStyle->opacity() != newStyle->opacity() 332 || oldStyle->transform() != newStyle->transform()) 333 || oldStyle->transform() != newStyle->transform() 334 #if ENABLE(CSS_FILTERS) 335 || oldStyle->filter() != newStyle->filter() 336 #endif 337 ) 333 338 layer()->repaintIncludingDescendants(); 334 } else if (newStyle->hasTransform() || newStyle->opacity() < 1 ) {339 } else if (newStyle->hasTransform() || newStyle->opacity() < 1 || newStyle->hasFilter()) { 335 340 // If we don't have a layer yet, but we are going to get one because of transform or opacity, 336 341 // then we need to repaint the old position of the object. -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r112497 r112644 4399 4399 } 4400 4400 4401 #if ENABLE(CSS_FILTERS)4402 updateOrRemoveFilterEffect();4403 #endif4404 4405 4401 if (Frame* frame = renderer()->frame()) { 4406 4402 if (FrameView* frameView = frame->view()) { … … 4420 4416 updateScrollCornerStyle(); 4421 4417 updateResizerStyle(); 4418 4419 #if ENABLE(CSS_FILTERS) 4420 bool backingDidCompositeLayers = isComposited() && backing()->canCompositeFilters(); 4421 #endif 4422 4422 4423 4423 #if USE(ACCELERATED_COMPOSITING) … … 4431 4431 if (stackingContext()->hasCompositingDescendant()) 4432 4432 compositor()->setCompositingLayersNeedRebuild(); 4433 } 4434 #endif 4435 4436 #if ENABLE(CSS_FILTERS) 4437 updateOrRemoveFilterEffect(); 4438 if (isComposited() && backingDidCompositeLayers && !backing()->canCompositeFilters()) { 4439 // The filters used to be drawn by platform code, but now the platform cannot draw them anymore. 4440 // Fallback to drawing them in software. 4441 setBackingNeedsRepaint(); 4433 4442 } 4434 4443 #endif -
trunk/Source/WebCore/rendering/RenderObject.cpp
r112453 r112644 1719 1719 } 1720 1720 1721 #if ENABLE(CSS_FILTERS) 1722 if ((contextSensitiveProperties & ContextSensitivePropertyFilter) && hasLayer()) { 1723 RenderLayer* layer = toRenderBoxModelObject(this)->layer(); 1724 if (!layer->isComposited() || layer->paintsWithFilters()) 1725 diff = StyleDifferenceRepaintLayer; 1726 else if (diff < StyleDifferenceRecompositeLayer) 1727 diff = StyleDifferenceRecompositeLayer; 1728 } 1729 #endif 1730 1721 1731 // The answer to requiresLayer() for plugins and iframes can change outside of the style system, 1722 1732 // since it depends on whether we decide to composite these elements. When the layer status of -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r112301 r112644 420 420 } 421 421 422 #if ENABLE(CSS_FILTERS)423 if (rareNonInheritedData->m_filter.get() != other->rareNonInheritedData->m_filter.get()424 && *rareNonInheritedData->m_filter.get() != *other->rareNonInheritedData->m_filter.get()) {425 return StyleDifferenceLayout;426 }427 #endif428 422 #if ENABLE(CSS_GRID_LAYOUT) 429 423 if (rareNonInheritedData->m_grid.get() != other->rareNonInheritedData->m_grid.get() … … 606 600 #endif 607 601 } 602 603 #if ENABLE(CSS_FILTERS) 604 if (rareNonInheritedData->m_filter.get() != other->rareNonInheritedData->m_filter.get() 605 && *rareNonInheritedData->m_filter.get() != *other->rareNonInheritedData->m_filter.get()) { 606 #if USE(ACCELERATED_COMPOSITING) 607 changedContextSensitiveProperties |= ContextSensitivePropertyFilter; 608 // Don't return; keep looking for another change. 609 #else 610 return StyleDifferenceRepaintLayer; 611 #endif 612 } 613 #endif 608 614 609 615 if (rareNonInheritedData->m_mask != other->rareNonInheritedData->m_mask -
trunk/Source/WebCore/rendering/style/RenderStyleConstants.h
r112587 r112644 64 64 ContextSensitivePropertyNone = 0, 65 65 ContextSensitivePropertyTransform = (1 << 0), 66 ContextSensitivePropertyOpacity = (1 << 1) 66 ContextSensitivePropertyOpacity = (1 << 1), 67 ContextSensitivePropertyFilter = (1 << 2) 67 68 }; 68 69
Note: See TracChangeset
for help on using the changeset viewer.