OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/layout/compositing/CompositedLayerMapping.h" | 5 #include "core/layout/compositing/CompositedLayerMapping.h" |
6 | 6 |
7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
8 #include "core/layout/LayoutBoxModelObject.h" | 8 #include "core/layout/LayoutBoxModelObject.h" |
9 #include "core/layout/LayoutTestHelper.h" | 9 #include "core/layout/LayoutTestHelper.h" |
10 #include "core/layout/api/LayoutViewItem.h" | 10 #include "core/layout/api/LayoutViewItem.h" |
(...skipping 29 matching lines...) Expand all Loading... | |
40 return CompositedLayerMapping::interestRectChangedEnoughToRepaint(previo usInterestRect, newInterestRect, layerSize); | 40 return CompositedLayerMapping::interestRectChangedEnoughToRepaint(previo usInterestRect, newInterestRect, layerSize); |
41 } | 41 } |
42 | 42 |
43 IntRect previousInterestRect(const GraphicsLayer* graphicsLayer) | 43 IntRect previousInterestRect(const GraphicsLayer* graphicsLayer) |
44 { | 44 { |
45 return graphicsLayer->m_previousInterestRect; | 45 return graphicsLayer->m_previousInterestRect; |
46 } | 46 } |
47 | 47 |
48 bool shouldPaintBackgroundOntoScrollingContentsLayer(const char* elementId) | 48 bool shouldPaintBackgroundOntoScrollingContentsLayer(const char* elementId) |
49 { | 49 { |
50 CompositedLayerMapping* mapping = toLayoutBlock(getLayoutObjectByElement Id(elementId))->layer()->compositedLayerMapping(); | 50 PaintLayer* paintLayer = toLayoutBlock(getLayoutObjectByElementId(elemen tId))->layer(); |
51 return mapping->shouldPaintBackgroundOntoScrollingContentsLayer(); | 51 return paintLayer->shouldPaintBackgroundOntoScrollingContentsLayer(); |
flackr
2016/08/30 21:14:49
We should probably move the tests rather than have
Stephen Chennney
2016/08/31 20:50:20
Done.
| |
52 } | 52 } |
53 | 53 |
54 private: | 54 private: |
55 void SetUp() override | 55 void SetUp() override |
56 { | 56 { |
57 RenderingTest::SetUp(); | 57 RenderingTest::SetUp(); |
58 enableCompositing(); | 58 enableCompositing(); |
59 } | 59 } |
60 | 60 |
61 void TearDown() override | 61 void TearDown() override |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
667 // Sixth scroller can paint background into scrolling contents layer because the image is locally attached and even though | 667 // Sixth scroller can paint background into scrolling contents layer because the image is locally attached and even though |
668 // the color is not, it is filled to the padding box so it will be drawn the same as a locally attached background. | 668 // the color is not, it is filled to the padding box so it will be drawn the same as a locally attached background. |
669 EXPECT_TRUE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller6")); | 669 EXPECT_TRUE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller6")); |
670 | 670 |
671 // Seventh scroller cannot paint background into scrolling contents layer be cause the color is filled to the content | 671 // Seventh scroller cannot paint background into scrolling contents layer be cause the color is filled to the content |
672 // box and we have padding so it is not equivalent to a locally attached bac kground. | 672 // box and we have padding so it is not equivalent to a locally attached bac kground. |
673 EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller7")); | 673 EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller7")); |
674 } | 674 } |
675 | 675 |
676 } // namespace blink | 676 } // namespace blink |
OLD | NEW |