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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 if (!context->hasAlpha()) | 302 if (!context->hasAlpha()) |
303 m_graphicsLayer->setContentsOpaque(true); | 303 m_graphicsLayer->setContentsOpaque(true); |
304 else if (WebLayer* layer = context->platformLayer()) | 304 else if (WebLayer* layer = context->platformLayer()) |
305 m_graphicsLayer->setContentsOpaque(!Color(layer->backgroundColor()).
hasAlpha()); | 305 m_graphicsLayer->setContentsOpaque(!Color(layer->backgroundColor()).
hasAlpha()); |
306 else | 306 else |
307 m_graphicsLayer->setContentsOpaque(false); | 307 m_graphicsLayer->setContentsOpaque(false); |
308 } else if (m_backgroundLayer) { | 308 } else if (m_backgroundLayer) { |
309 m_graphicsLayer->setContentsOpaque(false); | 309 m_graphicsLayer->setContentsOpaque(false); |
310 m_backgroundLayer->setContentsOpaque(m_owningLayer.backgroundIsKnownToBe
OpaqueInRect(compositedBounds())); | 310 m_backgroundLayer->setContentsOpaque(m_owningLayer.backgroundIsKnownToBe
OpaqueInRect(compositedBounds())); |
311 } else { | 311 } else { |
312 // For non-root layers, background is always painted by the primary grap
hics layer. | 312 // For non-root layers, background is painted by the scrolling contents
layer if all backgrounds |
| 313 // are background attachment local, otherwise background is painted by t
he primary graphics layer. |
| 314 if (hasScrollingLayer() && m_owningLayer.shouldPaintBackgroundOntoForegr
ound()) { |
| 315 // Backgrounds painted onto the foreground are clipped by the paddin
g box rect. |
| 316 // TODO(flackr): This should actually check the entire overflow rect
within the |
| 317 // scrolling contents layer but since we currently only trigger this
for solid |
| 318 // color backgrounds the answer will be the same. |
| 319 m_scrollingContentsLayer->setContentsOpaque(m_owningLayer.background
IsKnownToBeOpaqueInRect(toLayoutBox(layoutObject())->paddingBoxRect())); |
| 320 } |
| 321 // The border is always painted into the m_graphicsLayer, so we check if
it is known to be |
| 322 // opaque separately. |
313 m_graphicsLayer->setContentsOpaque(m_owningLayer.backgroundIsKnownToBeOp
aqueInRect(compositedBounds())); | 323 m_graphicsLayer->setContentsOpaque(m_owningLayer.backgroundIsKnownToBeOp
aqueInRect(compositedBounds())); |
314 } | 324 } |
315 } | 325 } |
316 | 326 |
317 void CompositedLayerMapping::updateCompositedBounds() | 327 void CompositedLayerMapping::updateCompositedBounds() |
318 { | 328 { |
319 ASSERT(m_owningLayer.compositor()->lifecycle().state() == DocumentLifecycle:
:InCompositingUpdate); | 329 ASSERT(m_owningLayer.compositor()->lifecycle().state() == DocumentLifecycle:
:InCompositingUpdate); |
320 // FIXME: if this is really needed for performance, it would be better to st
ore it on Layer. | 330 // FIXME: if this is really needed for performance, it would be better to st
ore it on Layer. |
321 m_compositedBounds = m_owningLayer.boundingBoxForCompositing(); | 331 m_compositedBounds = m_owningLayer.boundingBoxForCompositing(); |
322 m_contentOffsetInCompositingLayerDirty = true; | 332 m_contentOffsetInCompositingLayerDirty = true; |
(...skipping 2337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2660 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 2670 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
2661 name = "Scrolling Contents Layer"; | 2671 name = "Scrolling Contents Layer"; |
2662 } else { | 2672 } else { |
2663 ASSERT_NOT_REACHED(); | 2673 ASSERT_NOT_REACHED(); |
2664 } | 2674 } |
2665 | 2675 |
2666 return name; | 2676 return name; |
2667 } | 2677 } |
2668 | 2678 |
2669 } // namespace blink | 2679 } // namespace blink |
OLD | NEW |