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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 return pixelSnappedIntRect(toLayoutBox(layoutObject)->contentBoxRect()); | 91 return pixelSnappedIntRect(toLayoutBox(layoutObject)->contentBoxRect()); |
92 } | 92 } |
93 | 93 |
94 static IntRect backgroundRect(const LayoutObject* layoutObject) | 94 static IntRect backgroundRect(const LayoutObject* layoutObject) |
95 { | 95 { |
96 if (!layoutObject->isBox()) | 96 if (!layoutObject->isBox()) |
97 return IntRect(); | 97 return IntRect(); |
98 | 98 |
99 LayoutRect rect; | 99 LayoutRect rect; |
100 const LayoutBox* box = toLayoutBox(layoutObject); | 100 const LayoutBox* box = toLayoutBox(layoutObject); |
101 return pixelSnappedIntRect(box->backgroundClipRect()); | 101 return pixelSnappedIntRect(box->backgroundRect(BackgroundClipRect)); |
102 } | 102 } |
103 | 103 |
104 static inline bool isAcceleratedCanvas(const LayoutObject* layoutObject) | 104 static inline bool isAcceleratedCanvas(const LayoutObject* layoutObject) |
105 { | 105 { |
106 if (layoutObject->isCanvas()) { | 106 if (layoutObject->isCanvas()) { |
107 HTMLCanvasElement* canvas = toHTMLCanvasElement(layoutObject->node()); | 107 HTMLCanvasElement* canvas = toHTMLCanvasElement(layoutObject->node()); |
108 if (CanvasRenderingContext* context = canvas->renderingContext()) | 108 if (CanvasRenderingContext* context = canvas->renderingContext()) |
109 return context->isAccelerated(); | 109 return context->isAccelerated(); |
110 } | 110 } |
111 return false; | 111 return false; |
(...skipping 2448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2560 } | 2560 } |
2561 if (previousIndex == indexToClear && layerToRemove->groupedMapping() == this
) { | 2561 if (previousIndex == indexToClear && layerToRemove->groupedMapping() == this
) { |
2562 compositor()->paintInvalidationOnCompositingChange(layerToRemove); | 2562 compositor()->paintInvalidationOnCompositingChange(layerToRemove); |
2563 return true; | 2563 return true; |
2564 } | 2564 } |
2565 return false; | 2565 return false; |
2566 } | 2566 } |
2567 | 2567 |
2568 bool CompositedLayerMapping::shouldPaintBackgroundOntoScrollingContentsLayer() c
onst | 2568 bool CompositedLayerMapping::shouldPaintBackgroundOntoScrollingContentsLayer() c
onst |
2569 { | 2569 { |
2570 // TODO(flackr): Add support for painting locally attached background images
. https://crbug.com/625882 | |
2571 const FillLayer& backgroundLayer = m_owningLayer.layoutObject()->style()->ba
ckgroundLayers(); | |
2572 return !m_owningLayer.isRootLayer() | 2570 return !m_owningLayer.isRootLayer() |
2573 && m_owningLayer.scrollsOverflow() | 2571 && m_owningLayer.scrollsOverflow() |
2574 && !backgroundLayer.image() | 2572 && m_owningLayer.layoutObject()->style()->hasEntirelyLocalBackground() |
2575 && !backgroundLayer.next() | |
2576 && (backgroundLayer.attachment() == LocalBackgroundAttachment | |
2577 || backgroundLayer.clip() == PaddingFillBox) | |
2578 && !m_owningLayer.stackingNode()->hasNegativeZOrderList(); | 2573 && !m_owningLayer.stackingNode()->hasNegativeZOrderList(); |
2579 } | 2574 } |
2580 | 2575 |
2581 bool CompositedLayerMapping::updateSquashingLayerAssignment(PaintLayer* squashed
Layer, size_t nextSquashedLayerIndex) | 2576 bool CompositedLayerMapping::updateSquashingLayerAssignment(PaintLayer* squashed
Layer, size_t nextSquashedLayerIndex) |
2582 { | 2577 { |
2583 GraphicsLayerPaintInfo paintInfo; | 2578 GraphicsLayerPaintInfo paintInfo; |
2584 paintInfo.paintLayer = squashedLayer; | 2579 paintInfo.paintLayer = squashedLayer; |
2585 // NOTE: composited bounds are updated elsewhere | 2580 // NOTE: composited bounds are updated elsewhere |
2586 // NOTE: offsetFromLayoutObject is updated elsewhere | 2581 // NOTE: offsetFromLayoutObject is updated elsewhere |
2587 | 2582 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2691 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 2686 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
2692 name = "Scrolling Contents Layer"; | 2687 name = "Scrolling Contents Layer"; |
2693 } else { | 2688 } else { |
2694 ASSERT_NOT_REACHED(); | 2689 ASSERT_NOT_REACHED(); |
2695 } | 2690 } |
2696 | 2691 |
2697 return name; | 2692 return name; |
2698 } | 2693 } |
2699 | 2694 |
2700 } // namespace blink | 2695 } // namespace blink |
OLD | NEW |