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

Unified 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: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/RenderBox.cpp
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
index b024ccb0690ca3622fdccf9d459ba75172d4764f..068d4ab49889840c9391bacfda74ed4d259f3268 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -286,10 +286,23 @@ void RenderBox::updateFromStyle()
if (!hasOverflowClip()) {
// If we are getting an overflow clip, preemptively erase any overflowing content.
// FIXME: This should probably consult RenderOverflow.
- repaint();
+ if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
+ repaint();
}
}
}
+
+ if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && (boxHasOverflowClip != hasOverflowClip())) {
+ // FIXME: This shouldn't be required if we tracked the visual overflow
+ // generated by positioned children or self painting layers. crbug.com/345403
+ for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
esprehn 2014/02/28 02:54:33 You can't do this, you're looking at your children
dsinclair 2014/02/28 18:58:24 Changed to storing a flag here and checking the is
+ if (child->hasLayer() && toRenderLayerModelObject(child)->layer()->isSelfPaintingLayer()) {
+ LayoutRectRecorder childRecorder(*child);
+ child->setShouldDoFullRepaintAfterLayout(true);
+ }
+ }
+ }
+
setHasOverflowClip(boxHasOverflowClip);
setHasTransform(styleToUse->hasTransformRelatedProperty());
@@ -1571,6 +1584,8 @@ void RenderBox::imageChanged(WrappedImagePtr image, const IntRect*)
if (!parent())
return;
+ AllowRepaintScope scoper(frameView());
+
if ((style()->borderImage().image() && style()->borderImage().image()->data() == image) ||
(style()->maskBoxImage().image() && style()->maskBoxImage().image()->data() == image)) {
repaint();

Powered by Google App Engine
This is Rietveld 408576698