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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 return pixelSnappedIntRect(toLayoutBox(layoutObject)->contentBoxRect()); | 92 return pixelSnappedIntRect(toLayoutBox(layoutObject)->contentBoxRect()); |
93 } | 93 } |
94 | 94 |
95 static IntRect backgroundRect(const LayoutObject* layoutObject) | 95 static IntRect backgroundRect(const LayoutObject* layoutObject) |
96 { | 96 { |
97 if (!layoutObject->isBox()) | 97 if (!layoutObject->isBox()) |
98 return IntRect(); | 98 return IntRect(); |
99 | 99 |
100 LayoutRect rect; | 100 LayoutRect rect; |
101 const LayoutBox* box = toLayoutBox(layoutObject); | 101 const LayoutBox* box = toLayoutBox(layoutObject); |
102 return pixelSnappedIntRect(box->backgroundClipRect()); | 102 return pixelSnappedIntRect(box->backgroundRect(BackgroundClipRect)); |
103 } | 103 } |
104 | 104 |
105 static inline bool isAcceleratedCanvas(const LayoutObject* layoutObject) | 105 static inline bool isAcceleratedCanvas(const LayoutObject* layoutObject) |
106 { | 106 { |
107 if (layoutObject->isCanvas()) { | 107 if (layoutObject->isCanvas()) { |
108 HTMLCanvasElement* canvas = toHTMLCanvasElement(layoutObject->node()); | 108 HTMLCanvasElement* canvas = toHTMLCanvasElement(layoutObject->node()); |
109 if (CanvasRenderingContext* context = canvas->renderingContext()) | 109 if (CanvasRenderingContext* context = canvas->renderingContext()) |
110 return context->isAccelerated(); | 110 return context->isAccelerated(); |
111 } | 111 } |
112 return false; | 112 return false; |
(...skipping 2467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2580 } | 2580 } |
2581 if (previousIndex == indexToClear && layerToRemove->groupedMapping() == this
) { | 2581 if (previousIndex == indexToClear && layerToRemove->groupedMapping() == this
) { |
2582 compositor()->paintInvalidationOnCompositingChange(layerToRemove); | 2582 compositor()->paintInvalidationOnCompositingChange(layerToRemove); |
2583 return true; | 2583 return true; |
2584 } | 2584 } |
2585 return false; | 2585 return false; |
2586 } | 2586 } |
2587 | 2587 |
2588 bool CompositedLayerMapping::shouldPaintBackgroundOntoScrollingContentsLayer() c
onst | 2588 bool CompositedLayerMapping::shouldPaintBackgroundOntoScrollingContentsLayer() c
onst |
2589 { | 2589 { |
2590 // TODO(flackr): Add support for painting locally attached background images
. https://crbug.com/625882 | |
2591 const FillLayer& backgroundLayer = m_owningLayer.layoutObject()->style()->ba
ckgroundLayers(); | |
2592 return !m_owningLayer.isRootLayer() | 2590 return !m_owningLayer.isRootLayer() |
2593 && m_owningLayer.scrollsOverflow() | 2591 && m_owningLayer.scrollsOverflow() |
2594 && !backgroundLayer.image() | 2592 && m_owningLayer.layoutObject()->style()->hasEntirelyLocalBackground() |
2595 && !backgroundLayer.next() | |
2596 && (backgroundLayer.attachment() == LocalBackgroundAttachment | |
2597 || backgroundLayer.clip() == PaddingFillBox) | |
2598 && !m_owningLayer.stackingNode()->hasNegativeZOrderList(); | 2593 && !m_owningLayer.stackingNode()->hasNegativeZOrderList(); |
2599 } | 2594 } |
2600 | 2595 |
2601 bool CompositedLayerMapping::updateSquashingLayerAssignment(PaintLayer* squashed
Layer, size_t nextSquashedLayerIndex) | 2596 bool CompositedLayerMapping::updateSquashingLayerAssignment(PaintLayer* squashed
Layer, size_t nextSquashedLayerIndex) |
2602 { | 2597 { |
2603 GraphicsLayerPaintInfo paintInfo; | 2598 GraphicsLayerPaintInfo paintInfo; |
2604 paintInfo.paintLayer = squashedLayer; | 2599 paintInfo.paintLayer = squashedLayer; |
2605 // NOTE: composited bounds are updated elsewhere | 2600 // NOTE: composited bounds are updated elsewhere |
2606 // NOTE: offsetFromLayoutObject is updated elsewhere | 2601 // NOTE: offsetFromLayoutObject is updated elsewhere |
2607 | 2602 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2711 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 2706 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
2712 name = "Scrolling Contents Layer"; | 2707 name = "Scrolling Contents Layer"; |
2713 } else { | 2708 } else { |
2714 ASSERT_NOT_REACHED(); | 2709 ASSERT_NOT_REACHED(); |
2715 } | 2710 } |
2716 | 2711 |
2717 return name; | 2712 return name; |
2718 } | 2713 } |
2719 | 2714 |
2720 } // namespace blink | 2715 } // namespace blink |
OLD | NEW |