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 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 } | 1103 } |
1104 | 1104 |
1105 bool hasPaintedContent = containsPaintedContent(); | 1105 bool hasPaintedContent = containsPaintedContent(); |
1106 if (hasPaintedContent && isAcceleratedCanvas(renderer())) { | 1106 if (hasPaintedContent && isAcceleratedCanvas(renderer())) { |
1107 CanvasRenderingContext* context = toHTMLCanvasElement(renderer()->node()
)->renderingContext(); | 1107 CanvasRenderingContext* context = toHTMLCanvasElement(renderer()->node()
)->renderingContext(); |
1108 // Content layer may be null if context is lost. | 1108 // Content layer may be null if context is lost. |
1109 if (WebLayer* contentLayer = context->platformLayer()) { | 1109 if (WebLayer* contentLayer = context->platformLayer()) { |
1110 Color bgColor(Color::transparent); | 1110 Color bgColor(Color::transparent); |
1111 if (contentLayerSupportsDirectBackgroundComposition(renderer())) { | 1111 if (contentLayerSupportsDirectBackgroundComposition(renderer())) { |
1112 bgColor = rendererBackgroundColor(); | 1112 bgColor = rendererBackgroundColor(); |
| 1113 hasPaintedContent = false; |
1113 } | 1114 } |
1114 contentLayer->setBackgroundColor(bgColor.rgb()); | 1115 contentLayer->setBackgroundColor(bgColor.rgb()); |
1115 } | 1116 } |
1116 } | 1117 } |
1117 | 1118 |
1118 // FIXME: we could refine this to only allocate backings for one of these la
yers if possible. | 1119 // FIXME: we could refine this to only allocate backings for one of these la
yers if possible. |
1119 m_graphicsLayer->setDrawsContent(hasPaintedContent); | 1120 m_graphicsLayer->setDrawsContent(hasPaintedContent); |
1120 if (m_foregroundLayer) | 1121 if (m_foregroundLayer) |
1121 m_foregroundLayer->setDrawsContent(hasPaintedContent); | 1122 m_foregroundLayer->setDrawsContent(hasPaintedContent); |
1122 | 1123 |
(...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2283 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { | 2284 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { |
2284 name = "Scrolling Block Selection Layer"; | 2285 name = "Scrolling Block Selection Layer"; |
2285 } else { | 2286 } else { |
2286 ASSERT_NOT_REACHED(); | 2287 ASSERT_NOT_REACHED(); |
2287 } | 2288 } |
2288 | 2289 |
2289 return name; | 2290 return name; |
2290 } | 2291 } |
2291 | 2292 |
2292 } // namespace blink | 2293 } // namespace blink |
OLD | NEW |