| 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): Check the entire overflow rect. |
| 317 m_scrollingContentsLayer->setContentsOpaque(m_owningLayer.background
IsKnownToBeOpaqueInRect(toLayoutBox(layoutObject())->paddingBoxRect())); |
| 318 } |
| 319 // The border is always painted by the m_graphicsLayer, so we check if i
t is known to be |
| 320 // opaque separately. |
| 313 m_graphicsLayer->setContentsOpaque(m_owningLayer.backgroundIsKnownToBeOp
aqueInRect(compositedBounds())); | 321 m_graphicsLayer->setContentsOpaque(m_owningLayer.backgroundIsKnownToBeOp
aqueInRect(compositedBounds())); |
| 314 } | 322 } |
| 315 } | 323 } |
| 316 | 324 |
| 317 void CompositedLayerMapping::updateCompositedBounds() | 325 void CompositedLayerMapping::updateCompositedBounds() |
| 318 { | 326 { |
| 319 ASSERT(m_owningLayer.compositor()->lifecycle().state() == DocumentLifecycle:
:InCompositingUpdate); | 327 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. | 328 // FIXME: if this is really needed for performance, it would be better to st
ore it on Layer. |
| 321 m_compositedBounds = m_owningLayer.boundingBoxForCompositing(); | 329 m_compositedBounds = m_owningLayer.boundingBoxForCompositing(); |
| 322 m_contentOffsetInCompositingLayerDirty = true; | 330 m_contentOffsetInCompositingLayerDirty = true; |
| (...skipping 2091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2414 if (graphicsLayerPaintingPhase & GraphicsLayerPaintBackground) | 2422 if (graphicsLayerPaintingPhase & GraphicsLayerPaintBackground) |
| 2415 paintLayerFlags |= PaintLayerPaintingCompositingBackgroundPhase; | 2423 paintLayerFlags |= PaintLayerPaintingCompositingBackgroundPhase; |
| 2416 if (graphicsLayerPaintingPhase & GraphicsLayerPaintForeground) | 2424 if (graphicsLayerPaintingPhase & GraphicsLayerPaintForeground) |
| 2417 paintLayerFlags |= PaintLayerPaintingCompositingForegroundPhase; | 2425 paintLayerFlags |= PaintLayerPaintingCompositingForegroundPhase; |
| 2418 if (graphicsLayerPaintingPhase & GraphicsLayerPaintMask) | 2426 if (graphicsLayerPaintingPhase & GraphicsLayerPaintMask) |
| 2419 paintLayerFlags |= PaintLayerPaintingCompositingMaskPhase; | 2427 paintLayerFlags |= PaintLayerPaintingCompositingMaskPhase; |
| 2420 if (graphicsLayerPaintingPhase & GraphicsLayerPaintChildClippingMask) | 2428 if (graphicsLayerPaintingPhase & GraphicsLayerPaintChildClippingMask) |
| 2421 paintLayerFlags |= PaintLayerPaintingChildClippingMaskPhase; | 2429 paintLayerFlags |= PaintLayerPaintingChildClippingMaskPhase; |
| 2422 if (graphicsLayerPaintingPhase & GraphicsLayerPaintOverflowContents) | 2430 if (graphicsLayerPaintingPhase & GraphicsLayerPaintOverflowContents) |
| 2423 paintLayerFlags |= PaintLayerPaintingOverflowContents; | 2431 paintLayerFlags |= PaintLayerPaintingOverflowContents; |
| 2424 if (graphicsLayerPaintingPhase & GraphicsLayerPaintCompositedScroll) | 2432 if (graphicsLayerPaintingPhase & GraphicsLayerPaintCompositedScroll) { |
| 2425 paintLayerFlags |= PaintLayerPaintingCompositingScrollingPhase; | 2433 paintLayerFlags |= PaintLayerPaintingCompositingScrollingPhase; |
| 2434 if (m_owningLayer.shouldPaintBackgroundOntoForeground()) |
| 2435 paintLayerFlags |= PaintLayerPaintingBackgroundOntoForeground; |
| 2436 } |
| 2426 | 2437 |
| 2427 if (graphicsLayer == m_backgroundLayer.get()) | 2438 if (graphicsLayer == m_backgroundLayer.get()) |
| 2428 paintLayerFlags |= (PaintLayerPaintingRootBackgroundOnly | PaintLayerPai
ntingCompositingForegroundPhase); // Need PaintLayerPaintingCompositingForegroun
dPhase to walk child layers. | 2439 paintLayerFlags |= (PaintLayerPaintingRootBackgroundOnly | PaintLayerPai
ntingCompositingForegroundPhase); // Need PaintLayerPaintingCompositingForegroun
dPhase to walk child layers. |
| 2429 else if (compositor()->fixedRootBackgroundLayer()) | 2440 else if (compositor()->fixedRootBackgroundLayer()) |
| 2430 paintLayerFlags |= PaintLayerPaintingSkipRootBackground; | 2441 paintLayerFlags |= PaintLayerPaintingSkipRootBackground; |
| 2431 | 2442 |
| 2432 if (graphicsLayer == m_graphicsLayer.get() | 2443 if (graphicsLayer == m_graphicsLayer.get() |
| 2433 || graphicsLayer == m_foregroundLayer.get() | 2444 || graphicsLayer == m_foregroundLayer.get() |
| 2434 || graphicsLayer == m_backgroundLayer.get() | 2445 || graphicsLayer == m_backgroundLayer.get() |
| 2435 || graphicsLayer == m_maskLayer.get() | 2446 || graphicsLayer == m_maskLayer.get() |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2660 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 2671 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
| 2661 name = "Scrolling Contents Layer"; | 2672 name = "Scrolling Contents Layer"; |
| 2662 } else { | 2673 } else { |
| 2663 ASSERT_NOT_REACHED(); | 2674 ASSERT_NOT_REACHED(); |
| 2664 } | 2675 } |
| 2665 | 2676 |
| 2666 return name; | 2677 return name; |
| 2667 } | 2678 } |
| 2668 | 2679 |
| 2669 } // namespace blink | 2680 } // namespace blink |
| OLD | NEW |