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

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

Issue 1145993002: Refactor root element background painting (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 7 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) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 3155 matching lines...) Expand 10 before | Expand all | Expand 10 after
3166 { 3166 {
3167 // Only full invalidation reasons are allowed. 3167 // Only full invalidation reasons are allowed.
3168 ASSERT(isFullPaintInvalidationReason(reason)); 3168 ASSERT(isFullPaintInvalidationReason(reason));
3169 3169
3170 bool isUpgradingDelayedFullToFull = m_bitfields.fullPaintInvalidationReason( ) == PaintInvalidationDelayedFull && reason != PaintInvalidationDelayedFull; 3170 bool isUpgradingDelayedFullToFull = m_bitfields.fullPaintInvalidationReason( ) == PaintInvalidationDelayedFull && reason != PaintInvalidationDelayedFull;
3171 3171
3172 if (m_bitfields.fullPaintInvalidationReason() == PaintInvalidationNone || is UpgradingDelayedFullToFull) { 3172 if (m_bitfields.fullPaintInvalidationReason() == PaintInvalidationNone || is UpgradingDelayedFullToFull) {
3173 if (reason == PaintInvalidationFull) 3173 if (reason == PaintInvalidationFull)
3174 reason = documentLifecycleBasedPaintInvalidationReason(document().li fecycle()); 3174 reason = documentLifecycleBasedPaintInvalidationReason(document().li fecycle());
3175 m_bitfields.setFullPaintInvalidationReason(reason); 3175 m_bitfields.setFullPaintInvalidationReason(reason);
3176
3177 if (RuntimeEnabledFeatures::slimmingPaintEnabled() && isBody()) {
3178 // The rootObject paints view's background. We need to invalidate it when
3179 // view's background changes because of change of body's style.
3180 // FIXME: The condition is broader than needed for simplicity.
3181 // Might remove this when fixing crbug.com/475115.
3182 if (LayoutObject* rootObject = document().documentElement()->layoutO bject())
3183 rootObject->setShouldDoFullPaintInvalidation();
3184 }
3185 } 3176 }
3186 3177
3187 if (!isUpgradingDelayedFullToFull) { 3178 if (!isUpgradingDelayedFullToFull) {
3188 ASSERT(document().lifecycle().state() != DocumentLifecycle::InPaintInval idation); 3179 ASSERT(document().lifecycle().state() != DocumentLifecycle::InPaintInval idation);
3189 frame()->page()->animator().scheduleVisualUpdate(); // In case that this is called outside of FrameView::updateLayoutAndStyleForPainting(). 3180 frame()->page()->animator().scheduleVisualUpdate(); // In case that this is called outside of FrameView::updateLayoutAndStyleForPainting().
3190 markContainerChainForPaintInvalidation(); 3181 markContainerChainForPaintInvalidation();
3191 } 3182 }
3192 } 3183 }
3193 3184
3194 void LayoutObject::setMayNeedPaintInvalidation() 3185 void LayoutObject::setMayNeedPaintInvalidation()
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
3295 const blink::LayoutObject* root = object1; 3286 const blink::LayoutObject* root = object1;
3296 while (root->parent()) 3287 while (root->parent())
3297 root = root->parent(); 3288 root = root->parent();
3298 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3289 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3299 } else { 3290 } else {
3300 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3291 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3301 } 3292 }
3302 } 3293 }
3303 3294
3304 #endif 3295 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698