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

Side by Side Diff: Source/core/layout/compositing/CompositedDeprecatedPaintLayerMapping.cpp

Issue 1145993002: Refactor root element background painting (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: make invalidation more robust. also improve incremental invalidation for some common cases Created 5 years, 6 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) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1722 matching lines...) Expand 10 before | Expand all | Expand 10 after
1733 break; 1733 break;
1734 1734
1735 finalOpacity *= curr->layoutObject()->opacity(); 1735 finalOpacity *= curr->layoutObject()->opacity();
1736 } 1736 }
1737 1737
1738 return finalOpacity; 1738 return finalOpacity;
1739 } 1739 }
1740 1740
1741 Color CompositedDeprecatedPaintLayerMapping::layoutObjectBackgroundColor() const 1741 Color CompositedDeprecatedPaintLayerMapping::layoutObjectBackgroundColor() const
1742 { 1742 {
1743 LayoutObject* backgroundLayoutObject = layoutObject(); 1743 return layoutObject()->resolveColor(CSSPropertyBackgroundColor);
1744 if (backgroundLayoutObject->isDocumentElement())
1745 backgroundLayoutObject = backgroundLayoutObject->layoutObjectForRootBack ground();
1746
1747 return backgroundLayoutObject->resolveColor(CSSPropertyBackgroundColor);
1748 } 1744 }
1749 1745
1750 void CompositedDeprecatedPaintLayerMapping::updateBackgroundColor() 1746 void CompositedDeprecatedPaintLayerMapping::updateBackgroundColor()
1751 { 1747 {
1752 m_graphicsLayer->setBackgroundColor(layoutObjectBackgroundColor()); 1748 m_graphicsLayer->setBackgroundColor(layoutObjectBackgroundColor());
1753 } 1749 }
1754 1750
1755 bool CompositedDeprecatedPaintLayerMapping::paintsChildren() const 1751 bool CompositedDeprecatedPaintLayerMapping::paintsChildren() const
1756 { 1752 {
1757 if (m_owningLayer.hasVisibleContent() && m_owningLayer.hasNonEmptyChildLayou tObjects()) 1753 if (m_owningLayer.hasVisibleContent() && m_owningLayer.hasNonEmptyChildLayou tObjects())
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
2345 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { 2341 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) {
2346 name = "Scrolling Block Selection Layer"; 2342 name = "Scrolling Block Selection Layer";
2347 } else { 2343 } else {
2348 ASSERT_NOT_REACHED(); 2344 ASSERT_NOT_REACHED();
2349 } 2345 }
2350 2346
2351 return name; 2347 return name;
2352 } 2348 }
2353 2349
2354 } // namespace blink 2350 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698