| OLD | NEW |
| 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 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1196 void CompositedLayerMapping::updateDrawsContent() | 1196 void CompositedLayerMapping::updateDrawsContent() |
| 1197 { | 1197 { |
| 1198 bool hasPaintedContent = containsPaintedContent(); | 1198 bool hasPaintedContent = containsPaintedContent(); |
| 1199 m_graphicsLayer->setDrawsContent(hasPaintedContent); | 1199 m_graphicsLayer->setDrawsContent(hasPaintedContent); |
| 1200 | 1200 |
| 1201 if (m_scrollingLayer) { | 1201 if (m_scrollingLayer) { |
| 1202 // m_scrollingLayer never has backing store. | 1202 // m_scrollingLayer never has backing store. |
| 1203 // m_scrollingContentsLayer only needs backing store if the scrolled con
tents need to paint. | 1203 // m_scrollingContentsLayer only needs backing store if the scrolled con
tents need to paint. |
| 1204 m_scrollingContentsAreEmpty = !m_owningLayer.hasVisibleContent() || !(la
youtObject()->hasBackground() || layoutObject()->hasBackdropFilter() || paintsCh
ildren()); | 1204 m_scrollingContentsAreEmpty = !m_owningLayer.hasVisibleContent() || !(la
youtObject()->hasBackground() || layoutObject()->hasBackdropFilter() || paintsCh
ildren()); |
| 1205 m_scrollingContentsLayer->setDrawsContent(!m_scrollingContentsAreEmpty); | 1205 m_scrollingContentsLayer->setDrawsContent(!m_scrollingContentsAreEmpty); |
| 1206 m_graphicsLayer->setCanUseClientCacheStatus(false); |
| 1207 m_scrollingContentsLayer->setCanUseClientCacheStatus(true); |
| 1208 } else { |
| 1209 m_graphicsLayer->setCanUseClientCacheStatus(true); |
| 1206 } | 1210 } |
| 1207 | 1211 |
| 1208 if (hasPaintedContent && isAcceleratedCanvas(layoutObject())) { | 1212 if (hasPaintedContent && isAcceleratedCanvas(layoutObject())) { |
| 1209 CanvasRenderingContext* context = toHTMLCanvasElement(layoutObject()->no
de())->renderingContext(); | 1213 CanvasRenderingContext* context = toHTMLCanvasElement(layoutObject()->no
de())->renderingContext(); |
| 1210 // Content layer may be null if context is lost. | 1214 // Content layer may be null if context is lost. |
| 1211 if (WebLayer* contentLayer = context->platformLayer()) { | 1215 if (WebLayer* contentLayer = context->platformLayer()) { |
| 1212 Color bgColor(Color::transparent); | 1216 Color bgColor(Color::transparent); |
| 1213 if (contentLayerSupportsDirectBackgroundComposition(layoutObject()))
{ | 1217 if (contentLayerSupportsDirectBackgroundComposition(layoutObject()))
{ |
| 1214 bgColor = layoutObjectBackgroundColor(); | 1218 bgColor = layoutObjectBackgroundColor(); |
| 1215 hasPaintedContent = false; | 1219 hasPaintedContent = false; |
| (...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2576 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 2580 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
| 2577 name = "Scrolling Contents Layer"; | 2581 name = "Scrolling Contents Layer"; |
| 2578 } else { | 2582 } else { |
| 2579 ASSERT_NOT_REACHED(); | 2583 ASSERT_NOT_REACHED(); |
| 2580 } | 2584 } |
| 2581 | 2585 |
| 2582 return name; | 2586 return name; |
| 2583 } | 2587 } |
| 2584 | 2588 |
| 2585 } // namespace blink | 2589 } // namespace blink |
| OLD | NEW |