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

Side by Side Diff: Source/core/rendering/RenderBox.cpp

Issue 160903002: Move RenderLayer repainting to repaint-after-layout framework. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Rebase to master Created 6 years, 9 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 | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderLayer.cpp » ('j') | 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 setFloating(!isOutOfFlowPositioned() && styleToUse->isFloating()); 279 setFloating(!isOutOfFlowPositioned() && styleToUse->isFloating());
280 280
281 bool boxHasOverflowClip = false; 281 bool boxHasOverflowClip = false;
282 if (!styleToUse->isOverflowVisible() && isRenderBlock() && !isViewObject) { 282 if (!styleToUse->isOverflowVisible() && isRenderBlock() && !isViewObject) {
283 // If overflow has been propagated to the viewport, it has no effect her e. 283 // If overflow has been propagated to the viewport, it has no effect her e.
284 if (node() != document().viewportDefiningElement()) { 284 if (node() != document().viewportDefiningElement()) {
285 boxHasOverflowClip = true; 285 boxHasOverflowClip = true;
286 if (!hasOverflowClip()) { 286 if (!hasOverflowClip()) {
287 // If we are getting an overflow clip, preemptively erase any ov erflowing content. 287 // If we are getting an overflow clip, preemptively erase any ov erflowing content.
288 // FIXME: This should probably consult RenderOverflow. 288 // FIXME: This should probably consult RenderOverflow.
289 repaint(); 289 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
290 repaint();
290 } 291 }
291 } 292 }
292 } 293 }
294
295 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && (boxHasOverflowCl ip != hasOverflowClip())) {
296 // FIXME: This shouldn't be required if we tracked the visual overflow
297 // generated by positioned children or self painting layers. crbug.com/3 45403
298 for (RenderObject* child = firstChild(); child; child = child->nextSibli ng()) {
299 LayoutRectRecorder childRecorder(*child);
300 child->setShouldDoFullRepaintIfSelfPaintingLayer(true);
301 }
302 }
303
293 setHasOverflowClip(boxHasOverflowClip); 304 setHasOverflowClip(boxHasOverflowClip);
294 305
295 setHasTransform(styleToUse->hasTransformRelatedProperty()); 306 setHasTransform(styleToUse->hasTransformRelatedProperty());
296 setHasReflection(styleToUse->boxReflect()); 307 setHasReflection(styleToUse->boxReflect());
297 } 308 }
298 309
299 void RenderBox::layout() 310 void RenderBox::layout()
300 { 311 {
301 ASSERT(needsLayout()); 312 ASSERT(needsLayout());
302 313
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after
1545 } 1556 }
1546 1557
1547 return false; 1558 return false;
1548 } 1559 }
1549 1560
1550 void RenderBox::imageChanged(WrappedImagePtr image, const IntRect*) 1561 void RenderBox::imageChanged(WrappedImagePtr image, const IntRect*)
1551 { 1562 {
1552 if (!parent()) 1563 if (!parent())
1553 return; 1564 return;
1554 1565
1566 AllowRepaintScope scoper(frameView());
1567
1555 if ((style()->borderImage().image() && style()->borderImage().image()->data( ) == image) || 1568 if ((style()->borderImage().image() && style()->borderImage().image()->data( ) == image) ||
1556 (style()->maskBoxImage().image() && style()->maskBoxImage().image()->dat a() == image)) { 1569 (style()->maskBoxImage().image() && style()->maskBoxImage().image()->dat a() == image)) {
1557 repaint(); 1570 repaint();
1558 return; 1571 return;
1559 } 1572 }
1560 1573
1561 ShapeValue* shapeOutsideValue = style()->shapeOutside(); 1574 ShapeValue* shapeOutsideValue = style()->shapeOutside();
1562 if (!frameView()->isInPerformLayout() && isFloating() && shapeOutsideValue & & shapeOutsideValue->image() && shapeOutsideValue->image()->data() == image) { 1575 if (!frameView()->isInPerformLayout() && isFloating() && shapeOutsideValue & & shapeOutsideValue->image() && shapeOutsideValue->image()->data() == image) {
1563 ShapeOutsideInfo::ensureInfo(*this).markShapeAsDirty(); 1576 ShapeOutsideInfo::ensureInfo(*this).markShapeAsDirty();
1564 markShapeOutsideDependentsForLayout(); 1577 markShapeOutsideDependentsForLayout();
(...skipping 3117 matching lines...) Expand 10 before | Expand all | Expand 10 after
4682 return 0; 4695 return 0;
4683 4696
4684 if (!layoutState && !flowThreadContainingBlock()) 4697 if (!layoutState && !flowThreadContainingBlock())
4685 return 0; 4698 return 0;
4686 4699
4687 RenderBlock* containerBlock = containingBlock(); 4700 RenderBlock* containerBlock = containingBlock();
4688 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); 4701 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop();
4689 } 4702 }
4690 4703
4691 } // namespace WebCore 4704 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698