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

Side by Side Diff: Source/core/layout/LayoutBoxModelObject.cpp

Issue 1337233002: Invalidate paint when allocating a DeprecatedPaintLayer. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 | Annotate | Revision Log
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 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 Google Inc. 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 if (newStyleIsViewportConstained && layer()) 277 if (newStyleIsViewportConstained && layer())
278 frameView->addViewportConstrainedObject(this); 278 frameView->addViewportConstrainedObject(this);
279 else 279 else
280 frameView->removeViewportConstrainedObject(this); 280 frameView->removeViewportConstrainedObject(this);
281 } 281 }
282 } 282 }
283 } 283 }
284 284
285 void LayoutBoxModelObject::createLayer(DeprecatedPaintLayerType type) 285 void LayoutBoxModelObject::createLayer(DeprecatedPaintLayerType type)
286 { 286 {
287
288 // Acquiring a DeprecatedPaintLayer may change the paint invalidation contai ner. Therefore we must eagerly
289 // invalidate paint for this object before creating the layer.
290 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() && isRooted()) {
291 DisablePaintInvalidationStateAsserts invalidationDisabler;
292 DisableCompositingQueryAsserts compositingDisabler;
293
294 // It would be more correct to call invalidatePaintIncludingNonCompositi ngDescendants, but
295 // we do this instead to avoid performance issues when creating large nu mbers of layers.
296 const LayoutBoxModelObject& paintInvalidationContainer = containerForPai ntInvalidationOnRootedTree();
297 invalidatePaintUsingContainer(
298 paintInvalidationContainer,
299 boundsRectForPaintInvalidation(&paintInvalidationContainer),
300 PaintInvalidationLayer);
301 }
302
287 ASSERT(!m_layer); 303 ASSERT(!m_layer);
288 m_layer = adoptPtr(new DeprecatedPaintLayer(this, type)); 304 m_layer = adoptPtr(new DeprecatedPaintLayer(this, type));
289 setHasLayer(true); 305 setHasLayer(true);
290 m_layer->insertOnlyThisLayer(); 306 m_layer->insertOnlyThisLayer();
291 } 307 }
292 308
293 void LayoutBoxModelObject::destroyLayer() 309 void LayoutBoxModelObject::destroyLayer()
294 { 310 {
295 setHasLayer(false); 311 setHasLayer(false);
296 m_layer = nullptr; 312 m_layer = nullptr;
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 if (rootElementStyle->hasBackground()) 1031 if (rootElementStyle->hasBackground())
1016 return false; 1032 return false;
1017 1033
1018 if (node() != document().firstBodyElement()) 1034 if (node() != document().firstBodyElement())
1019 return false; 1035 return false;
1020 1036
1021 return true; 1037 return true;
1022 } 1038 }
1023 1039
1024 } // namespace blink 1040 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698