Changeset 181710 in webkit
- Timestamp:
- Mar 18, 2015, 3:17:34 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r181701 r181710 1 2015-03-18 Simon Fraser <simon.fraser@apple.com> 2 3 Avoid repaints when changing transform on an element with multiple background images 4 https://bugs.webkit.org/show_bug.cgi?id=142841 5 6 Reviewed by Zalan Bujtas. 7 8 Test that changes transform on a composited element with 2 background images, 9 and tests for no repaints. 10 11 * fast/repaint/multiple-backgrounds-style-change-expected.txt: Added. 12 * fast/repaint/multiple-backgrounds-style-change.html: Added. 13 1 14 2015-03-18 Marcos Chavarría Teijeiro <chavarria1991@gmail.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r181709 r181710 1 2015-03-18 Simon Fraser <simon.fraser@apple.com> 2 3 Avoid repaints when changing transform on an element with multiple background images 4 https://bugs.webkit.org/show_bug.cgi?id=142841 5 6 Reviewed by Zalan Bujtas. 7 8 Replace the cheap test for changed images in RenderElement::updateFillImages() 9 with an exhaustive test that walks the entire list of background images, 10 since any ensuing repaint is way more expensive than a slightly more expensive check here. 11 12 Test: fast/repaint/multiple-backgrounds-style-change.html 13 14 * rendering/RenderElement.cpp: 15 (WebCore::RenderElement::updateFillImages): 16 * rendering/style/FillLayer.cpp: 17 (WebCore::layerImagesIdentical): See if both images are the same (either none 18 or both mask images, and same image pointer). 19 (WebCore::FillLayer::imagesIdentical): Walk the two FillLayer lists, checking the images 20 on each one. Returns false if we reach the end of one list before the other, or the images 21 are different. 22 * rendering/style/FillLayer.h: New static function; static because 23 it compares two FillLayer lists, and I think that makes more sense than 24 a member function. 25 1 26 2015-03-18 Anders Carlsson <andersca@apple.com> 2 27 -
trunk/Source/WebCore/rendering/RenderElement.cpp
r181691 r181710 338 338 { 339 339 // Optimize the common case 340 if ( oldLayers && !oldLayers->next() && newLayers && !newLayers->next() && oldLayers->image() == newLayers->image() && oldLayers->maskImage() == newLayers->maskImage())340 if (FillLayer::imagesIdentical(oldLayers, newLayers)) 341 341 return; 342 342 -
trunk/Source/WebCore/rendering/style/FillLayer.cpp
r179413 r181710 393 393 } 394 394 395 static inline bool layerImagesIdentical(const FillLayer& layer1, const FillLayer& layer2) 396 { 397 // We just care about pointer equivalency. 398 return layer1.hasMaskImage() == layer2.hasMaskImage() && layer1.image() == layer2.image(); 399 } 400 401 bool FillLayer::imagesIdentical(const FillLayer* layer1, const FillLayer* layer2) 402 { 403 for (; layer1 && layer2; layer1 = layer1->next(), layer2 = layer2->next()) { 404 if (!layerImagesIdentical(*layer1, *layer2)) 405 return false; 406 } 407 408 return !layer1 && !layer2; 409 } 410 395 411 } // namespace WebCore -
trunk/Source/WebCore/rendering/style/FillLayer.h
r179413 r181710 160 160 void cullEmptyLayers(); 161 161 162 static bool imagesIdentical(const FillLayer*, const FillLayer*); 163 162 164 static EFillAttachment initialFillAttachment(EFillLayerType) { return ScrollBackgroundAttachment; } 163 165 static EFillBox initialFillClip(EFillLayerType) { return BorderFillBox; }
Note:
See TracChangeset
for help on using the changeset viewer.