Chromium Code Reviews| 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. | |
|
chrishtr
2016/07/29 21:04:34
Even with this CL, doesn't m_graphicsLayer still p
flackr
2016/08/02 16:58:14
No, it's either painted into m_scrollingContentsLa
chrishtr
2016/08/03 18:58:00
1. I don't see this exclusion in the current patch
flackr
2016/08/03 20:58:52
We always paint the border and shadows into the m_
chrishtr
2016/08/04 05:20:52
I still don't see the logic that leads to this...
| |
| 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 2091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2414 if (graphicsLayerPaintingPhase & GraphicsLayerPaintBackground) | 2424 if (graphicsLayerPaintingPhase & GraphicsLayerPaintBackground) |
| 2415 paintLayerFlags |= PaintLayerPaintingCompositingBackgroundPhase; | 2425 paintLayerFlags |= PaintLayerPaintingCompositingBackgroundPhase; |
| 2416 if (graphicsLayerPaintingPhase & GraphicsLayerPaintForeground) | 2426 if (graphicsLayerPaintingPhase & GraphicsLayerPaintForeground) |
| 2417 paintLayerFlags |= PaintLayerPaintingCompositingForegroundPhase; | 2427 paintLayerFlags |= PaintLayerPaintingCompositingForegroundPhase; |
| 2418 if (graphicsLayerPaintingPhase & GraphicsLayerPaintMask) | 2428 if (graphicsLayerPaintingPhase & GraphicsLayerPaintMask) |
| 2419 paintLayerFlags |= PaintLayerPaintingCompositingMaskPhase; | 2429 paintLayerFlags |= PaintLayerPaintingCompositingMaskPhase; |
| 2420 if (graphicsLayerPaintingPhase & GraphicsLayerPaintChildClippingMask) | 2430 if (graphicsLayerPaintingPhase & GraphicsLayerPaintChildClippingMask) |
| 2421 paintLayerFlags |= PaintLayerPaintingChildClippingMaskPhase; | 2431 paintLayerFlags |= PaintLayerPaintingChildClippingMaskPhase; |
| 2422 if (graphicsLayerPaintingPhase & GraphicsLayerPaintOverflowContents) | 2432 if (graphicsLayerPaintingPhase & GraphicsLayerPaintOverflowContents) |
| 2423 paintLayerFlags |= PaintLayerPaintingOverflowContents; | 2433 paintLayerFlags |= PaintLayerPaintingOverflowContents; |
| 2424 if (graphicsLayerPaintingPhase & GraphicsLayerPaintCompositedScroll) | 2434 if (graphicsLayerPaintingPhase & GraphicsLayerPaintCompositedScroll) { |
| 2425 paintLayerFlags |= PaintLayerPaintingCompositingScrollingPhase; | 2435 paintLayerFlags |= PaintLayerPaintingCompositingScrollingPhase; |
| 2436 if (m_owningLayer.shouldPaintBackgroundOntoForeground()) | |
| 2437 paintLayerFlags |= PaintLayerPaintingBackgroundOntoForeground; | |
| 2438 } | |
| 2426 | 2439 |
| 2427 if (graphicsLayer == m_backgroundLayer.get()) | 2440 if (graphicsLayer == m_backgroundLayer.get()) |
| 2428 paintLayerFlags |= (PaintLayerPaintingRootBackgroundOnly | PaintLayerPai ntingCompositingForegroundPhase); // Need PaintLayerPaintingCompositingForegroun dPhase to walk child layers. | 2441 paintLayerFlags |= (PaintLayerPaintingRootBackgroundOnly | PaintLayerPai ntingCompositingForegroundPhase); // Need PaintLayerPaintingCompositingForegroun dPhase to walk child layers. |
| 2429 else if (compositor()->fixedRootBackgroundLayer()) | 2442 else if (compositor()->fixedRootBackgroundLayer()) |
| 2430 paintLayerFlags |= PaintLayerPaintingSkipRootBackground; | 2443 paintLayerFlags |= PaintLayerPaintingSkipRootBackground; |
| 2431 | 2444 |
| 2432 if (graphicsLayer == m_graphicsLayer.get() | 2445 if (graphicsLayer == m_graphicsLayer.get() |
| 2433 || graphicsLayer == m_foregroundLayer.get() | 2446 || graphicsLayer == m_foregroundLayer.get() |
| 2434 || graphicsLayer == m_backgroundLayer.get() | 2447 || graphicsLayer == m_backgroundLayer.get() |
| 2435 || graphicsLayer == m_maskLayer.get() | 2448 || graphicsLayer == m_maskLayer.get() |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2660 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 2673 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
| 2661 name = "Scrolling Contents Layer"; | 2674 name = "Scrolling Contents Layer"; |
| 2662 } else { | 2675 } else { |
| 2663 ASSERT_NOT_REACHED(); | 2676 ASSERT_NOT_REACHED(); |
| 2664 } | 2677 } |
| 2665 | 2678 |
| 2666 return name; | 2679 return name; |
| 2667 } | 2680 } |
| 2668 | 2681 |
| 2669 } // namespace blink | 2682 } // namespace blink |
| OLD | NEW |